[issue38999] Python launcher on Windows does not detect active venv

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: > I realize one could interpret the python3 in the shebang as an > "explicit version specification", but a) that's not on the > command line, which seems the more natural reading and b) it's > only a partial specification, since i

[issue37769] Windows Store installer should warn user about MAX_PATH

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue37769> ___ ___ Python-bugs-list mailing list Unsub

[issue34142] Windows launcher version lookup flawed

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- type: behavior -> enhancement versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue34142> ___ ___ Py

[issue41661] os.path.relpath does not document ValueError on Windows with different drives

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: The suggested documentation change looks good to me. -- type: behavior -> enhancement versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issu

[issue35306] OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg333746 ___ Python tracker <https://bugs.python.org/issue35306> ___ ___ Python-bugs-list mailin

[issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- title: OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists -> [Windows] OSError when testing whether pathlib.Path('*') exists type: -> behavior versions: +Python 3.10 -Python 3.7

[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [Windows] OSError when testing whether pathlib.Path('*') exists ___ Python tracker <https://b

[issue36792] [Windows] time: crash on formatting time with de_DE locale

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg361476 ___ Python tracker <https://bugs.python.org/issue36792> ___ ___ Python-bugs-list mailin

[issue36792] [Windows] time: crash on formatting time with de_DE locale

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: ucrt in Windows 10 v2004 uses an internal wide-character version of the time-zone name, which gets updated by _tzset() and kept in sync with the _tzname encoded strings. Also, note that the current implementation uses the locale's ANSI code page for both &

[issue36319] Erro 0xC0000374 on windows 10

2021-03-26 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [Windows] time: crash on formatting time with de_DE locale ___ Python tracker <https://bugs.python

[issue42041] venv subprocess call to python resolves to wrong interpreter

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42041> ___

[issue37339] Document that os.path.ismount() returns true for nested btrfs subvolumes

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- assignee: -> docs@python components: +Documentation nosy: +docs@python title: os.path.ismount returns true on nested btrfs subvolumes -> Document that os.path.ismount() returns true for nested btrfs subvolumes type: behavior -> enhancement versions

[issue38948] [Windows] require an existing directory and suport junctions in ntpath.ismount()

2021-03-27 Thread Eryk Sun
Eryk Sun added the comment: Here's a concrete implementation of the above discussion. _is_windows = (sys.platform == 'win32') def ismount(path): """Test whether a path is a mount point""" path = os.fspath(path) if

[issue35026] Winreg's documentation lacks mentioning required permission at some points

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue35026> ___ ___ Python-bug

[issue34816] raise AttributeError if loading fails in ctypes.LibraryLoader.__getattr__

2021-03-27 Thread Eryk Sun
Eryk Sun added the comment: > __getattr__ method of LibraryLoader catches the OSError and > raises an AttributeError Yes. It seems no one was keen to work on this. I think it's relatively easy, so I'll add that flag in case someone is looking for an easy issue. --

[issue33406] [ctypes] increase the refcount of a callback function

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10 -Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue33406> ___ ___ Python-bugs-list mailin

[issue35440] Setup failed 0x80072f7d - Unspecified error

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35440> ___

[issue37756] Error 0x80070643 when installing

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37756> ___

[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) keywords: +3.10regression, 3.6regression, 3.7regression, 3.8regression, 3.9regression -patch stage: test needed -> needs patch type: crash -> behavior versions: +Python 3.10 -Python 3.7 ___

[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue37801> ___ ___ Python-bugs-list mailin

[issue39318] NamedTemporaryFile could cause double-close on an fd if _TemporaryFileWrapper throws

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg359981 ___ Python tracker <https://bugs.python.org/issue39318> ___ ___ Python-bugs-list mailin

[issue39318] NamedTemporaryFile could cause double-close on an fd if _TemporaryFileWrapper throws

2021-03-27 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue39318> ___ ___ Python-bugs-list mailing list Unsub

[issue22121] Start IDLE from icon in a better place.

2021-03-27 Thread Eryk Sun
Eryk Sun added the comment: > if sys.stdout is None and no file in sys.argv With the app distribution from the Microsoft Store, "idle3.x.exe" is a GUI executable that runs idlelib. There isn't a console version. Also, GUI scripts are usually run with the pyw.exe launcher o

[issue22121] Start IDLE from icon in a better place.

2021-03-27 Thread Eryk Sun
Eryk Sun added the comment: > blacklisting directories Ensure that filepaths in sys.argv are resolved before changing out of a blacklisted directory. Also, for file open/save dialogs, as opposed to the working directory of the Python subprocess (e.g. os.getcwd() in the REPL), it's

[issue35144] TemporaryDirectory clean-up fails with unsearchable directories

2021-03-28 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue35144> ___ ___ Python-bug

[issue43649] time.strftime('%z') doesn't return UTC offset in the form ±HHMM

2021-03-28 Thread Eryk Sun
Eryk Sun added the comment: I closed bpo-20010 because the official PSF distributions of Python 3.5+ for Windows use the Universal CRT (ucrt), the system C runtime library for applications. ucrt does not have this problem with the "%z" format code. For example, using ctypes:

[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Eryk Sun
Eryk Sun added the comment: > The doc on rmtree states > Exceptions raised by onerror will not be caught. > Does this mean I can't use try/exept inside of onerro rmtree() does not call onerror() in a try/except statement. An exception raised in onerror() will propagate to

[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2021-03-29 Thread Eryk Sun
Eryk Sun added the comment: > the Store package, which can only be *executed* from outside its > container (we can't load the DLL directly). The idea I was pondering was to create "python.exe" in the virtual environment as an appexec link to "C:\Program Files\Wi

[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2021-03-29 Thread Eryk Sun
Eryk Sun added the comment: > "C:\Program Files\WindowsApps\venvlauncher.exe" The above was supposed to be "C:\Program Files\WindowsApps\Python...\venvlauncher.exe", where "Python..." is the elided name of the package directory. -- _

[issue19124] os.execv executes in background on Windows

2021-03-30 Thread Eryk Sun
Eryk Sun added the comment: Steve, what do you think about os.exec*()? Should it be emulated better or deprecated? We can't hide the reality that it's a new process with a different process ID and parent process ID -- against what POSIX requires. But emulating exec() is pro

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Eryk Sun
Eryk Sun added the comment: > I think we should accept `encoding="locale"` even in binary mode. That's a good idea. It means the same as passing None, except it avoids a warning. -- nosy: +eryksun ___ Python tracker <ht

[issue38263] [Windows] multiprocessing: DupHandle.detach() race condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE)

2021-03-30 Thread Eryk Sun
Eryk Sun added the comment: spawn_main() could handle a PermissionError by checking the exit code. If the parent has terminated already, then simply exit quietly. _winapi.PROCESS_QUERY_LIMITED_INFORMATION would need to be defined. For example: def spawn_main(pipe_handle, parent_pid=None

[issue19124] os.execv executes in background on Windows

2021-03-30 Thread Eryk Sun
Eryk Sun added the comment: > Even if that's just swapping the execv call for spawnv(_P_WAIT) > and then exiting, that's fine by me Maybe call SuspendThread() on other threads, at least the ones that can be enumerated with the threading module. > I don't see how it

[issue36534] tarfile and zipfile: handling Windows (path) illegal characters in archive member names

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue36534> ___ ___ Python-bugs-list mailing list Unsub

[issue42968] [Windows] multiprocessing handle leak when child process is killed during startup/unpickling

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- title: multiprocessing handle leak on Windows when child process is killed during startup/unpickling -> [Windows] multiprocessing handle leak when child process is killed during startup/unpickling versions: -Python

[issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- components: +Extension Modules title: Inconsistent os.stat behavior for directory with Access Denied -> [Windows] Inconsistent os.stat behavior for directory with Access Denied versions: +Python 3.10 -Python 3.7 ___ Pyt

[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- components: +Interpreter Core, Library (Lib) -Extension Modules title: Can't import extension modules resolved via relative paths in sys.path on Windows -> [Windows] Can't import extension modules resolved via relative paths in sys.path versions:

[issue29753] [Linux] ctypes packs bitfields Incorrectly

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- title: Ctypes Packing Bitfields Incorrectly - Linux -> [Linux] ctypes packs bitfields Incorrectly versions: +Python 3.10 -Python 3.7 ___ Python tracker <https://bugs.python.org/issu

[issue43431] Subprocess timeout causes output to be returned as bytes in text mode

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue43431> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32671] redesign Windows os.getlogin, and add os.getuser

2021-03-30 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> rejected stage: test needed -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43674] strange effect at recursion limit

2021-03-30 Thread Eryk Sun
Eryk Sun added the comment: > Why is there no 2nd 995 after the recursion error? print(s) calls sys.stdout.write(s) and sys.stdout.write("\n"). The I/O stack consists of a text I/O wrapper, buffered writer, and a raw file object. What happens in this case is that writing &q

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-31 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg389828 ___ Python tracker <https://bugs.python.org/issue43510> ___ ___ Python-bugs-list mailin

[issue43702] [Windows] correctly sort and remove duplicates in _winapi getenvironment()

2021-04-01 Thread Eryk Sun
New submission from Eryk Sun : getenvironment() in Modules/_winapi.c needs to sort variables in the environment block and remove duplicates case insensitively [1]. The sort order used to matter with SetEnvironmentVairableW(). As soon as it reached a name in the environment block that

[issue43707] onerror in tempfile has an invalid raise expression

2021-04-02 Thread Eryk Sun
Eryk Sun added the comment: > It'll still raise, given it's invalid, though not with the > exception it should be raising with... onerror() is always called to handle an exception, and `raise` will re-raise that exception. Is there a specific case where this isn't wor

[issue37609] support "UNC" device paths in ntpath.splitdrive

2021-04-06 Thread Eryk Sun
Eryk Sun added the comment: > I've got a fairly simple implementation for this using the (new) > nt._path_splitroot native method It's for the best to let the system path API handle this, especially if doing so gets this issue resolved, as well as others like it and those th

[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-04-07 Thread Eryk Sun
Eryk Sun added the comment: > The 3.8 backport is much more complicated, as we don't have access to > the PathSkipRoot function there. So we can't use the native function. I guess you missed the comment that I left on the PR a few days ago. The 3.8 backport can use the old

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-04-07 Thread Eryk Sun
Eryk Sun added the comment: For a "~user" path, the value of userhome should always be used if target_user == current_user. If for some reason the USERPROFILE environment variable isn't defined, the fallback "%HOMEDRIVE%%HOMEPATH%" does not necessarily end in

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-04-08 Thread Eryk Sun
Eryk Sun added the comment: > os.path.expanduser() has many flaws, and it just "guess" the > home directory for other users. I'm fine with not guessing another user's profile directory (or home directory) in some cases, or even always. But the code that got commit

[issue43771] [Windows] stdin line buffer size

2021-04-08 Thread Eryk Sun
Eryk Sun added the comment: The limit of 512 characters is not for sys.stdin in general. It's for io._WindowsConsoleIO, which gets used as the raw file for non-redirected sys.stdin -- and opening "CON" and "CONIN$" -- if legacy mode isn't enabled. See bpo-418

[issue42998] pathlib.Path: add `username` argument to `home()`

2021-04-08 Thread Eryk Sun
Eryk Sun added the comment: > 3. Worth fixing in `ntpath.expanduser()` To expand on the suggestion in msg390507, here's a demo that implements getting the profile path of a local user account, with support for the special profile directories "Default", "Public&q

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Eryk Sun
Eryk Sun added the comment: It's not a subprocess bug, per se. It's due to creating the stdout/stderr worker threads from the __del__ finalizer while the interpreter is shutting down. Minimal reproducer, confirmed in both Linux and Windows: import threading class C:

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +pitrou ___ Python tracker <https://bugs.python.org/issue43784> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Eryk Sun
Eryk Sun added the comment: > my subrocess code doesn't seem to hang on Linux where the > thread example code does? Reader threads for stdout and stderr are only used in Windows, since there's no equivalent to select/poll for synchronous pipes in Windows. Without using t

[issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring

2021-04-11 Thread Eryk Sun
Eryk Sun added the comment: > the name "address" and "addr" respectively which are misleading > because it is asking for ctypes.c_char_p or ctypes.c_wchar_p which > are C pointer types string_at() and wstring_at() take a c_void_p value. This can be initia

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-11 Thread Eryk Sun
Eryk Sun added the comment: > My opinion is that no extra flags are necessary. The default of > deleting on close is fine, unless a context manager is active -- in > which case delete on CM exit. There is a use case of needing to let another thread or process open the temporary f

[issue43810] os.path.abspath returns invalid path (resolves symbolic link)

2021-04-11 Thread Eryk Sun
Eryk Sun added the comment: In POSIX, os.path.abspath(p) is normpath(join(os.getcwd(), p)). normpath() doesn't touch the filesystem, and it's documented that its "string manipulation may change the meaning of a path that contains symbolic links". You can use os.path.r

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-12 Thread Eryk Sun
Eryk Sun added the comment: > So we stop passing the O_TEMPORARY flag. If __enter__() is called, > close() closes the file but doesn't delete anything, and > __exit__() closes the file (if open) and deletes it (even if it > wasn't open). If there is no __enter__(), cl

[issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring

2021-04-12 Thread Eryk Sun
Eryk Sun added the comment: > If that's the problem then why not change all of them to use the > name "address" or "addr" to avoid confusion and make it clear > simple. What is your view? Change them all to refer to `ptr`. It's

[issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring

2021-04-12 Thread Eryk Sun
Eryk Sun added the comment: > So are you telling that we should change the name to "ptr" to > avoid a breaking change? The function parameter name is "ptr". Changing that name could break existing code. I don't think it's likely, but it's not wort

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2021-04-13 Thread Eryk Sun
Eryk Sun added the comment: > P.S. No problems with Python 3.8.5 and Ubuntu 20.04.2 LTS. The issue is that the line length is limited to BUFSIZ, which ends up splitting the UTF-8 sequence b'\xe2\x96\x91'. BUFSIZ is only 512 bytes in Windows. It's 8192 bytes in Linux, in w

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2021-04-13 Thread Eryk Sun
Change by Eryk Sun : -- stage: test needed -> needs patch versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue38755> ___ ___ Python-

[issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...")

2021-04-13 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker <https://bugs.python.org/issue14

[issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...")

2021-04-13 Thread Eryk Sun
Eryk Sun added the comment: > I don't get any error executing the t33a.py script The second line in t33a.py is 1618 bytes. The standard I/O BUFSIZ in Linux is 8192 bytes, but it's only 512 bytes in Windows. The latest alpha release, 3.10a7, includes your rewrite of the toke

[issue43810] os.path.abspath returns invalid path (resolves symbolic link)

2021-04-13 Thread Eryk Sun
Eryk Sun added the comment: If realpath() resolves too much, you'll have to resolve manually via os.path.islink() and os.readlink(). If you need strict resolution, use pathlib.Path.resolve(). In strict mode it raises FileNotFoundError if a path component doesn't exist. Also, e

[issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...")

2021-04-13 Thread Eryk Sun
Eryk Sun added the comment: > So that means we can close the issue, no? This is a bug in 3.8 and 3.9, which need the fix to keep reading until "\n" is seen on the line. I arrived at this issue via bpo-38755 if you think it should be addressed there, but it's the same b

[issue43847] [Windows] ntpath.realpath() of bytes root directory may raise TypeError in some cases

2021-04-15 Thread Eryk Sun
Eryk Sun added the comment: In ntpath._getfinalpathname_nonstrict(), `tail` should be initialized to `path[:0]`. Currently `tail` is initialized to the empty string value ''. If an error occurs that's allowed and `path` is a root directory that's passed as bytes, then

[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-16 Thread Eryk Sun
Change by Eryk Sun : -- stage: -> needs patch title: Inability to fetch build 20H2 -> sys.getwindowsversion().platform_version is incorrect versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/i

[issue43865] win32_ver and getwindowsversion return different Windows 10 build numbers

2021-04-16 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> sys.getwindowsversion().platform_version is incorrect ___ Python tracker <https://bugs.python

[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-16 Thread Eryk Sun
Eryk Sun added the comment: > shouldn't the documentation provide the information that > sys.getwindowsversion().platform_version returns the > kernel32.dll version? platform_version is documented as an "accurate major version, minor version and build number of the curre

[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-18 Thread Eryk Sun
Eryk Sun added the comment: The "CurrentBuild" and "CurrentVersion" values go back to the first release of Windows NT 3.1 in 1993 (build 511, which was quickly replaced by build 528). In NT 3.1 (build 528), the "CurrentBuild" value was "1.528.1 () (Ju

[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-18 Thread Eryk Sun
Eryk Sun added the comment: > But kernel32.dll (since it's of a different version) isn't > accurate at all right? To clarify, CMD's VER command calls GetVersion(). It has nothing to do with the file version of any system DLL. Because CMD is a system component, t

[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-19 Thread Eryk Sun
Eryk Sun added the comment: > But isn't calling CMD's VER command risky? A process can overwrite its > PEB OSMajorVersion, OSMinorVersion, and OSBuildNumber. As long as VER is executed without quotes, the shell will not search for an external command. CMD is not going

[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-19 Thread Eryk Sun
Eryk Sun added the comment: > If we're going to launch cmd.exe, I'd prefer to only do that in the > platform module and not the sys function. Nothing in sys should > start a subprocess (if we can at all avoid it). In that case, would you want to deprecate sy

[issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied

2021-04-22 Thread Eryk Sun
Eryk Sun added the comment: Steve, your PR checks `filename[n] == L':'`. I think it should check for a drive name, i.e. `n == 1 && filename[1] == L':'`. For example, the VirtualBox shared-folder filesystem allows creating and accessing filenames that contain and

[issue43936] os.path.realpath() normalizes paths before resolving links on Windows

2021-04-25 Thread Eryk Sun
Eryk Sun added the comment: > os.path.realpath() normalizes paths before resolving links > on Windows Normalizing the input path is required in order to be consistent with the Windows file API. OTOH, the target path of a relative symlink gets resolved in a POSIX-ly correct manner

[issue1227748] doc: subprocess: inheritance of std descriptors inconsistent

2021-04-28 Thread Eryk Sun
Eryk Sun added the comment: > If one calls Popen with stdin = stdout = stderr = None, > the caller's std descriptors are inherited on *x, but > not on Windows In the default case, CreateProcessW() is called with bInheritHandles as false and without explicitly setting the s

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-28 Thread Eryk Sun
Eryk Sun added the comment: A substitute drive is not a mount point, strictly speaking. It's a symlink in the object namespace that targets an arbitrary path on a device, or even on another mapped/substitute drive. A mapped drive is a similar case that targets an arbitrary path on

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Eryk Sun
Eryk Sun added the comment: > I don't know enough about when and why CPython decides to > replace .pyc files It's straight-forward in the case of py_compile.compile(): >>> pyc = py_compile.compile('test.py') >>> f = open(p

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Eryk Sun
Eryk Sun added the comment: > What is the name of the new function introduced in Windows 10 NT API? > Should we use it if the version is detected as Windows 10 (through a > callback to a platform function or through GetVersion API)? No, _bootstrap_external._write_at

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-30 Thread Eryk Sun
Eryk Sun added the comment: > deleting on CM exit when used as a CM, and no change in behaviour > otherwise (me, Zachary, Ethan, Jason and Steve). Steve also wants > O_TEMPORARY to be removed, which doesn't seem controversial among > this group of people. Removing O_TE

[issue43984] winreg.SetValueEx should check the returned value

2021-04-30 Thread Eryk Sun
Eryk Sun added the comment: I'm changing this issue to a behavior bug. Many issues have the potential to be exploited as a security vulnerability in some contrived scenario, but the security issue type is for cases that have provably significant security implications, such as priv

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-30 Thread Eryk Sun
Eryk Sun added the comment: > Does it mean, that your suggestion to leave the O_TEMPORARY for > TemporaryFile means, that NamedTemporaryFile needs to have a > mechanism to know whether it was called as a TemporaryFile Just implement a separate function for TemporaryFile() i

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-30 Thread Eryk Sun
Eryk Sun added the comment: > E.g. if you specify env. var. PYTHON_NTREALPATH_OLD_BEHAVIOR=1, > it doesn't resolve symlinks and junctions. I assumed you wanted to resolve symlinks but hadn't considered that substitute drives are implemented as object symlinks that target

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-30 Thread Eryk Sun
Eryk Sun added the comment: > In our organization we use substituted drives for development, and > no other tools (including other programming languages and their IDEs), > except for Python 3.8+, had any problems with this. How about keeping a substitute or mapped drive from the i

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-30 Thread Eryk Sun
Eryk Sun added the comment: > you are proposing some trick with first unlinking the file and > then employing it as a temporary file using previously known fd. It doesn't need to unlink the file to make it anonymous. I included that to highlight that it's possible. Th

[issue23407] os.walk always follows Windows junctions

2021-05-02 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg389286 ___ Python tracker <https://bugs.python.org/issue23407> ___ ___ Python-bugs-list mailin

[issue23407] os.walk always follows Windows junctions

2021-05-02 Thread Eryk Sun
Eryk Sun added the comment: Windows implements filesystem symlinks and mountpoints as name-surrogate reparse points. Python 3.8 introduced behavior changes to how reparse points are supported, but the stat st_mode value still sets S_IFLNK only for actual symlinks, not for mountpoints. This

[issue44008] os.walk and other directory traversal does not handle recursive mounts on Windows

2021-05-02 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> os.walk always follows Windows junctions ___ Python tracker <https://bugs.python

[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-05 Thread Eryk Sun
Eryk Sun added the comment: > There is no reason why a user should be able to write to > HKCU but not HKLM. Modifying system keys is limited to SYSTEM, administrators, and various privileged accounts and services such as TrustedInstaller. Standard users are not allowed to modify

[issue44051] Virtualalloc wrong return type

2021-05-05 Thread Eryk Sun
Eryk Sun added the comment: > ctypes.windll.kernel32.VirtuAlloc function return by default > a ctypes.c_long In Windows, ctypes.c_int is an alias for ctypes.c_long, which is a signed 32-bit integer. This is the default conversion type for the integer parameters of an FFI (foreign fu

[issue44055] NamedTemporaryFile opened twice on Windows

2021-05-06 Thread Eryk Sun
Eryk Sun added the comment: Your example uses delete=False. In Windows, the provision about reopening the file while it's open applies to delete=True. With the latter, the file is opened with the O_TEMPORARY flag. At the OS level, this flag modifies the CreateFileW() call as fo

[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Eryk Sun
Eryk Sun added the comment: > The whoami process check output shows that my account is in > BUILTIN\Administrators, which proves that the account I am > logged in as local Administrator permissions. Please show the output when whoami.exe is spawned from Python. I never questione

[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Eryk Sun
Eryk Sun added the comment: Thank you. The output shows that the Python process is using a UAC limited security context, i.e. the administrators group is enabled only for access-denied rules, and the integrity level is medium (not elevated to high or system level). Group Name: BUILTIN

[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Eryk Sun
Eryk Sun added the comment: > In any case, it should not be necessary to get Python permissions > to execute write / update methods in Python against HKLM hive HKEY_LOCAL_MACHINE is a predefined handle for the key "\REGISTRY\MACHINE". This key is not mounted by a hive. T

[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Eryk Sun
Eryk Sun added the comment: The issue tracker is not a general support forum for software development. Please ask first on python-list or the users group on discuss.python.org. For now, I'm changing the status of this issue to pending. If the discussion determines that there'

[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-17 Thread Eryk Sun
Eryk Sun added the comment: > For this issue, the PATH conflict would be that "pip" and "python" > refer to different Python installs. I'm aware of the problem for a per-user installation prior to 3.10. However, none of the install commands use the &qu

[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-17 Thread Eryk Sun
Eryk Sun added the comment: > There are a few ways to get multiple Python installs that > could lead to launching the wrong one through PATH. > --user is one of the least likely. As far as I was aware, a --user installation prior to Python 3.10 would be the common way to have

[issue7760] [doc] ctypes: use_errno=True does not work

2021-05-18 Thread Eryk Sun
Eryk Sun added the comment: > The recommendation not to use absolute paths in CDLL is still > not mentioned in the docs: It's not generally the case. Load just a base filename only if the shared library is in the loader's search path. Otherwise use a qualified path that c

[issue44189] multiprocessing AF_PIPE name format is slightly confusing in the docs

2021-05-20 Thread Eryk Sun
Eryk Sun added the comment: There's a formatting problem in Doc/library/multiprocessing.rst due to consumption of the backslashes in multiple steps. The following keeps all of the required backslashes in the HTML output: * An ``'AF_PIPE'`` address is a string of the form

[issue44270] shutil.which: does not find path/cmd.ext where ext is not given

2021-05-30 Thread Eryk Sun
Eryk Sun added the comment: Michael, thank you for the PR, but please associate it with the existing issue bpo-24505. -- nosy: +eryksun resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> shutil.which wrong result on Wind

<    1   2   3   4   5   6   7   8   9   10   >