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

UnicodeDecodeError bug #309

Closed
xiaohuazi123 opened this issue Apr 18, 2020 · 5 comments · Fixed by #380
Closed

UnicodeDecodeError bug #309

xiaohuazi123 opened this issue Apr 18, 2020 · 5 comments · Fixed by #380

Comments

@xiaohuazi123
Copy link

Describe the bug
I was using the pre-commit tool when I encountered an error associated with nox
The related references:pre-commit/pre-commit#1400

How to reproduce
The problem environment
Windows 7
Python version: Python 3.7.6

Here's the detail log

black....................................................................Passed
Lint Salt................................................................Failed
- hook id: nox-py2
- exit code: 1

Running session lint-salt-pre-commit
Processing pkg\windows\req.txt
Processing requirements\static\windows.in
pip install --progress-bar=off -r requirements\base.txt --constraint requirements\static\py3.7\windows.txt --constraint requirements\static\py3.7\windows-crypto.txt
pip install --progress-bar=off -r requirements\zeromq.txt --constraint requirements\static\py3.7\windows.txt --constraint requirements\static\py3.7\windows-crypto.txt
pip install --progress-bar=off -r requirements\pytest.txt --constraint requirements\static\py3.7\windows.txt --constraint requirements\static\py3.7\windows-crypto.txt
pip install --progress-bar=off -r pkg\windows\req.txt --constraint requirements\static\py3.7\windows.txt --constraint requirements\static\py3.7\windows-crypto.txt
Session lint-salt-pre-commit raised exception UnicodeDecodeError('utf-8', b'Ignoring backports-abc: markers \'python_version < "3.0"\' don\'t match your environment\r\nIgnoring enum34: markers \'python_version < "3.4"\' don\'t match your environment\r\nIgnoring futures: markers \'python_version < "3.0"\' don\'t match your environment\r\nIgnoring singledispatch: markers \'python_version < "3.4"\' don\'t match your environment\r\nLooking in indexes: http://pypi.douban.com/simple\r\nRequirement already satisfied: backports.ssl-match-hostname==3.7.0.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 13)) (3.7.0.1)\r\nRequirement already satisfied: certifi==2019.3.9 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 18)) (2019.3.9)\r\nRequirement already satisfied: cffi==1.12.2 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 19)) (1.12.2)\r\nRequirement already satisfied: cherrypy==17.4.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 23)) (17.4.1)\r\nRequirement already satisfied: contextlib2==0.5.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 25)) (0.5.5)\r\nRequirement already satisfied: cryptography==2.6.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 26)) (2.6.1)\r\nRequirement already satisfied: gitdb2==2.0.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 35)) (2.0.5)\r\nRequirement already satisfied: gitpython==2.1.10 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 36)) (2.1.10)\r\nRequirement already satisfied: idna==2.8 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 38)) (2.8)\r\nRequirement already satisfied: ioloop==0.1a0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 40)) (0.1a0)\r\nRequirement already satisfied: ipaddress==1.0.22 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 41)) (1.0.22)\r\nRequirement already satisfied: jinja2==2.10.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 43)) (2.10.1)\r\nRequirement already satisfied: libnacl==1.7.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 50)) (1.7.1)\r\nRequirement already satisfied: lxml==4.3.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 51)) (4.3.0)\r\nRequirement already satisfied: mako==1.0.7 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 52)) (1.0.7)\r\nRequirement already satisfied: markupsafe==1.1.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 53)) (1.1.1)\r\nRequirement already satisfied: more-itertools==5.0.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 55)) (5.0.0)\r\nRequirement already satisfied: msgpack-python==0.5.6 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 57)) (0.5.6)\r\nRequirement already satisfied: portend==2.4 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 63)) (2.4)\r\nRequirement already satisfied: psutil==5.6.6 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 64)) (5.6.6)\r\nRequirement already satisfied: pyasn1==0.4.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 68)) (0.4.5)\r\nRequirement already satisfied: pycparser==2.19 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 69)) (2.19)\r\nRequirement already satisfied: pycryptodomex==3.8.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 71)) (3.8.1)\r\nRequirement already satisfied: pycurl==7.43.0.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 72)) (7.43.0.5)\r\nRequirement already satisfied: pymssql==2.1.4 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 74)) (2.1.4)\r\nRequirement already satisfied: pymysql==0.9.3 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 75)) (0.9.3)\r\nRequirement already satisfied: pyopenssl==19.0.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 76)) (19.0.0)\r\nRequirement already satisfied: python-dateutil==2.8.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 83)) (2.8.0)\r\nRequirement already satisfied: python-gnupg==0.4.4 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 85)) (0.4.4)\r\nCollecting pythonnet==2.3.0\r\n  Downloading http://pypi.doubanio.com/packages/89/3b/a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-2.3.0.tar.gz (1.5 MB)\r\nRequirement already satisfied: pywin32==224 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 90)) (224)\r\nRequirement already satisfied: pyyaml==5.1.2 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 91)) (5.1.2)\r\nRequirement already satisfied: pyzmq==18.0.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 92)) (18.0.1)\r\nRequirement already satisfied: requests==2.21.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 93)) (2.21.0)\r\nCollecting setproctitle==1.1.10\r\n  Downloading http://pypi.doubanio.com/packages/5a/0d/dc0d2234aacba6cf1a729964383e3452c52096dc695581248b548786f2b3/setproctitle-1.1.10.tar.gz (24 kB)\r\nRequirement already satisfied: six==1.12.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 101)) (1.12.0)\r\nRequirement already satisfied: smmap2==2.0.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 102)) (2.0.5)\r\nRequirement already satisfied: tempora==1.14.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 104)) (1.14.1)\r\nCollecting timelib==0.2.4\r\n  Downloading http://pypi.doubanio.com/packages/ce/ce/d6910b46ec4c5e48f9260eadb3b3ca9ed2a2afa4fed83e230c1c2f639146/timelib-0.2.4.zip (281 kB)\r\nRequirement already satisfied: urllib3==1.24.2 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 106)) (1.24.2)\r\nProcessing c:\\users\\administrator\\appdata\\local\\pip\\cache\\wheels\\c5\\fb\\7a\\6fddab48b1693b26a7450a5fa09b4b24963cc39a10c56d1fd1\\watchdog-0.9.0-py3-none-any.whl\r\nCollecting wheel==0.33.4\r\n  Downloading http://pypi.doubanio.com/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl (21 kB)\r\nProcessing c:\\users\\administrator\\appdata\\local\\pip\\cache\\wheels\\31\\df\\63\\35d6d527613e3eed1880ceb32327c7503c60a3cbf7492223ff\\wmi-1.4.9-py3-none-any.whl\r\nRequirement already satisfied: zc.lockfile==1.4 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 116)) (1.4)\r\nRequirement already satisfied: cheroot==6.5.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 22)) (6.5.5)\r\nRequirement already satisfied: asn1crypto==0.24.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 8)) (0.24.0)\r\nRequirement already satisfied: chardet==3.0.4 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 20)) (3.0.4)\r\nRequirement already satisfied: pytz==2019.1 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 88)) (2019.1)\r\nRequirement already satisfied: jaraco.functools==2.0 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 42)) (2.0)\r\nRequirement already satisfied: pathtools==0.1.2 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 61)) (0.1.2)\r\nRequirement already satisfied: argh==0.26.2 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 7)) (0.26.2)\r\nRequirement already satisfied: setuptools in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from zc.lockfile==1.4->-c requirements\\static\\py3.7\\windows.txt (line 116)) (46.1.3)\r\nRequirement already satisfied: backports.functools-lru-cache==1.5 in c:\\users\\administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages (from -c requirements\\static\\py3.7\\windows.txt (line 12)) (1.5)\r\nBuilding wheels for collected packages: pythonnet, setproctitle, timelib\r\n  Building wheel for pythonnet (setup.py): started\r\n  Building wheel for pythonnet (setup.py): finished with status \'error\'\r\n  ERROR: Command errored out with exit status 1:\r\n   command: \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\Scripts\\python.exe\' -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\pythonnet\\\\setup.py\'"\'"\'; __file__=\'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\pythonnet\\\\setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d \'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-wheel-u00ziwk3\'\r\n       cwd: C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\\r\n  Complete output (87 lines):\r\n  running bdist_wheel\r\n  running build\r\n  running build_ext\r\n  \xd5\xfd\xd4\xda\xbc\xec\xb2\xe9\xc0\xb4\xd7\xd4 https://www.nuget.org/api/v2/ \xb5\xc4\xb8\xfc\xd0\xc2\xa1\xa3\r\n  \xb5\xb1\xc7\xb0\xd5\xfd\xd4\xda\xd4\xcb\xd0\xd0 NuGet.exe 3.5.0\xa1\xa3\r\n  \xd5\xfd\xd4\xda\xbd\xab NuGet.exe \xb8\xfc\xd0\xc2\xb5\xbd 5.5.1\xa1\xa3\r\n  \xb8\xfc\xd0\xc2\xb3\xc9\xb9\xa6\xa1\xa3\r\n  MSBuild auto-detection: using msbuild version \'14.0\' from \'C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\amd64\'.\r\n  C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\sthafd11.aqn.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\runtime\\Python.Runtime.csproj]\r\n  C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\sthafd11.aqn.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\testing\\Python.Test.csproj]\r\n  C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\sthafd11.aqn.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\embed_tests\\Python.EmbeddingTest.csproj]\r\n  C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\sthafd11.aqn.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\console\\Console.csproj]\r\n  C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\sthafd11.aqn.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\clrmodule\\clrmodule.csproj]\r\n  \r\n  \xbe\xaf\xb8\xe6: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.\r\n  Restoring NuGet package NUnit.3.6.0.\r\n  Restoring NuGet package NUnit.ConsoleRunner.3.6.0.\r\n  Restoring NuGet package UnmanagedExports.1.2.7.\r\n  Adding package \'NUnit.ConsoleRunner.3.6.0\' to folder \'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\packages\'\r\n  Adding package \'NUnit.3.6.0\' to folder \'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\packages\'\r\n  Adding package \'UnmanagedExports.1.2.7\' to folder \'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\packages\'\r\n  Added package \'UnmanagedExports.1.2.7\' to folder \'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\packages\'\r\n  Added package \'NUnit.ConsoleRunner.3.6.0\' to folder \'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\packages\'\r\n  Added package \'NUnit.3.6.0\' to folder \'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\packages\'\r\n  \r\n  NuGet Config files used:\r\n      C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config\r\n  \r\n  Feeds used:\r\n      C:\\Users\\Administrator\\.nuget\\packages\\\r\n      https://api.nuget.org/v3/index.json\r\n  \r\n  Installed:\r\n      3 package(s) to packages.config projects\r\n  Traceback (most recent call last):\r\n    File "tools\\geninterop\\geninterop.py", line 292, in <module>\r\n      sys.exit(main())\r\n    File "tools\\geninterop\\geninterop.py", line 272, in main\r\n      python_h = preprocess_python_headers()\r\n    File "tools\\geninterop\\geninterop.py", line 192, in preprocess_python_headers\r\n      for line in _check_output(cmd).splitlines():\r\n    File "tools\\geninterop\\geninterop.py", line 41, in _check_output\r\n      output = subprocess.check_output(*args, **kwargs)\r\n    File "c:\\program files\\python37\\lib\\subprocess.py", line 411, in check_output\r\n      **kwargs).stdout\r\n    File "c:\\program files\\python37\\lib\\subprocess.py", line 488, in run\r\n      with Popen(*popenargs, **kwargs) as process:\r\n    File "c:\\program files\\python37\\lib\\subprocess.py", line 800, in __init__\r\n      restore_signals, start_new_session)\r\n    File "c:\\program files\\python37\\lib\\subprocess.py", line 1207, in _execute_child\r\n      startupinfo)\r\n  FileNotFoundError: [WinError 2] \xcf\xb5\xcd\xb3\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xce\xc4\xbc\xfe\xa1\xa3\r\n  Traceback (most recent call last):\r\n    File "<string>", line 1, in <module>\r\n    File "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\setup.py", line 405, in <module>\r\n      zip_safe=False,\r\n    File "C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages\\setuptools\\__init__.py", line 144, in setup\r\n      return distutils.core.setup(**attrs)\r\n    File "c:\\program files\\python37\\lib\\distutils\\core.py", line 148, in setup\r\n      dist.run_commands()\r\n    File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 966, in run_commands\r\n      self.run_command(cmd)\r\n    File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 985, in run_command\r\n      cmd_obj.run()\r\n    File "C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages\\wheel\\bdist_wheel.py", line 223, in run\r\n      self.run_command(\'build\')\r\n    File "c:\\program files\\python37\\lib\\distutils\\cmd.py", line 313, in run_command\r\n      self.distribution.run_command(command)\r\n    File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 985, in run_command\r\n      cmd_obj.run()\r\n    File "c:\\program files\\python37\\lib\\distutils\\command\\build.py", line 135, in run\r\n      self.run_command(cmd_name)\r\n    File "c:\\program files\\python37\\lib\\distutils\\cmd.py", line 313, in run_command\r\n      self.distribution.run_command(command)\r\n    File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 985, in run_command\r\n      cmd_obj.run()\r\n    File "c:\\program files\\python37\\lib\\distutils\\command\\build_ext.py", line 340, in run\r\n      self.build_extensions()\r\n    File "c:\\program files\\python37\\lib\\distutils\\command\\build_ext.py", line 449, in build_extensions\r\n      self._build_extensions_serial()\r\n    File "c:\\program files\\python37\\lib\\distutils\\command\\build_ext.py", line 474, in _build_extensions_serial\r\n      self.build_extension(ext)\r\n    File "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\setup.py", line 191, in build_extension\r\n      subprocess.check_call([sys.executable, geninterop, interop_file])\r\n    File "c:\\program files\\python37\\lib\\subprocess.py", line 363, in check_call\r\n      raise CalledProcessError(retcode, cmd)\r\n  subprocess.CalledProcessError: Command \'[\'C:\\\\Users\\\\Administrator\\\\.cache\\\\pre-commit\\\\repo_4nvyxed\\\\py_env-python3\\\\Scripts\\\\python.exe\', \'tools\\\\geninterop\\\\geninterop.py\', \'src\\\\runtime\\\\interop37.cs\']\' returned non-zero exit status 1.\r\n  ----------------------------------------\r\n  ERROR: Failed building wheel for pythonnet\r\n  Running setup.py clean for pythonnet\r\n  Building wheel for setproctitle (setup.py): started\r\n  Building wheel for setproctitle (setup.py): finished with status \'error\'\r\n  ERROR: Command errored out with exit status 1:\r\n   command: \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\Scripts\\python.exe\' -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\setproctitle\\\\setup.py\'"\'"\'; __file__=\'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\setproctitle\\\\setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d \'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-wheel-0qtw_mb3\'\r\n       cwd: C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\setproctitle\\\r\n  Complete output (5 lines):\r\n  running bdist_wheel\r\n  running build\r\n  running build_ext\r\n  building \'setproctitle\' extension\r\n  error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/\r\n  ----------------------------------------\r\n  ERROR: Failed building wheel for setproctitle\r\n  Running setup.py clean for setproctitle\r\n  Building wheel for timelib (setup.py): started\r\n  Building wheel for timelib (setup.py): finished with status \'error\'\r\n  ERROR: Command errored out with exit status 1:\r\n   command: \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\Scripts\\python.exe\' -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\timelib\\\\setup.py\'"\'"\'; __file__=\'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\timelib\\\\setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d \'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-wheel-rkoglq5i\'\r\n       cwd: C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\timelib\\\r\n  Complete output (5 lines):\r\n  running bdist_wheel\r\n  running build\r\n  running build_ext\r\n  building \'timelib\' extension\r\n  error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/\r\n  ----------------------------------------\r\n  ERROR: Failed building wheel for timelib\r\n  Running setup.py clean for timelib\r\nFailed to build pythonnet setproctitle timelib\r\nInstalling collected packages: pythonnet, setproctitle, timelib, watchdog, wheel, wmi\r\n    Running setup.py install for pythonnet: started\r\n    Running setup.py install for pythonnet: finished with status \'error\'\r\n    ERROR: Command errored out with exit status 1:\r\n     command: \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\Scripts\\python.exe\' -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\pythonnet\\\\setup.py\'"\'"\'; __file__=\'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\pythonnet\\\\setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' install --record \'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-record-wtcrj1m2\\install-record.txt\' --single-version-externally-managed --compile --install-headers \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\include\\site\\python3.7\\pythonnet\'\r\n         cwd: C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\\r\n    Complete output (73 lines):\r\n    running install\r\n    running build\r\n    running build_ext\r\n    \xd5\xfd\xd4\xda\xbc\xec\xb2\xe9\xc0\xb4\xd7\xd4 https://api.nuget.org/v3/index.json \xb5\xc4\xb8\xfc\xd0\xc2\xa1\xa3\r\n      GET https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/index.json\r\n      OK https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/index.json 323ms\r\n    \xb5\xb1\xc7\xb0\xd5\xfd\xd4\xda\xd4\xcb\xd0\xd0 NuGet.exe 5.5.1\xa1\xa3\r\n    NuGet.exe \xca\xc7\xd7\xee\xd0\xc2\xb5\xc4\xa1\xa3\r\n    \xb8\xfc\xd0\xc2\xb3\xc9\xb9\xa6\xa1\xa3\r\n    MSBuild auto-detection: using msbuild version \'14.0\' from \'C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\amd64\'.\r\n    C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\ux35xlnt.i5a.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\runtime\\Python.Runtime.csproj]\r\n    C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\ux35xlnt.i5a.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\testing\\Python.Test.csproj]\r\n    C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\ux35xlnt.i5a.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\embed_tests\\Python.EmbeddingTest.csproj]\r\n    C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\ux35xlnt.i5a.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\console\\Console.csproj]\r\n    C:\\Users\\Administrator\\AppData\\Local\\Temp\\NuGetScratch\\ux35xlnt.i5a.nugetrestore.targets(435,34): error MSB4092: \xd4\xda\xcc\xf5\xbc\xfe\xa1\xb0@(PackageReference->Count()) > 0\xa1\xb1\xd6\xd0\xb5\xc4\xd7\xd6\xb7\xfb\xce\xbb\xd6\xc3 28 \xb4\xa6\xb7\xa2\xcf\xd6\xd2\xe2\xcd\xe2\xb1\xea\xbc\xc7\xa1\xb0)\xa1\xb1\xa1\xa3 [C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\src\\clrmodule\\clrmodule.csproj]\r\n    \r\n    \xbe\xaf\xb8\xe6: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.\r\n    packages.config \xd6\xd0\xc1\xd0\xb3\xf6\xb5\xc4\xcb\xf9\xd3\xd0\xb3\xcc\xd0\xf2\xb0\xfc\xbe\xf9\xd2\xd1\xb0\xb2\xd7\xb0\xa1\xa3\r\n    Traceback (most recent call last):\r\n      File "tools\\geninterop\\geninterop.py", line 292, in <module>\r\n        sys.exit(main())\r\n      File "tools\\geninterop\\geninterop.py", line 272, in main\r\n        python_h = preprocess_python_headers()\r\n      File "tools\\geninterop\\geninterop.py", line 192, in preprocess_python_headers\r\n        for line in _check_output(cmd).splitlines():\r\n      File "tools\\geninterop\\geninterop.py", line 41, in _check_output\r\n        output = subprocess.check_output(*args, **kwargs)\r\n      File "c:\\program files\\python37\\lib\\subprocess.py", line 411, in check_output\r\n        **kwargs).stdout\r\n      File "c:\\program files\\python37\\lib\\subprocess.py", line 488, in run\r\n        with Popen(*popenargs, **kwargs) as process:\r\n      File "c:\\program files\\python37\\lib\\subprocess.py", line 800, in __init__\r\n        restore_signals, start_new_session)\r\n      File "c:\\program files\\python37\\lib\\subprocess.py", line 1207, in _execute_child\r\n        startupinfo)\r\n    FileNotFoundError: [WinError 2] \xcf\xb5\xcd\xb3\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xce\xc4\xbc\xfe\xa1\xa3\r\n    Traceback (most recent call last):\r\n      File "<string>", line 1, in <module>\r\n      File "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\setup.py", line 405, in <module>\r\n        zip_safe=False,\r\n      File "C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages\\setuptools\\__init__.py", line 144, in setup\r\n        return distutils.core.setup(**attrs)\r\n      File "c:\\program files\\python37\\lib\\distutils\\core.py", line 148, in setup\r\n        dist.run_commands()\r\n      File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 966, in run_commands\r\n        self.run_command(cmd)\r\n      File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 985, in run_command\r\n        cmd_obj.run()\r\n      File "C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\lib\\site-packages\\setuptools\\command\\install.py", line 61, in run\r\n        return orig.install.run(self)\r\n      File "c:\\program files\\python37\\lib\\distutils\\command\\install.py", line 545, in run\r\n        self.run_command(\'build\')\r\n      File "c:\\program files\\python37\\lib\\distutils\\cmd.py", line 313, in run_command\r\n        self.distribution.run_command(command)\r\n      File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 985, in run_command\r\n        cmd_obj.run()\r\n      File "c:\\program files\\python37\\lib\\distutils\\command\\build.py", line 135, in run\r\n        self.run_command(cmd_name)\r\n      File "c:\\program files\\python37\\lib\\distutils\\cmd.py", line 313, in run_command\r\n        self.distribution.run_command(command)\r\n      File "c:\\program files\\python37\\lib\\distutils\\dist.py", line 985, in run_command\r\n        cmd_obj.run()\r\n      File "c:\\program files\\python37\\lib\\distutils\\command\\build_ext.py", line 340, in run\r\n        self.build_extensions()\r\n      File "c:\\program files\\python37\\lib\\distutils\\command\\build_ext.py", line 449, in build_extensions\r\n        self._build_extensions_serial()\r\n      File "c:\\program files\\python37\\lib\\distutils\\command\\build_ext.py", line 474, in _build_extensions_serial\r\n        self.build_extension(ext)\r\n      File "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-wamg3wsj\\pythonnet\\setup.py", line 191, in build_extension\r\n        subprocess.check_call([sys.executable, geninterop, interop_file])\r\n      File "c:\\program files\\python37\\lib\\subprocess.py", line 363, in check_call\r\n        raise CalledProcessError(retcode, cmd)\r\n    subprocess.CalledProcessError: Command \'[\'C:\\\\Users\\\\Administrator\\\\.cache\\\\pre-commit\\\\repo_4nvyxed\\\\py_env-python3\\\\Scripts\\\\python.exe\', \'tools\\\\geninterop\\\\geninterop.py\', \'src\\\\runtime\\\\interop37.cs\']\' returned non-zero exit status 1.\r\n    ----------------------------------------\r\nERROR: Command errored out with exit status 1: \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\Scripts\\python.exe\' -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\pythonnet\\\\setup.py\'"\'"\'; __file__=\'"\'"\'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\\\\pip-install-wamg3wsj\\\\pythonnet\\\\setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' install --record \'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-record-wtcrj1m2\\install-record.txt\' --single-version-externally-managed --compile --install-headers \'C:\\Users\\Administrator\\.cache\\pre-commit\\repo_4nvyxed\\py_env-python3\\include\\site\\python3.7\\pythonnet\' Check the logs for full command output.\r\n', 12092, 12093, 'invalid continuation byte')
Traceback (most recent call last):
  File "c:\users\administrator\.cache\pre-commit\repo_4nvyxed\py_env-python3\lib\site-packages\nox\sessions.py", line 333, in execute
    self.func(session)
  File "E:\salt\noxfile.py", line 1057, in lint_salt_pre_commit
    _lint_pre_commit(session, ".pylintrc", flags, paths)
  File "E:\salt\noxfile.py", line 1009, in _lint_pre_commit
    _lint(session, rcfile, flags, paths, tee_output=False)
  File "E:\salt\noxfile.py", line 934, in _lint
    _install_requirements(session, "zeromq")
  File "E:\salt\noxfile.py", line 340, in _install_requirements
    session.install(*install_command, silent=PIP_INSTALL_SILENT)
  File "c:\users\administrator\.cache\pre-commit\repo_4nvyxed\py_env-python3\lib\site-packages\nox\sessions.py", line 253, in install
    self._run("pip", "install", *args, external="error", **kwargs)
  File "c:\users\administrator\.cache\pre-commit\repo_4nvyxed\py_env-python3\lib\site-packages\nox\sessions.py", line 216, in _run
    return nox.command.run(args, env=env, path=self.bin, **kwargs)
  File "c:\users\administrator\.cache\pre-commit\repo_4nvyxed\py_env-python3\lib\site-packages\nox\command.py", line 114, in run
    [cmd_path] + list(args), silent=silent, env=env, **popen_kws
  File "c:\users\administrator\.cache\pre-commit\repo_4nvyxed\py_env-python3\lib\site-packages\nox\popen.py", line 41, in popen
    return return_code, out.decode("utf-8") if out else ""
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 12092: invalid continuation byte
Session lint-salt-pre-commit failed.

Lint Tests...........................................(no files to check)Skipped

Expected behavior
This problem is bound to come up, and every time I commit code, this seems to be a nox bug

@lulivi
Copy link

lulivi commented Jun 28, 2020

@xiaohuazi123 as a temporary fix, you can change "utf-8" for "latin-1" in line https://github.com/theacodes/nox/blob/master/nox/popen.py#L48

@stsewd
Copy link
Collaborator

stsewd commented Dec 29, 2020

@xiaohuazi123 does this print latin-1 (or something different to utf-8) in your system?

import sys
print(sys.getdefaultencoding())

If so, we could use that instead of harcoding to utf-8.

https://docs.python.org/3/library/sys.html#sys.getdefaultencoding

@Cielquan
Copy link
Contributor

Cielquan commented Feb 1, 2021

I have got the same problem at another place. My Github Actions workflow fails because of this issue. The strange thing is that at one repo it works and at another it fails. The nox config differs a bit, but the part where it fails is the same command.

The job runs on all three os (ubuntu, macos, windows) and only windows fails.

Working repo CI example
Broken repo CI example

I also checked some sorts of locale settings in the very job-VMs that is failing and both - the working and broken one - have the same settings - on all there OS:

python function windows linux macos
sys.stdout.encoding cp1252 None None
sys.getdefaultencoding utf-8 ascii ascii
sys.getfilesystemencoding utf-8 utf-8 utf-8
locale.getpreferredencoding cp1252 utf-8 utf-8

