[issue35131] Cannot access to customized paths within .pth file
Valentin Zhao added the comment: I am better just waiting you guys fixing that because it is not urgent. On Sat, Nov 3, 2018 at 10:12 PM Jason R. Coombs wrote: > > Jason R. Coombs added the comment: > > Also, I would argue that this is an enhancement request and not a bug - > that the prior expectation was that the .pth file is encoded in whatever > encoding the system expects by default, and that adding support for a > standardized encoding for .pth files is a new feature. > > As another aside: Valentin, the technique you're using to manage packages > is likely to run into issues with certain packages - in particular any > packages that rely on their own `.pth` files to invoke behavior, such as > future_fstrings (https://pypi.org/project/future-fstrings/). I learned > about this issue in (https://github.com/jaraco/rwt/issues/29), which is > why the rwt project adds a `sitecustomize.py` to the target directory that > ensures .pth files are run. Just FYI. > > -- > > ___ > Python tracker > <https://bugs.python.org/issue35131> > ___ > -- ___ Python tracker <https://bugs.python.org/issue35131> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35131] Cannot access to customized paths within .pth file
New submission from Valentin Zhao : I want to manage all the packages that I installed so every time adding package I set "--target" so the package will be downloaded there. Then I wrote the directory in a .pth file which is located in "/Python36/Lib/site-packages" so I could still get accessed to all the packages even though they are not located within "Python36" folder. However, my current user name of Windows is a Chinese name, which means the customized path I mentioned before has Chinese characters within it, thus the .pth file will be also encoded with 'gbk'. Every time I would like to import these packages will get "UnicodeDecodeError: 'gbk' can't decode byte xxx...". Fortunately I have found the reason and cracked the problem: python read .pth files without setting any encoding. The code is located in "Python36/Lib/site.py" def addpackage(sitedir, name, known_paths): if known_paths is None: known_paths = _init_pathinfo() reset = True else: reset = False fullname = os.path.join(sitedir, name) try: # here should set the second param as encoding='utf-8' f = open(fullname, "r") except OSError: return # other codes And after I doing this, everything goes well. -- components: Library (Lib) files: IMG_20181101_173328_[b...@ae031df.jpg messages: 329050 nosy: Valentin Zhao priority: normal severity: normal status: open title: Cannot access to customized paths within .pth file type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47899/IMG_20181101_173328_[b...@ae031df.jpg ___ Python tracker <https://bugs.python.org/issue35131> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34643] How to build Release Version of Python in Windows?
Valentin Zhao added the comment: Or say what the difference of the python executable generated from msi installer and built from source? -- ___ Python tracker <https://bugs.python.org/issue34643> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34643] How to build Release Version of Python in Windows?
Valentin Zhao added the comment: Sorry for not illustrating this clearly. What I need to build is a copyable, relocatable bunch of files which contains a directory like \bin then has an executable in it, so I can run Python directly. Notwithstanding I do not need a installer because I am not supposed to alter user's configuration. Thanks for your patience in advance! -- ___ Python tracker <https://bugs.python.org/issue34643> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34643] How to build Release Version of Python in Windows?
Valentin Zhao added the comment: Sorry I posted a wrong pic. -- Added file: https://bugs.python.org/file47798/build前.png ___ Python tracker <https://bugs.python.org/issue34643> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34643] How to build Release Version of Python in Windows?
New submission from Valentin Zhao : I am going to build a Python.exe to migrate it to another PC, in order to build a seemingly virtual *environment* of Python which could run python files. What I do to implement this is to *COPY* \win32 folder to another pc then execute python.exe with specific python file path tagged along. For now, it works well, however, I met with a strange problem that I cannot find *tcl* under current file hierarchy and this library is generated very deeply so I have to extract it to the root directory manually. Surprisingly, I found that I can directly *COPY* all the folders generated by *msi installer* to another pc then use it. Nevertheless, I fret about there could be some registration thing during installation. So how could I compile the source and make it generate folder hierarchy like the release version(like the snapshot I attached below)? I have read README.md in the \PCBuild yet it helps little. -- components: Windows files: build后结构.png messages: 325116 nosy: Valentin Zhao, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: How to build Release Version of Python in Windows? type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file47797/build后结构.png ___ Python tracker <https://bugs.python.org/issue34643> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33692] Chinese characters issue with input() function
Valentin Zhao added the comment: Hey there! I saw your pull requests to python3.6 and have been merged, so what should we do now? Just update the python to higher a version? -- ___ Python tracker <https://bugs.python.org/issue33692> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33692] Chinese characters issue with input() function
Valentin Zhao added the comment: Hello everyone, do we have a walkaround for this issue now? I barely read your discussion. -- ___ Python tracker <https://bugs.python.org/issue33692> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33692] Chinese characters issue with input() function under Mac OSX
Change by Valentin Zhao : -- title: Chinese characters issue with input() function -> Chinese characters issue with input() function under Mac OSX ___ Python tracker <https://bugs.python.org/issue33692> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33692] Chinese characters issue with input() function
New submission from Valentin Zhao : DIRECTLY run(i.e., python xxx/xxx/input_test.py) the file below and input other Chinese characters, then press backspace to delete them. You will find that you cannot delete them all, and even the cursor in the terminal misplaces and overlaps with the characters. This issue is only reproduced under Mac OS X, everything is fine with Windows. -- components: 2to3 (2.x to 3.x conversion tool) files: input_test.py messages: 318160 nosy: Valentin Zhao priority: normal severity: normal status: open title: Chinese characters issue with input() function type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47623/input_test.py ___ Python tracker <https://bugs.python.org/issue33692> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com