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.

classification
Title: locale.getpreferredencoding doesn't return result
Type: Stage: resolved
Components: Unicode Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, ezio.melotti, seanmccully, vstinner
Priority: normal Keywords: patch

Created on 2017-05-20 03:41 by seanmccully, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patchset.diff seanmccully, 2017-05-20 03:41
suggested_change.diff Decorater, 2017-05-20 06:20
Pull Requests
URL Status Linked Edit
PR 1672 merged seanmccully, 2017-05-20 03:41
Messages (9)
msg293995 - (view) Author: Sean McCully (seanmccully) * Date: 2017-05-20 03:41
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 312, in run
    wheel_cache
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 295, in populate_requirement_set
    wheel_cache=wheel_cache):
  File "/usr/lib/python2.7/site-packages/pip/req/req_file.py", line 84, in parse_requirements
    filename, comes_from=comes_from, session=session
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 422, in get_file_content
    content = auto_decode(f.read())
  File "/usr/lib/python2.7/site-packages/pip/utils/encoding.py", line 31, in auto_decode
    return data.decode(locale.getpreferredencoding(False))
TypeError: decode() argument 1 must be string, not None
msg293999 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-20 05:29
File "/usr/lib/python2.7/site-packages/pip/utils/encoding.py", line 31, in auto_decode
    return data.decode(locale.getpreferredencoding(False))
TypeError: decode() argument 1 must be string, not None

I'm sorry, but this issue looks like a bug in pip, not in Python. Please report the issue at https://github.com/pypa/pip/issues
msg294000 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-20 05:31
Oh, I'm sorry, I read too fast. I didn't notice the pull request. It seems like a real bug in Python 2.7.
msg294001 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-20 05:32
In fact, it seems like I introduced a regression in bpo-6393, commit 94a3694c3dda97e3bcb51264bf47d948c5424d84.
msg294002 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-20 05:34
> In fact, it seems like I introduced a regression in bpo-6393, commit 94a3694c3dda97e3bcb51264bf47d948c5424d84.

I backported this commit, but I didn't notice the bug in the code... In fact, this commit was followed by the commit 6a448d4c2eac16af4c451b43c6dc46cf287b1671.
msg294008 - (view) Author: Sean McCully (seanmccully) * Date: 2017-05-20 06:04
ok,  is this a valid fix then?

    On Saturday, May 20, 2017 1:34 AM, STINNER Victor <report@bugs.python.org> wrote:

STINNER Victor added the comment:

> In fact, it seems like I introduced a regression in bpo-6393, commit 94a3694c3dda97e3bcb51264bf47d948c5424d84.

I backported this commit, but I didn't notice the bug in the code... In fact, this commit was followed by the commit 6a448d4c2eac16af4c451b43c6dc46cf287b1671.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue30409>
_______________________________________
msg294009 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-20 06:07
> ok,  is this a valid fix then?

Yes, totally. Sorry, ignore my first comment.
msg294065 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-21 01:44
New changeset cef8b1741c03a09ea7371947dc65f632c61ef8ad by Victor Stinner (Sean McCully) in branch '2.7':
bpo-30409: locale.getpreferredencoding doesn't return result (#1672)
https://github.com/python/cpython/commit/cef8b1741c03a09ea7371947dc65f632c61ef8ad
msg294068 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-21 02:13
Sean McCully: Thank you very much for both your bug report and for your pull request! You got your name into Python ;-)
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74594
2017-05-21 10:12:19cheryl.sabellasetpull_requests: - pull_request1780
2017-05-21 02:13:39vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg294068
2017-05-21 01:44:04vstinnersetmessages: + msg294065
2017-05-20 23:05:26cheryl.sabellasetpull_requests: + pull_request1780
2017-05-20 06:20:04Decoratersetfiles: + suggested_change.diff
2017-05-20 06:07:00vstinnersetmessages: + msg294009
2017-05-20 06:04:26seanmccullysetmessages: + msg294008
2017-05-20 05:34:28vstinnersetmessages: + msg294002
2017-05-20 05:32:26vstinnersetmessages: + msg294001
2017-05-20 05:31:11vstinnersetstatus: closed -> open
resolution: third party -> (no value)
messages: + msg294000
2017-05-20 05:29:22vstinnersetstatus: open -> closed

nosy: + dstufft
messages: + msg293999

resolution: third party
stage: resolved
2017-05-20 03:41:44seanmccullycreate