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

locale.getpreferredencoding doesn't return result #74594

Closed
seanmccully mannequin opened this issue May 20, 2017 · 9 comments
Closed

locale.getpreferredencoding doesn't return result #74594

seanmccully mannequin opened this issue May 20, 2017 · 9 comments

Comments

@seanmccully
Copy link
Mannequin

seanmccully mannequin commented May 20, 2017

BPO 30409
Nosy @vstinner, @ezio-melotti, @dstufft, @seanmccully
PRs
  • [2.7] bpo-30409: locale.getpreferredencoding doesn't return result #1672
  • Files
  • patchset.diff
  • suggested_change.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-05-21.02:13:39.892>
    created_at = <Date 2017-05-20.03:41:44.335>
    labels = ['expert-unicode']
    title = "locale.getpreferredencoding doesn't return result"
    updated_at = <Date 2017-05-21.10:12:19.686>
    user = 'https://github.com/seanmccully'

    bugs.python.org fields:

    activity = <Date 2017-05-21.10:12:19.686>
    actor = 'cheryl.sabella'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-05-21.02:13:39.892>
    closer = 'vstinner'
    components = ['Unicode']
    creation = <Date 2017-05-20.03:41:44.335>
    creator = 'seanmccully'
    dependencies = []
    files = ['46877', '46878']
    hgrepos = []
    issue_num = 30409
    keywords = ['patch']
    message_count = 9.0
    messages = ['293995', '293999', '294000', '294001', '294002', '294008', '294009', '294065', '294068']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'ezio.melotti', 'dstufft', 'seanmccully']
    pr_nums = ['1672']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue30409'
    versions = ['Python 2.7']

    @seanmccully
    Copy link
    Mannequin Author

    seanmccully mannequin commented May 20, 2017

    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

    @seanmccully seanmccully mannequin added the topic-unicode label May 20, 2017
    @vstinner
    Copy link
    Member

    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

    @vstinner
    Copy link
    Member

    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.

    @vstinner vstinner reopened this May 20, 2017
    @vstinner
    Copy link
    Member

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

    @vstinner
    Copy link
    Member

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

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

    @seanmccully
    Copy link
    Mannequin Author

    seanmccully mannequin commented May 20, 2017

    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 94a3694.

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

    ----------


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue30409\>


    @vstinner
    Copy link
    Member

    ok, is this a valid fix then?

    Yes, totally. Sorry, ignore my first comment.

    @vstinner
    Copy link
    Member

    New changeset cef8b17 by Victor Stinner (Sean McCully) in branch '2.7':
    bpo-30409: locale.getpreferredencoding doesn't return result (bpo-1672)
    cef8b17

    @vstinner
    Copy link
    Member

    Sean McCully: Thank you very much for both your bug report and for your pull request! You got your name into Python ;-)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant