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

virtual conf file encoding error on windows #69726

Closed
tanbro mannequin opened this issue Nov 3, 2015 · 2 comments
Closed

virtual conf file encoding error on windows #69726

tanbro mannequin opened this issue Nov 3, 2015 · 2 comments
Labels
type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@tanbro
Copy link
Mannequin

tanbro mannequin commented Nov 3, 2015

BPO 25540
Nosy @serhiy-storchaka
Superseder
  • bpo-25185: Inconsistency between venv and site
  • 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 2015-11-03.09:09:21.034>
    created_at = <Date 2015-11-03.06:58:31.587>
    labels = ['type-crash']
    title = 'virtual conf file encoding error on windows'
    updated_at = <Date 2015-11-03.09:09:21.027>
    user = 'https://bugs.python.org/tanbro'

    bugs.python.org fields:

    activity = <Date 2015-11-03.09:09:21.027>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-11-03.09:09:21.034>
    closer = 'serhiy.storchaka'
    components = []
    creation = <Date 2015-11-03.06:58:31.587>
    creator = 'tanbro'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 25540
    keywords = []
    message_count = 2.0
    messages = ['253968', '253974']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'tanbro']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = '25185'
    type = 'crash'
    url = 'https://bugs.python.org/issue25540'
    versions = ['Python 3.5']

    @tanbro
    Copy link
    Mannequin Author

    tanbro mannequin commented Nov 3, 2015

    When create a new venv on windows, sometimes an UnicodeDecodeError occurred.

    It seems that, it is caused by the system module site.

    In [Lib/site.py](https://github.com/python/cpython/blob/main/Lib/site.py), line 468::

            with open(virtual_conf) as f:
                for line in f:
                    line = line.strip()

    The file virtual_conf was open with encoding gbk which is my windows default encoding, but in fact, the file is an utf-8 one, so i think it should be::

            with open(virtual_conf, encoding='utf-8') as f:
                for line in f:
                    line = line.strip()

    @tanbro tanbro mannequin added the type-crash A hard crash of the interpreter, possibly with a core dump label Nov 3, 2015
    @serhiy-storchaka
    Copy link
    Member

    Already fixed in bpo-25185.

    @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
    type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant