[New-bugs-announce] [issue25540] virtual conf file encoding error on windows

tanbro report at bugs.python.org
Tue Nov 3 01:58:31 EST 2015


New submission from tanbro:

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`, 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()

----------
messages: 253968
nosy: tanbro
priority: normal
severity: normal
status: open
title: virtual conf file encoding error on windows
type: crash
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25540>
_______________________________________


More information about the New-bugs-announce mailing list