Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError during install_deps with emoji in git branch name #2768

Closed
zariiii9003 opened this issue Dec 21, 2022 · 9 comments · Fixed by #2790
Closed

UnicodeEncodeError during install_deps with emoji in git branch name #2768

zariiii9003 opened this issue Dec 21, 2022 · 9 comments · Fixed by #2790
Labels
bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@zariiii9003
Copy link

zariiii9003 commented Dec 21, 2022

Issue

The installation fails on Windows when there is an emoji in the git branch name.
See here. I'm not sure if it's a pip or tox error.

Here is the branch.

Environment

Provide at least:

  • OS: windows-latest
  • packages: cachetools-5.2.0 chardet-5.1.0 colorama-0.4.6 distlib-0.3.6 filelock-3.8.2 packaging-22.0 platformdirs-2.6.0 pluggy-1.0.0 pyproject-api-1.2.1 tomli-2.0.1 tox-4.0.16 virtualenv-20.17.1

Output of running tox

Provide the output of tox -rvv:

Run tox -e gh
  tox -e gh
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    PY_COLORS: [1](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:1)
    pythonLocation: C:\hostedtoolcache\windows\Python\3.10.9\x64
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.10.9\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.9\x64
    Python[2](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:2)_ROOT_DIR: C:\hostedtoolcache\windows\Python\[3](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:3).10.9\x6[4](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:4)
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.9\x64
.pkg: remove tox env folder D:\a\python-can\python-can\.tox\.pkg
gh: install_deps> python -I -m pip install coverage==6.[5](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:5).0 coveralls==3.3.1 hypothesis~=[6](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:6).35.0 parameterized~=0.8 pyserial~=3.5 pytest-cov==4.0.0 pytest-timeout==2.0.2 pytest==[7](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:7).1.*,>=7.1.2
gh: internal error
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\session\cmd\run\single.py", line 45, in _evaluate
    tox_env.setup()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 242, in setup
    self._setup_env()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\runner.py", line 99, in _setup_env
    self._install_deps()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\runner.py", line 103, in _install_deps
    self._install(requirements_file, PythonRun.__name__, "deps")
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 96, in _install
    self.installer.install(arguments, section, of_type)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\pip\pip_install.py", line [8](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:8)3, in install
    self._install_requirement_file(arguments, section, of_type)
  File "C:\hostedtoolcache\windows\Python\3.10.[9](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:9)\x64\lib\site-packages\tox\tox_env\python\pip\pip_install.py", line 111, in _install_requirement_file
    self._execute_installer(args, of_type)
  File "C:\hostedtoolcache\windows\Python\3.[10](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:10).9\x64\lib\site-packages\tox\tox_env\python\pip\pip_install.py", line 165, in _execute_installer
    outcome = self._env.execute(cmd, stdin=StdinSource.OFF, run_id=f"install_{of_type}")
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 379, in execute
    with self.execute_async(cmd, stdin, show, cwd, run_id, executor) as status:
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\contextlib.py", line 142, in __exit__
    next(self.gen)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 433, in execute_async
    self._log_execute(request, execute_status)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 439, in _log_execute
    self._write_execute_log(self.name, self.env_log_dir / f"{self._log_id}-{request.run_id}.log", request, status)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 447, in _write_execute_log
    file.write(f"env {env_key}: {env_value}\n")
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\encodings\cp[12](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:13)52.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001fa9f' in position 21: character maps to <undefined>
  gh: FAIL code 2 ([13](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:14).27 seconds)
  evaluation failed :( ([17](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914600#step:5:18).48 seconds)
Error: Process completed with exit code 1.
@gaborbernat gaborbernat added bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. labels Dec 21, 2022
@gaborbernat
Copy link
Member

Seems the branch is no longer valid 🤔

@zariiii9003
Copy link
Author

zariiii9003 commented Dec 21, 2022

Yes sorry, the owner deleted it. I created my own here

And here is the output with increased verbosity:

tox -rvv -e gh
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    PY_COLORS: 1
    pythonLocation: C:\hostedtoolcache\windows\Python\[3](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:3).10.9\x6[4](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:4)
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.10.9\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.9\x64
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.9\x64
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.9\x64
  
.pkg: 1761 W remove tox env folder D:\a\python-can\python-can\.tox\.pkg [tox\tox_env\api.py:311]
gh: 1761 D created app data folder C:\Users\runneradmin\AppData\Local\pypa\virtualenv [virtualenv\app_data\__init__.py:40]
gh: 1761 I find interpreter for spec PythonSpec(path=C:\hostedtoolcache\windows\Python\3.10.9\x64\python.exe) [virtualenv\discovery\builtin.py:[5](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:5)[6](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:6)]
gh: 1[7](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:7)76 I proposed PythonInfo(spec=CPython3.10.9.final.0-64, exe=C:\hostedtoolcache\windows\Python\3.10.9\x64\python.exe, platform=win32, version='3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]', encoding_fs_io=utf-[8](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:8)-cp1252) [virtualenv\discovery\builtin.py:63]
gh: 1776 D accepted PythonInfo(spec=CPython3.10.[9](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:9).final.0-64, exe=C:\hostedtoolcache\windows\Python\3.[10](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:10).9\x64\python.exe, platform=win32, version='3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]', encoding_fs_io=utf-8-cp1252) [virtualenv\discovery\builtin.py:65]
gh: 1776 D symlink on filesystem does work [virtualenv\info.py:43]
gh: 1776 D filesystem is not case-sensitive [virtualenv\info.py:24]
gh: 1808 I create virtual environment via CPython3Windows(dest=D:\a\python-can\python-can\.tox\gh, clear=False, no_vcs_ignore=False, global=False) [virtualenv\run\session.py:48]
gh: 1808 D create folder D:\a\python-can\python-can\.tox\gh\Lib\site-packages [virtualenv\util\path\_sync.py:9]
gh: 1808 D create folder D:\a\python-can\python-can\.tox\gh\Scripts [virtualenv\util\path\_sync.py:9]
gh: 1808 D write D:\a\python-can\python-can\.tox\gh\pyvenv.cfg [virtualenv\create\pyenv_cfg.py:30]
gh: 1808 D 	home = C:\hostedtoolcache\windows\Python\3.10.9\x64 [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	implementation = CPython [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	version_info = 3.10.9.final.0 [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	virtualenv = 20.17.1 [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	include-system-site-packages = false [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	base-prefix = C:\hostedtoolcache\windows\Python\3.10.9\x64 [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	base-exec-prefix = C:\hostedtoolcache\windows\Python\3.10.9\x64 [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D 	base-executable = C:\hostedtoolcache\windows\Python\3.10.9\x64\python.exe [virtualenv\create\pyenv_cfg.py:34]
gh: 1808 D copy C:\hostedtoolcache\windows\Python\3.10.9\x64\Lib\venv\scripts\nt\python.exe to D:\a\python-can\python-can\.tox\gh\Scripts\python.exe [virtualenv\util\path\_sync.py:36]
gh: 1839 D copy C:\hostedtoolcache\windows\Python\3.10.9\x64\Lib\venv\scripts\nt\pythonw.exe to D:\a\python-can\python-can\.tox\gh\Scripts\pythonw.exe [virtualenv\util\path\_sync.py:36]
gh: 1839 D create virtualenv import hook file D:\a\python-can\python-can\.tox\gh\Lib\site-packages\_virtualenv.pth [virtualenv\create\via_global_ref\api.py:89]
gh: 1839 D create D:\a\python-can\python-can\.tox\gh\Lib\site-packages\_virtualenv.py [virtualenv\create\via_global_ref\api.py:92]
gh: 1839 D ============================== target debug ============================== [virtualenv\run\session.py:50]
gh: 1839 D debug via 'D:\a\python-can\python-can\.tox\gh\Scripts\python.exe' 'C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\virtualenv\create\debug.py' [virtualenv\create\creator.py:197]
gh: 1839 D {
  "sys": {
    "executable": "D:\\a\\python-can\\python-can\\.tox\\gh\\Scripts\\python.exe",
    "_base_executable": "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64\\python.exe",
    "prefix": "D:\\a\\python-can\\python-can\\.tox\\gh",
    "base_prefix": "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64",
    "real_prefix": null,
    "exec_prefix": "D:\\a\\python-can\\python-can\\.tox\\gh",
    "base_exec_prefix": "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64",
    "path": [
      "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64\\python310.zip",
      "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64\\DLLs",
      "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64\\lib",
      "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64",
      "D:\\a\\python-can\\python-can\\.tox\\gh",
      "D:\\a\\python-can\\python-can\\.tox\\gh\\lib\\site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "cp1252"
  },
  "version": "3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]",
  "makefile_filename": "C:\\hostedtoolcache\\windows\\Python\\3.10.9\\x64\\Lib\\config\\Makefile",
  "os": "<module 'os' from 'C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.10.9\\\\x64\\\\lib\\\\os.py'>",
  "site": "<module 'site' from 'C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.10.9\\\\x64\\\\lib\\\\site.py'>",
  "datetime": "<module 'datetime' from 'C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.10.9\\\\x64\\\\lib\\\\datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from 'C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.10.9\\\\x64\\\\lib\\\\json\\\\__init__.py'>"
} [virtualenv\run\session.py:51]
gh: 1903 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\runneradmin\AppData\Local\pypa\virtualenv) [virtualenv\run\session.py:55]
gh: 1903 D install pip from wheel C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\virtualenv\seed\wheels\embed\pip-22.3.1-py3-none-any.whl via CopyPipInstall [virtualenv\seed\embed\via_app_data\via_app_data.py:47]
gh: 1903 D install setuptools from wheel C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\virtualenv\seed\wheels\embed\setuptools-65.6.3-py3-none-any.whl via CopyPipInstall [virtualenv\seed\embed\via_app_data\via_app_data.py:47]
gh: 1903 D install wheel from wheel C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\virtualenv\seed\wheels\embed\wheel-0.38.4-py3-none-any.whl via CopyPipInstall [virtualenv\seed\embed\via_app_data\via_app_data.py:47]
gh: 1903 D build install image for setuptools-65.6.3-py3-none-any.whl to C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any [virtualenv\seed\embed\via_app_data\pip_install\base.py:45]
gh: 1918 D build install image for pip-22.3.1-py3-none-any.whl to C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\pip-22.3.1-py3-none-any [virtualenv\seed\embed\via_app_data\pip_install\base.py:45]
gh: 1918 D build install image for wheel-0.38.4-py3-none-any.whl to C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\wheel-0.38.4-py3-none-any [virtualenv\seed\embed\via_app_data\pip_install\base.py:45]
gh: 3873 D copy C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any\distutils-precedence.pth to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\distutils-precedence.pth [virtualenv\util\path\_sync.py:36]
gh: 3873 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any\pkg_resources to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\pkg_resources [virtualenv\util\path\_sync.py:36]
gh: 3888 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any\setuptools to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\setuptools [virtualenv\util\path\_sync.py:36]
gh: 3966 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any\setuptools-65.6.3.dist-info to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\setuptools-65.6.3.dist-info [virtualenv\util\path\_sync.py:36]
gh: 3966 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\wheel-0.38.4-py3-none-any\wheel to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\wheel [virtualenv\util\path\_sync.py:36]
gh: 3966 D copy C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any\setuptools-65.6.3.virtualenv to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\setuptools-65.6.3.virtualenv [virtualenv\util\path\_sync.py:36]
gh: 3966 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\setuptools-65.6.3-py3-none-any\_distutils_hack to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\_distutils_hack [virtualenv\util\path\_sync.py:36]
gh: 3966 D generated console scripts  [virtualenv\seed\embed\via_app_data\pip_install\base.py:41]
gh: 3982 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\wheel-0.38.4-py3-none-any\wheel-0.38.4.dist-info to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\wheel-0.38.4.dist-info [virtualenv\util\path\_sync.py:36]
gh: 3982 D copy C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\wheel-0.38.4-py3-none-any\wheel-0.38.4.virtualenv to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\wheel-0.38.4.virtualenv [virtualenv\util\path\_sync.py:36]
gh: 3982 D generated console scripts wheel-3.10.exe wheel.exe wheel3.10.exe wheel3.exe [virtualenv\seed\embed\via_app_data\pip_install\base.py:41]
gh: 4670 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\pip-22.3.1-py3-none-any\pip to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\pip [virtualenv\util\path\_sync.py:36]
gh: 4858 D copy directory C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\pip-22.3.1-py3-none-any\pip-22.3.1.dist-info to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\pip-22.3.1.dist-info [virtualenv\util\path\_sync.py:36]
gh: 4873 D copy C:\Users\runneradmin\AppData\Local\pypa\virtualenv\wheel\3.10\image\1\CopyPipInstall\pip-22.3.1-py3-none-any\pip-22.3.1.virtualenv to D:\a\python-can\python-can\.tox\gh\Lib\site-packages\pip-22.3.1.virtualenv [virtualenv\util\path\_sync.py:36]
gh: 4873 D generated console scripts pip3.exe pip.exe pip3.10.exe pip-3.10.exe [virtualenv\seed\embed\via_app_data\pip_install\base.py:41]
gh: 4873 I add activators for Bash, Batch, Fish, Nushell, PowerShell, Python [virtualenv\run\session.py:61]
gh: 4873 D write D:\a\python-can\python-can\.tox\gh\pyvenv.cfg [virtualenv\create\pyenv_cfg.py:30]
gh: 4873 D 	home = C:\hostedtoolcache\windows\Python\3.10.9\x64 [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	implementation = CPython [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	version_info = 3.10.9.final.0 [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	virtualenv = 20.17.1 [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	include-system-site-packages = false [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	base-prefix = C:\hostedtoolcache\windows\Python\3.10.9\x64 [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	base-exec-prefix = C:\hostedtoolcache\windows\Python\3.10.9\x64 [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 D 	base-executable = C:\hostedtoolcache\windows\Python\3.10.9\x64\python.exe [virtualenv\create\pyenv_cfg.py:34]
gh: 4873 W install_deps> python -I -m pip install coverage==6.5.0 coveralls==3.3.1 hypothesis~=6.35.0 parameterized~=0.8 pyserial~=3.5 pytest-cov==4.0.0 pytest-timeout==2.0.2 pytest==7.1.*,>=7.1.2 [tox\tox_env\api.py:417]
Collecting coverage==6.5.0
  Downloading coverage-6.5.0-cp310-cp310-win_amd64.whl (188 kB)
     -------------------------------------- 188.5/188.5 kB 5.6 MB/s eta 0:00:00
Collecting coveralls==3.3.1
  Downloading coveralls-3.3.1-py2.py3-none-any.whl (14 kB)
Collecting hypothesis~=6.35.0
  Downloading hypothesis-6.35.1-py3-none-any.whl (376 kB)
     -------------------------------------- 376.5/376.5 kB 2.1 MB/s eta 0:00:00
Collecting parameterized~=0.8
  Downloading parameterized-0.8.1-py2.py3-none-any.whl (26 kB)
Collecting pyserial~=3.5
  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
     ---------------------------------------- 90.6/90.6 kB 5.0 MB/s eta 0:00:00
Collecting pytest-cov==4.0.0
  Downloading pytest_cov-4.0.0-py3-none-any.whl (21 kB)
Collecting pytest-timeout==2.0.2
  Downloading pytest_timeout-2.0.2-py3-none-any.whl ([11](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:11) kB)
Collecting pytest==7.1.*,>=7.1.2
  Downloading pytest-7.1.3-py3-none-any.whl (298 kB)
     -------------------------------------- 298.2/298.2 kB 9.3 MB/s eta 0:00:00
Collecting requests>=1.0.0
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ---------------------------------------- 62.8/62.8 kB 3.5 MB/s eta 0:00:00
Collecting docopt>=0.6.1
  Downloading docopt-0.6.2.tar.gz (25 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting coverage[toml]>=5.2.1
  Downloading coverage-7.0.0-cp310-cp310-win_amd64.whl (191 kB)
     ------------------------------------ 191.2/191.2 kB 830.3 kB/s eta 0:00:00
Collecting tomli>=1.0.0
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting attrs>=19.2.0
  Downloading attrs-22.2.0-py3-none-any.whl (60 kB)
     ---------------------------------------- 60.0/60.0 kB 3.3 MB/s eta 0:00:00
Collecting pluggy<2.0,>=0.12
  Using cached pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting py>=1.8.2
  Downloading py-1.[11](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:12).0-py2.py3-none-any.whl (98 kB)
     ---------------------------------------- 98.7/98.7 kB 5.5 MB/s eta 0:00:00
Collecting packaging
  Using cached packaging-22.0-py3-none-any.whl (42 kB)
Collecting iniconfig
  Downloading iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
Collecting sortedcontainers<3.0.0,>=2.1.0
  Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     -------------------------------------- 61.5/61.5 kB 117.4 kB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
     -------------------------------------- 140.6/140.6 kB 4.2 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.[12](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:13).7-py3-none-any.whl (155 kB)
     -------------------------------------- 155.3/155.3 kB 4.7 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Building wheels for collected packages: docopt
  Building wheel for docopt (setup.py): started
  Building wheel for docopt (setup.py): finished with status 'done'
  Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=[13](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:14)775 sha256=95ea2ff5df1fb96029747ebcf8b77440f8ec30966e087e91df6201d0ff3a3de4
  Stored in directory: c:\users\runneradmin\appdata\local\pip\cache\wheels\7c\d7\8d\2156234738063e3d4a39ba77dc677046100e62766b53807189
Successfully built docopt
Installing collected packages: sortedcontainers, pyserial, parameterized, iniconfig, docopt, urllib3, tomli, py, pluggy, packaging, idna, coverage, colorama, charset-normalizer, certifi, attrs, requests, pytest, hypothesis, pytest-timeout, pytest-cov, coveralls
Successfully installed attrs-22.2.0 certifi-2022.12.7 charset-normalizer-2.1.1 colorama-0.4.6 coverage-6.5.0 coveralls-3.3.1 docopt-0.6.2 hypothesis-6.35.1 idna-3.4 iniconfig-1.1.1 packaging-22.0 parameterized-0.8.1 pluggy-1.0.0 py-1.11.0 pyserial-3.5 pytest-7.1.3 pytest-cov-4.0.0 pytest-timeout-2.0.2 requests-2.28.1 sortedcontainers-2.4.0 tomli-2.0.1 urllib3-1.26.13
gh: 13382 E internal error [tox\session\cmd\run\single.py:57]
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\session\cmd\run\single.py", line 45, in _evaluate
    tox_env.setup()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 242, in setup
    self._setup_env()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\runner.py", line 99, in _setup_env
    self._install_deps()
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\runner.py", line 103, in _install_deps
    self._install(requirements_file, PythonRun.__name__, "deps")
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 96, in _install
    self.installer.install(arguments, section, of_type)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\pip\pip_install.py", line 83, in install
    self._install_requirement_file(arguments, section, of_type)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\pip\pip_install.py", line 111, in _install_requirement_file
    self._execute_installer(args, of_type)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\python\pip\pip_install.py", line 165, in _execute_installer
    outcome = self._env.execute(cmd, stdin=StdinSource.OFF, run_id=f"install_{of_type}")
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 379, in execute
    with self.execute_async(cmd, stdin, show, cwd, run_id, executor) as status:
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\contextlib.py", line [14](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:15)2, in __exit__
    next(self.gen)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 433, in execute_async
    self._log_execute(request, execute_status)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 439, in _log_execute
    self._write_execute_log(self.name, self.env_log_dir / f"{self._log_id}-{request.run_id}.log", request, status)
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\site-packages\tox\tox_env\api.py", line 447, in _write_execute_log
    file.write(f"env {env_key}: {env_value}\n")
  File "C:\hostedtoolcache\windows\Python\3.10.9\x64\lib\encodings\cp1252.py", line [19](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:20), in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001fa9f' in position [27](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:28): character maps to <undefined>
  gh: FAIL code 2 (11.70 seconds)
  evaluation failed :( (13.[28](https://github.com/zariiii9003/python-can/actions/runs/3752224161/jobs/6374138263#step:5:29) seconds)
Error: Process completed with exit code 1.

@gaborbernat gaborbernat added this to the 4.0.x milestone Dec 22, 2022
@jamwil
Copy link
Contributor

jamwil commented Dec 29, 2022

I'm having trouble reproducing this. Not getting these errors with an emoji branch name on my windows machine or in Github Actions. @zariiii9003, do you see any obvious deviations in this action run relative to your runs?

@zariiii9003
Copy link
Author

Thanks for looking into this. I'm not sure if it's relevant, but i found a difference in the git checkout. The problematic character exists in my log:

Checking out the ref
  "C:\Program Files\Git\bin\git.exe" checkout --progress --force -B 🪟 refs/remotes/origin/🪟
  branch '🪟' set up to track 'origin/🪟'.
  Switched to a new branch '🪟'

but not in yours

Checking out the ref
  "C:\Program Files\Git\bin\git.exe" checkout --progress --force refs/remotes/pull/1/merge
  Note: switching to 'refs/remotes/pull/1/merge'.
  
  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.
  
  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -c with the switch command. Example:
  
    git switch -c <new-branch-name>
  
  Or undo this operation with:
  
    git switch -
  
  Turn off this advice by setting config variable advice.detachedHead to false
  
  HEAD is now at 37bd666 Merge 62feda5a7e4e35e190cc3326c87a969e0a377522 into [99](https://github.com/jamwil/tox-2768-test/actions/runs/3801351199/jobs/6465728451#step:3:106)1fb97adda00742c1a2eb3bfd3a04f97717e719

@jamwil
Copy link
Contributor

jamwil commented Dec 29, 2022

Good eye! I'll dig into that.

@jamwil
Copy link
Contributor

jamwil commented Dec 29, 2022

Shoot — still can't get it to error out. I renamed the main branch to 🪟 and manually dispatched the tox run so that it checks out the branch and not a pull request. I can see that the window emoji is appearing in the logs now, but I still can't get tox to choke on it.

https://github.com/jamwil/tox-2768-test/actions/runs/3801607129

@zariiii9003
Copy link
Author

zariiii9003 commented Dec 29, 2022

Can you add GITHUB_* to passenv in your tox file? I think github sets the branch name there and tox tries to write all environment variables to a log file.

Edit:
I printed the environment variables. It includes these:

GITHUB_REF=refs/heads/🪟
GITHUB_REF_NAME=🪟

@jamwil
Copy link
Contributor

jamwil commented Dec 29, 2022

Beautiful—that caught it. I'll work on it.

@gaborbernat
Copy link
Member

The fix is probably as simple as setting here https://github.com/tox-dev/tox/blob/main/src/tox/tox_env/api.py#L447 utf-8 as encoding for the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants