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

os.putenv should support bytes arguments on Windows #72375

Closed
eryksun opened this issue Sep 17, 2016 · 4 comments
Closed

os.putenv should support bytes arguments on Windows #72375

eryksun opened this issue Sep 17, 2016 · 4 comments
Labels
3.7 (EOL) end of life OS-windows type-feature A feature request or enhancement

Comments

@eryksun
Copy link
Contributor

eryksun commented Sep 17, 2016

BPO 28188
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba
Files
  • issue_28188_01.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 2021-03-20.02:17:03.641>
    created_at = <Date 2016-09-17.14:43:07.901>
    labels = ['type-feature', '3.7', 'OS-windows']
    title = 'os.putenv should support bytes arguments on Windows'
    updated_at = <Date 2021-03-20.14:32:18.443>
    user = 'https://github.com/eryksun'

    bugs.python.org fields:

    activity = <Date 2021-03-20.14:32:18.443>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-03-20.02:17:03.641>
    closer = 'eryksun'
    components = ['Windows']
    creation = <Date 2016-09-17.14:43:07.901>
    creator = 'eryksun'
    dependencies = []
    files = ['44714']
    hgrepos = []
    issue_num = 28188
    keywords = ['patch']
    message_count = 4.0
    messages = ['276797', '354498', '354499', '389138']
    nosy_count = 5.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'eryksun', 'steve.dower']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue28188'
    versions = ['Python 3.6', 'Python 3.7']

    @eryksun
    Copy link
    Contributor Author

    eryksun commented Sep 17, 2016

    This suggestion may be controversial: os.putenv should decode bytes arguments as UTF-8, the new Windows filesystem encoding. Moreover, os.environb should also be implemented. This would be consistent with bytes support in os.spawnve and os.execve.

    The controversial aspect, I think, is that this doesn't allow using arbitrary encodings for environment-variable names and values. The statement in the docs that os.environb allows one "to use a different encoding" than the filesystem encoding would have to be modified with a caveat that on wide-character platforms, such as Windows, using the filesystem encoding is mandatory.

    @eryksun eryksun added 3.7 (EOL) end of life type-feature A feature request or enhancement labels Sep 17, 2016
    @vstinner
    Copy link
    Member

    In the meanwhile, the PEP-540 "UTF-8 Mode" has been implemented.

    @vstinner
    Copy link
    Member

    This issue was referenced from https://bugs.python.org/issue29240#msg285482

    @eryksun
    Copy link
    Contributor Author

    eryksun commented Mar 20, 2021

    I thought this was a good idea at the time, but a core dev never took up the mantle in over 4 years, and no one else showed interest.

    @eryksun eryksun closed this as completed Mar 20, 2021
    @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
    3.7 (EOL) end of life OS-windows type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants