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

PyUnicode_AsEncodedString: the bootstrap hack is no more needed #55396

Closed
vstinner opened this issue Feb 11, 2011 · 2 comments
Closed

PyUnicode_AsEncodedString: the bootstrap hack is no more needed #55396

vstinner opened this issue Feb 11, 2011 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode

Comments

@vstinner
Copy link
Member

BPO 11187
Nosy @vstinner
Files
  • unicode_asencodedstring_bootstrap.patch
  • 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 2011-02-21.20:53:17.442>
    created_at = <Date 2011-02-11.13:04:08.995>
    labels = ['interpreter-core', 'expert-unicode']
    title = 'PyUnicode_AsEncodedString: the bootstrap hack is no more needed'
    updated_at = <Date 2011-02-21.20:53:17.441>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2011-02-21.20:53:17.441>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-02-21.20:53:17.442>
    closer = 'vstinner'
    components = ['Interpreter Core', 'Unicode']
    creation = <Date 2011-02-11.13:04:08.995>
    creator = 'vstinner'
    dependencies = []
    files = ['20744']
    hgrepos = []
    issue_num = 11187
    keywords = ['patch']
    message_count = 2.0
    messages = ['128384', '128993']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue11187'
    versions = ['Python 3.3']

    @vstinner
    Copy link
    Member Author

    Since version 3.2, Python uses the locale encoding in PyUnicode_EncodeFSDefault() using _Py_wchar2char() and _Py_char2wchar() until the codec registry is initialized and the locale codec is loaded (until initfsencoding() is done).

    Before Python 3.2, Python used ASCII in PyUnicode_AsEncodedString() at bootstrap (before the codec registry was initialized): we don't need this hack anymore and it is bad to use ASCII instead of the locale encoding (encode/decode can fail).

    This ticket is just a reminder for me: I am waiting Python 3.3 to remove PyUnicode_AsEncodedString() bootstrap hack ;-)

    @vstinner vstinner added interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode labels Feb 11, 2011
    @vstinner
    Copy link
    Member Author

    Fixed by r88476. I prefer to only change it in Python 3.3, so no backport.

    @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
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant