This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2019-06-10.11:28:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560166091.5.0.474149864781.issue37214@roundup.psfhosted.org>
In-reply-to
Content
Another test: try to build a venv to get pip:


Building a venv is ok. Good, our stdlib is not so bad :-)

$ PYTHONWARNINGS=error::EncodingWarning ./python -W error::EncodingWarning -m venv --without-pip env


But ensurepip fails soon:

$ PYTHONWARNINGS=error::EncodingWarning ./env/bin/python -W error::EncodingWarning -m ensurepip --verbose
/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/pyparsing.py:3068: SyntaxWarning: invalid escape sequence \w
/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/pyparsing.py:3068: SyntaxWarning: invalid escape sequence \w
/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/html5lib/_trie/_base.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
Exception:
Traceback (most recent call last):
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 179, in main
    status = self.run(options, args)
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 255, in run
    with self._build_session(options) as session:
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 87, in _build_session
    session = PipSession(
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/download.py", line 344, in __init__
    self.headers["User-Agent"] = user_agent()
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/download.py", line 108, in user_agent
    zip(["name", "version", "id"], distro.linux_distribution()),
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 120, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 674, in linux_distribution
    self.name() if full_distribution_name else self.id(),
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 712, in name
    name = self.os_release_attr('name') \
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 883, in os_release_attr
    return self._os_release_info.get(attribute, '')
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 550, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/tmp/tmpyxn9yklq/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 921, in _os_release_info
    with open(self.os_release_file) as release_file:
EncodingWarning: encoding=None


Note: an "up to date" pip still emits many SyntaxWarning and DeprecationWarning warnings :-(


New attempt using "always" action:

$ PYTHONWARNINGS=always::EncodingWarning ./env/bin/python -W always::EncodingWarning -m ensurepip --verbose
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/pyparsing.py:3068: SyntaxWarning: invalid escape sequence \w
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/pyparsing.py:3068: SyntaxWarning: invalid escape sequence \w
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/html5lib/_trie/_base.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py:921: EncodingWarning: encoding=None
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py:995: EncodingWarning: encoding=None
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py:1131: EncodingWarning: encoding=None
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/distro.py:1030: EncodingWarning: encoding=None
/home/vstinner/prog/python/master/Lib/subprocess.py:824: EncodingWarning: encoding=None
  self.stdout = io.TextIOWrapper(self.stdout,
Ignoring indexes: https://pypi.org/simple
Created temporary directory: /tmp/pip-ephem-wheel-cache-2hizyo3q
Created temporary directory: /tmp/pip-req-tracker-kb535zvl
Created requirements tracker '/tmp/pip-req-tracker-kb535zvl'
Created temporary directory: /tmp/pip-install-_z_c4ze9
Looking in links: /tmp/tmpc309fubz
Collecting setuptools
  0 location(s) to search for versions of setuptools:
  Skipping link /tmp/tmpc309fubz (from -f); not a file
  Skipping link file:///tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl; wrong project name (not setuptools)
  Found link file:///tmp/tmpc309fubz/setuptools-40.8.0-py2.py3-none-any.whl, version: 40.8.0
  Local files found: /tmp/tmpc309fubz/setuptools-40.8.0-py2.py3-none-any.whl
  Using version 40.8.0 (newest of versions: 40.8.0)
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  Added setuptools from file:///tmp/tmpc309fubz/setuptools-40.8.0-py2.py3-none-any.whl to build tracker '/tmp/pip-req-tracker-kb535zvl'
  Removed setuptools from file:///tmp/tmpc309fubz/setuptools-40.8.0-py2.py3-none-any.whl from build tracker '/tmp/pip-req-tracker-kb535zvl'
Collecting pip
  0 location(s) to search for versions of pip:
  Found link file:///tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl, version: 19.0.3
  Skipping link file:///tmp/tmpc309fubz/setuptools-40.8.0-py2.py3-none-any.whl; wrong project name (not pip)
  Local files found: /tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl
  Using version 19.0.3 (newest of versions: 19.0.3)
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  Added pip from file:///tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl to build tracker '/tmp/pip-req-tracker-kb535zvl'
  Removed pip from file:///tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl from build tracker '/tmp/pip-req-tracker-kb535zvl'
Installing collected packages: setuptools, pip
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:140: EncodingWarning: encoding=None

/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:157: EncodingWarning: encoding=None
  changing mode of /home/vstinner/prog/python/master/env/bin/easy_install-3.9 to 775
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:140: EncodingWarning: encoding=None

/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:157: EncodingWarning: encoding=None
  changing mode of /home/vstinner/prog/python/master/env/bin/pip3 to 775
  changing mode of /home/vstinner/prog/python/master/env/bin/pip3.9 to 775
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
/tmp/tmpc309fubz/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
Successfully installed pip-19.0.3 setuptools-40.8.0
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-kb535zvl'


Hum, there are *a lot* of EncodingWarning warnings :-/


Trying to use pip fails with the same distro error:

$ PYTHONWARNINGS=error::EncodingWarning ./env/bin/python -W error::EncodingWarning -m pip install requests
...
  File "/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/distro.py", line 921, in _os_release_info
    with open(self.os_release_file) as release_file:
EncodingWarning: encoding=None


Installing requests using pip emits even more EncodingWarning warnings in many functions of pip, but also in distro and msgpack dependencies:

$ PYTHONWARNINGS=always::EncodingWarning ./env/bin/python -W always::EncodingWarning -m pip install requests
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/html5lib/_trie/_base.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
  from collections import Mapping
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/distro.py:921: EncodingWarning: encoding=None
  with open(self.os_release_file) as release_file:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/distro.py:995: EncodingWarning: encoding=None
  with open(os.devnull, 'w') as devnull:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/distro.py:1131: EncodingWarning: encoding=None
  with open(filepath) as fp:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/distro.py:1030: EncodingWarning: encoding=None
  with open(os.devnull, 'w') as devnull:
/home/vstinner/prog/python/master/Lib/subprocess.py:824: EncodingWarning: encoding=None
  self.stdout = io.TextIOWrapper(self.stdout,
Collecting requests
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/msgpack/fallback.py:220: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  warnings.warn(
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  with open(entry_path, 'w') as fp:
Collecting certifi>=2017.4.17 (from requests)
  Using cached https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  with open(entry_path, 'w') as fp:
Collecting chardet<3.1.0,>=3.0.2 (from requests)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  with open(entry_path, 'w') as fp:
Collecting idna<2.9,>=2.5 (from requests)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  with open(entry_path, 'w') as fp:
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
  Using cached https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/req/req_tracker.py:60: EncodingWarning: encoding=None
  with open(entry_path, 'w') as fp:
Installing collected packages: certifi, chardet, idna, urllib3, requests
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:140: EncodingWarning: encoding=None
  with open(os.path.join(wheeldir, item, 'WHEEL')) as wheel:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:140: EncodingWarning: encoding=None
  with open(os.path.join(wheeldir, item, 'WHEEL')) as wheel:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:157: EncodingWarning: encoding=None
  with open(filename) as fp:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:140: EncodingWarning: encoding=None
  with open(os.path.join(wheeldir, item, 'WHEEL')) as wheel:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:140: EncodingWarning: encoding=None
  with open(os.path.join(wheeldir, item, 'WHEEL')) as wheel:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:140: EncodingWarning: encoding=None
  with open(os.path.join(wheeldir, item, 'WHEEL')) as wheel:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/wheel.py:95: EncodingWarning: encoding=None
  return open(name, mode + bin, **nl)
Successfully installed certifi-2019.3.9 chardet-3.0.4 idna-2.8 requests-2.22.0 urllib3-1.25.3
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/utils/outdated.py:40: EncodingWarning: encoding=None
  with open(self.statefile_path) as statefile:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_vendor/msgpack/fallback.py:220: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  warnings.warn(
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/utils/outdated.py:64: EncodingWarning: encoding=None
  with open(self.statefile_path) as statefile:
/home/vstinner/prog/python/master/env/lib/python3.9/site-packages/pip/_internal/utils/outdated.py:74: EncodingWarning: encoding=None
  with open(self.statefile_path, "w") as statefile:
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
History
Date User Action Args
2019-06-10 11:28:11vstinnersetrecipients: + vstinner
2019-06-10 11:28:11vstinnersetmessageid: <1560166091.5.0.474149864781.issue37214@roundup.psfhosted.org>
2019-06-10 11:28:11vstinnerlinkissue37214 messages
2019-06-10 11:28:11vstinnercreate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.