[issue35131] Cannot access to customized paths within .pth file

2018-11-29 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35131] Cannot access to customized paths within .pth file

2018-11-21 Thread Windson Yang
Windson Yang added the comment: I will fix this issue after we have consensus with the future of .pth file in #33944 -- ___ Python tracker ___

[issue35131] Cannot access to customized paths within .pth file

2018-11-19 Thread Brett Cannon
Brett Cannon added the comment: There is not "find best encoding" code, hence why so much code out there uses chardet. :) This might also tie into issue #33944 and the idea of rethinking .pth files. -- nosy: +brett.cannon ___ Python tracker

[issue35131] Cannot access to customized paths within .pth file

2018-11-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: The problem you've encountered is that previously the file was assumed to be one encoding and would fail if it was not that encoding... so it was possible to lazy-load the file and process each line. In the new model, where you need to evaluate the

[issue35131] Cannot access to customized paths within .pth file

2018-11-08 Thread Windson Yang
Windson Yang added the comment: I tried to create a PR for it, However, I don't know how to handle the code at https://github.com/python/cpython/blob/d4c76d960b/Lib/site.py#L159 So how to check UnicodeDecodeError when we just open the file, I use readlines() but it may use too many memory

[issue35131] Cannot access to customized paths within .pth file

2018-11-08 Thread Valentin Zhao
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

[issue35131] Cannot access to customized paths within .pth file

2018-11-03 Thread Jason R. Coombs
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

[issue35131] Cannot access to customized paths within .pth file

2018-11-03 Thread Jason R. Coombs
Jason R. Coombs added the comment: I'm only aware of one tool that writes .pth files, and that's setuptools, and it always writes ASCII (assuming package names are ASCII), so any encoding handling should be fine there. > We could add a handler for UnicodeDecodeError that falls back on

[issue35131] Cannot access to customized paths within .pth file

2018-11-02 Thread Windson Yang
Windson Yang added the comment: Hello, Valentin Zhao, do you have time to fix it? Or I can create a PR -- nosy: +Windson Yang ___ Python tracker ___

[issue35131] Cannot access to customized paths within .pth file

2018-11-02 Thread Steve Dower
Steve Dower added the comment: Can you save your file in gbk encoding? That will be an immediate fix. I don't know that we can/should change the encoding we read without checking with everyone who writes out .pth files. (+Jason as a start here, but I suspect there are more tools that write

[issue35131] Cannot access to customized paths within .pth file

2018-11-02 Thread Steve Dower
Steve Dower added the comment: I'll mark this easy as well, since adding that handler is straightforward. Unless someone knows a reason we shouldn't do that either. -- keywords: +easy versions: +Python 3.7, Python 3.8 ___ Python tracker

[issue35131] Cannot access to customized paths within .pth file

2018-11-02 Thread Ned Deily
Change by Ned Deily : -- components: +Windows -Library (Lib) nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue35131] Cannot access to customized paths within .pth file

2018-11-01 Thread Valentin Zhao
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