[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 joining `path + tail

[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 bug th

[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, even in non

[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 tokeni

[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

[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-

[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 which case you n

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

2021-04-13 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 worth brea

[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 not worth

[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__(), close()

[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.realpath()

[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

[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 in

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

2021-04-10 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 thread

[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: 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: def

[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",

[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-41849. -

[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 committe

[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 the

[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 older PathSki

[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 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 working as ex

[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

[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

[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 writin

[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

[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:

[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

[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: -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

[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

[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

[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 its behaviour wou

[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

[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 <https:/

[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 probably good

[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. -- _

[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\Windows

[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

[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:

[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

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

2021-03-28 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 typi

[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 or pyt

[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

[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

[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

[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 ___

[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> ___

[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> ___

[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

[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. -- keywords:

[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

[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 isinstance(pat

[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

[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> ___

[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

[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 "

[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

[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://bugs.python

[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 ___ Python t

[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

[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

[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

[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

[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 it doe

[issue43576] python3.6.4 os.environ error when write chinese to file

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: > If you are lost with locale encodings, you can attempt to encode > everything in UTF-8 and enables the Python UTF-8 Mode: rushant is using Python 3.6. UTF-8 mode was added in 3.7, so it's not an option without first upgrading to 3.7. Also, it's important t

[issue43576] python3.6.4 os.environ error when write chinese to file

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: I think this is a locale configuration problem, in which the locale encoding doesn't match the terminal encoding. If so, it can be closed as not a bug. > export a="中文" In POSIX, the shell reads "中文" from the terminal as bytes encoded in

[issue43585] perf_counter() returns computers uptime

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: I think so. But I'll mark it pending for now in case Tobi provides more information to explain why this is a problem. Making time.perf_counter() system-wide in Windows was fixing it to match the documented behavior. That this provides the system uptime

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Eryk Sun
Eryk Sun added the comment: Fred, do you think this needs to be reopened to clarify that os.sep and os.altsep are not parameters for the ntpath and posixpath modules? I would have thought that the note at the top (path name conventions, etc) would be sufficient to let someone know

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Eryk Sun
Eryk Sun added the comment: > certainly you can see this is a doc bug, since the doc clearly > states that os.sep is utilized to join the elements of the path, > when it clearly isn't; right? os.path is ntpath in Windows, which uses backslash as the path separator, which is

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-24 Thread Eryk Sun
Eryk Sun added the comment: The documentation of os.path.join() uses os.sep because it's written from the perspective of the platform's os.path, which is posixpath on a POSIX system and ntpath on a Windows system. If you need to work with POSIX paths in Windows, then use posixpath

[issue43610] Ctrl C makes interpreter exit

2021-03-23 Thread Eryk Sun
Eryk Sun added the comment: > Python interpreter will exit when using Ctrl C to interrupt > some Python module functions with read operations. The REPL exits when stdin is closed. open() allows the filename to be an existing file descriptor without requiring a parameter such as "

[issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths

2021-03-23 Thread Eryk Sun
Eryk Sun added the comment: > I suppose the most reasonable behavior is to strip out the "\\?\" before > attempting the conversion as the path is sensible and parsable without Okay, so you're not looking to preserve the fact that it's a \\?\ verbatim path in the UR

[issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths

2021-03-23 Thread Eryk Sun
Eryk Sun added the comment: RFC8089 doesn't specify "a mechanism for translating namespaced paths ["\\?\" and "\\.\"] to or from file URIs", and the Windows shell doesn't support them. So what's the practical benefit of supporting them in nturl2path? > Wind

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

2021-03-22 Thread Eryk Sun
Eryk Sun added the comment: In some cases, the problem can be worked around by setting the __PYVENV_LAUNCHER__ environment variable and executing the base executable. For example: import os import sys import subprocess def get_python_exe_env(): if sys.executable

[issue2920] Patch to print symbolic value of errno in OSError.__str__()

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

[issue23407] os.walk always follows Windows junctions

2021-03-22 Thread Eryk Sun
Eryk Sun added the comment: Python 3.8 introduced some behavior changes to how reparse points are supported, but generalized support for handling name-surrogate reparse points as symlinks was not implemented. Python continues to set S_IFLNK in st_mode only for IO_REPARSE_TAG_SYMLINK reparse

[issue43586] sys.path is weird in Windows 10.

2021-03-22 Thread Eryk Sun
Eryk Sun added the comment: > on windows, they print sys.path[0] is python38.zip not "". Isolated mode is probably enabled, i.e. `sys.flags.isolated == 1`. It's enabled by default for the embedded distribution [1], or if a "._pth" file exists beside and

[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: In bpo-29971 it was suggested to split the PyThread lock API in Windows into an "interruptible lock" API that's based on emulated condition variables and a "fast lock" API that's based on native condition variables and SRW locks. Maybe the on

[issue36860] Inconsistent/Undocumented behavior with pathlib resolve and absolute on Windows

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: The issue with non-strict resolution of relative paths that do not exist is being addressed in bpo-38671. The proposal to support and document the absolute() method is addressed in bpo-29688. -- resolution: -> duplicate stage: -> resolved status

[issue39920] os.stat() and os.lstat() fail with Windows device paths

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: 3.7.8, released on 2020-06-27, was the last bugfix release of Python 3.7, so I'm closing this issue as a duplicate of bpo-33898, which is about supporting device paths correctly in pathlib. -- resolution: -> duplicate stage: -> resolved status

[issue38188] Incorrect Argument Order for Calls to _winapi.DuplicateHandle() in multiprocessing.reduction.DupHandle

2021-03-21 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) stage: -> needs patch type: -> behavior versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/i

[issue35754] [Windows] I/O on a broken pipe may raise an EINVAL OSError instead of BrokenPipeError

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: It's still the case that we have to guess that a generic EINVAL (22) is actually EPIPE. Low-level wrapper functions in Python/fileutils.c, such as _Py_read() and _Py_write_impl(), should try to get a better error code by calling Python's custom winerror_to_errno

[issue15286] normpath does not work with local literal paths

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: This old issue still needs to be fixed. The check for special_prefixes in ntpath.normpath() must be removed in order to be consistent with WinAPI GetFullPathNameW(). In Windows, one can just call ntpath.abspath() to ensure that nt._getfullpathname() is called

[issue15286] normpath does not work with local literal paths

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

[issue43585] perf_counter() returns computers uptime

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: For Windows, starting with Python 3.10, the value of time.perf_counter[_ns]() is system wide instead of relative to the first time it's accessed in the current process. This allows comparing the counter value across processes. See bpo-37205. -- nosy

[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

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

[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

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

[issue39484] [time] document that integer nanoseconds may be more precise than float

2021-03-21 Thread Eryk Sun
Change by Eryk Sun : -- assignee: -> docs@python components: +Documentation, Extension Modules -Library (Lib) nosy: +docs@python title: time_ns() and time() cannot be compared on windows -> [time] document that integer nanoseconds may be more precise than float type: be

[issue19124] os.execv executes in background on Windows

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: > On Windows, the new process is executed in the background but > can send output to a console if the original process was > started in a console. C execv[e]() is a mess for console applications. The child process is competing for console input with an

[issue31863] Inconsistent exitcode for terminated child processes on Windows

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: > I'm not actually sure what the proposal here is. Are we suggesting > that all Python's means of terminating a process should use the > same exit code? That's how I read it, but I don't agree if it means always pretending that a process was killed by

[issue33935] [Windows] samefile() should not use zero-valued st_dev and st_ino

2021-03-20 Thread Eryk Sun
Change by Eryk Sun : -- title: shutil.copyfile throws incorrect SameFileError on Google Drive File Stream -> [Windows] samefile() should not use zero-valued st_dev and st_ino ___ Python tracker <https://bugs.python.org/issu

[issue4198] os.path.normcase gets fooled on windows with mapped linux network drive

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: Filesystem paths in Windows are normally opened case insensitive, but a filesystem can choose to ignore this. NTFS does so for directories that flagged as case sensitive [1]. ntpath.normcase() doesn't incorporate this information. It would have to query the case

[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2021-03-20 Thread Eryk Sun
Change by Eryk Sun : -- components: +Extension Modules versions: +Python 3.10, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue33

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: > oh, I missed that a notification happens to the other process(es) in a > common case, a bit of retrying with backoff would actually make sense The other common problem with deleting an empty directory is when it's opened as the working directory of a p

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: > Isn't this just "how windows behaves" on some filesystems with > little that we can do about it? The suggestion was to include an error handler that retries unlink() and rmdir() -- particularly rmdir() -- a given number of times, probably with

[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: > side note: do we need to care about Windows 7 anymore in > 3.10 given that microsoft no longer supports it? If the fix comes in time for Python 3.8, then it needs to support Windows 7. For Python 3.9+, the 32 KiB limit can be removed. The c

[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: > In my experience, most applications use the ANSI code page because > they use the ANSI flavor of the Windows API. The default encoding at startup and in the "C" locale wouldn't change. It would only differ from the default if setlocale(LC_CT

[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread Eryk Sun
Change by Eryk Sun : -- stage: -> needs patch versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issu

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