The error causing \x95 byte is this dot: which is used by poetry as a bullet character for each python package it installs.

EDIT1:
I monkeypatched nox.command.popen to use sys.getdefaultencoding() instead of hard coded utf-8 and it did not work for my problem. See here.
Afterwards I remembered my table above and it was clear that it would not change a thing. But for linux and macos it still worked even though the encoding changed from hard coded utf-8 to ascii acording to my table above.

EDIT2:
Next I monkeypatched it to use sys.stdout.encoding and it worked. See here. It shows a placeholder for the dot but that also does happen on the above mentioned working CI.

@Cielquan
Copy link
Contributor

Cielquan commented Feb 2, 2021

According to my findings above and in consideration of the above table I would presume that there are 2 solutions to this problem:

  1. use sys.stdout.encoding instead of hard coded "utf-8"
  2. use locale.getpreferredencoding instead of hard coded "utf-8"

I think the first one would be the better option? My reasoning is that you ask for the encoding of stdout where your goal is to print to.

EDIT1: Also the docs on locale.getpreferredencoding are not that reassuring that it will always work.

EDIT2: I tested the above table on a local windows machine and got utf8 for sys.stdout.encoding and the rest was the same. And it worked with and without the monkeypatched version.
Later when I'm back home I will issue a PR to fix this.

EDIT3: On the in EDIT2 mentioned windows machine I run the git bash shell as integrated terminal in VSCode. Sometimes the monkeypatched version fails and and the next run it works. Makes no sense to me at current. I will try some stuff.

@Cielquan
Copy link
Contributor

Cielquan commented Feb 2, 2021

@stsewd I opened a PR if you want to take a look.

theacodes pushed a commit that referenced this issue Feb 11, 2021
…380)

* add decode_output func to decode popen output

fixes #309 by trying to decode popen output with utf8 first
and on error tries other encodings provided by the systems
preferences.

* simplified decode_output function

* fix linting issues

* fix double hard coded utf8

* change utf8 to utf-8

* add tests for decode_output

* fix linting issues

* simplify nested try...except block and fix nested exception msg

Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>

* fix tests for simplified deode_output

Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants