[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-17 Thread Eryk Sun
Eryk Sun added the comment: Sorry, I mistakenly left out ERROR_BAD_NETPATH (53). It's at least used with mapped drives. For example, I have drive "M:" mapped to WebDAV "//live.sysinternals.com/tools", and I see this error if I disconnect the network: >>> try:

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-16 Thread miss-islington
miss-islington added the comment: New changeset 4924d558478c9bd7f7ee7cd9c00c72c0f281f1a5 by Miss Islington (bot) in branch '3.8': bpo-38081: Add more non-fatal error codes for ntpath.realpath (GH-16156) https://github.com/python/cpython/commit/4924d558478c9bd7f7ee7cd9c00c72c0f281f1a5

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-16 Thread Steve Dower
Change by Steve Dower : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +15795 pull_request: https://github.com/python/cpython/pull/16187 ___ Python tracker ___

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-16 Thread Steve Dower
Steve Dower added the comment: New changeset 89b8933bb537179f81003928786c5cc6183af591 by Steve Dower in branch 'master': bpo-38081: Add more non-fatal error codes for ntpath.realpath (GH-16156) https://github.com/python/cpython/commit/89b8933bb537179f81003928786c5cc6183af591 --

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-15 Thread Steve Dower
Steve Dower added the comment: I added another PR with the additional error codes listed by Eryk Sun. Theoretically we should be able to test most of them, but I haven't written those tests, and I'm not sure they'd prove enough to be worth the extra code. ntpath.realpath is a "best effort"

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-15 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +15766 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/16156 ___ Python tracker ___

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Eryk Sun
Eryk Sun added the comment: In addition to ERROR_INVALID_FUNCTION (1), ERROR_INVALID_PARAMETER (87), and ERROR_NOT_SUPPORTED (50) for an unsupported device, and ERROR_BAD_NET_NAME (67) for a missing server or share, it should also allow common permission errors: ERROR_ACCESS_DENIED (5)

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Steve Dower
Change by Steve Dower : -- assignee: steve.dower -> stage: resolved -> needs patch versions: +Python 3.9 ___ Python tracker ___

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Eryk Sun
Change by Eryk Sun : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Eryk Sun
Eryk Sun added the comment: We should allow ERROR_INVALID_FUNCTION (1), ERROR_INVALID_PARAMETER (87), and ERROR_NOT_SUPPORTED (50) for readlink and _getfinalpathname, which can indicate a device that does not implement or is not mounted by a file system. We should also allow

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread miss-islington
miss-islington added the comment: New changeset 57491de7c33c5886c4cae2f468b474d9b4e6fed2 by Miss Islington (bot) in branch '3.8': bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899) https://github.com/python/cpython/commit/57491de7c33c5886c4cae2f468b474d9b4e6fed2 -- nosy:

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Steve Dower
Steve Dower added the comment: Thanks for the report! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +15544 pull_request: https://github.com/python/cpython/pull/15903 ___ Python tracker ___

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Zachary Ware
Zachary Ware added the comment: New changeset 92521fea5d0d4aeb9b6a3c3fdd4654af700ad5c8 by Zachary Ware (Steve Dower) in branch 'master': bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899) https://github.com/python/cpython/commit/92521fea5d0d4aeb9b6a3c3fdd4654af700ad5c8 --

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Steve Dower
Change by Steve Dower : -- keywords: +patch pull_requests: +15540 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15899 ___ Python tracker ___

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Александр Семенов
Александр Семенов added the comment: setuptools/sandbox.py: class DirectorySandbox(AbstractSandbox): """Restrict operations to a single subdirectory - pseudo-chroot""" When running user scripts it uses os.path.realpath(os.devnull) to include 'normalized' devnull to the allowed list of

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-10 Thread Steve Dower
Change by Steve Dower : -- nosy: +eryksun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-10 Thread Steve Dower
Steve Dower added the comment: What does pip use it for? Applying the below change avoids the exception, but produces \\.\nul as the result, which may or may not be any better. diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 1d22d5f1dc..becfa20a83 100644 --- a/Lib/ntpath.py +++

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-10 Thread Александр Семенов
Александр Семенов added the comment: It breaks setuptools.sandbox.DirectorySandbox.__init__() with default param 'exceptions' which includes os.devnull and calls os.path.realpath() on it. So, many distributions crashes. -- ___ Python tracker

[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-10 Thread Александр Семенов
Change by Александр Семенов : -- title: Different behavior of in 3.7 and 3.8 os.path.realpath('nul') -> Different behavior of os.path.realpath('nul') in 3.7 and 3.8 ___ Python tracker