[issue21876] os.rename(src, dst) does nothing when src and dst files are hard-linked

2021-11-17 Thread Eryk Sun
Eryk Sun added the comment: > It's nice if os.rename() can be atomic. How about fixing the behavior in shutil.move()? Currently it tries os.rename(src, dst) without checking for this case. For example: >>> os.path.samefile('src', 'dst') True >>> sh

[issue15500] Python should support exporting thread names to the OS

2021-11-14 Thread Eryk Sun
Eryk Sun added the comment: Zackery, here's an initial draft implementation for Windows 10+ that's based on the interface you created in PR 14578. It calls WinAPI SetThreadDescription(), which sets the thread's name directly in the kernel thread object (i.e. ETHREAD.ThreadName

[issue45742] python -h can't find -R option

2021-11-14 Thread Eryk Sun
Eryk Sun added the comment: How about this? Enable hash randomization. This option overrides PYTHONHASHSEED to use the default behavior. -- ___ Python tracker <https://bugs.python.org/issue45

[issue31842] pathlib: "Incorrect function" during resolve()

2021-11-13 Thread Eryk Sun
Change by Eryk Sun : -- stage: -> needs patch type: -> behavior ___ Python tracker <https://bugs.python.org/issue31842> ___ ___ Python-bugs-list

[issue31842] pathlib: "Incorrect function" during resolve()

2021-11-13 Thread Eryk Sun
Eryk Sun added the comment: > perfectly valid redirected paths (winfsp ram drives for example) I mounted a WinFsp MEMFS filesystem on a directory, which set a mountpoint that targets the root path of a volume device in the native "\Device" object directory. It didn't create

[issue45742] python -h can't find -R option

2021-11-12 Thread Eryk Sun
Eryk Sun added the comment: > Which doc is wrong? Currently -R overrides a non-zero seed value in PYTHONHASHSEED. The behavior changed in 3.7. Either the docs or the behavior need to be fixed. To repeat my previous example (this time in Windows): C:\>set PYTHONHASHSEED=37

[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun
Eryk Sun added the comment: > Also all those files are 0 bytes - even the working ones. The files should have no data, just appexec links. It's just an empty file if there's no link set. > Since I cannot even run the actual executable there seems to be > an issue with the ex

[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun
Eryk Sun added the comment: > The python3.9.exe file in the WindowsApps folder looks like > a real executable and not a link. As requested, and as shown in the output, you tested the file in Python 3.9's subdirectory of "WindowsApps", not in "WindowsApps" itself

[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun
Eryk Sun added the comment: > Could it be possible that it might not be able to replace that > link when it is currently in use? Appexec links are only used briefly to find the real executable and create the access token that allows executing it. I don't know how your local p

[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun
Change by Eryk Sun : Removed file: https://bugs.python.org/file50434/read_appexec.py ___ Python tracker <https://bugs.python.org/issue45789> ___ ___ Python-bugs-list m

[issue45789] Python execution broken after update via Windows Store

2021-11-11 Thread Eryk Sun
Eryk Sun added the comment: > It fails with "The system cannot find the file > C:\Users\\AppData\Local\Microsoft\WindowsApps\python3.9.exe." The shell's CreateProcessW() call failed with ERROR_FILE_NOT_FOUND (2). The file exists, but it's probably a broken appexec lin

[issue45777] Issue in reading files with a path longer than 256 letters after latest update

2021-11-10 Thread Eryk Sun
Eryk Sun added the comment: > How are you checking whether it's there or not? The desktop distribution of 3.9.8 is the most obvious case, since it causes sys.getwindowsversion() to report Windows 8.0 (6.2.9200): C:\Temp>"C:\Program Files\Python39\python.exe" -q

[issue45777] Issue in reading files with a path longer than 256 letters after latest update

2021-11-10 Thread Eryk Sun
Eryk Sun added the comment: > Did my accidental breakage of the resource files make it > into the last 3.9 release? Yep, version 3.9.8 of the store app was built last Friday, the day after removing "winuser.h" from the resource definition files. I just installed it

[issue45777] Issue in reading files with a path longer than 256 letters after latest update

2021-11-10 Thread Eryk Sun
Eryk Sun added the comment: Ensure that the system has LongPathsEnabled set to 1. For example, in PowerShell with administrator (elevated) access: PS C:\> $p = "HKLM:\System\CurrentControlSet\Control\Filesystem" PS C:\> get-itempropertyvalue $p LongPathsEnabled 0

[issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors

2021-11-09 Thread Eryk Sun
Eryk Sun added the comment: Also, I suggest using CREATEPROCESS_MANIFEST_RESOURCE_ID (1) and ISOLATIONAWARE_MANIFEST_RESOURCE_ID (2) instead of hard-coded resource IDs. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors

2021-11-09 Thread Eryk Sun
Eryk Sun added the comment: Steve, instead of manually defining RT_MANIFEST, try including "winresrc.h" in the resource definition files. This SDK header includes "winuser.rh" (note the ".rh" extension), which, among other things, includes the followin

[issue45354] test_winconsoleio fails on Windows 11

2021-11-09 Thread Eryk Sun
Eryk Sun added the comment: It would also work to add RT_MANIFEST=24 to the ResourceCompile PreprocessorDefinitions in PCbuild\pyproject.props. Though to me, adding the definition there is obscure compared to including a private header, such as "resourcet

[issue45354] test_winconsoleio fails on Windows 11

2021-11-09 Thread Eryk Sun
Eryk Sun added the comment: The embedded manifest in python[_d].exe is missing, so the process is running with Windows 8 compatibility mode (i.e. 6.2.9200), and thus the check for Windows 11+ (10.0.22000+) is false. It's disappointing that compatibility mode doesn't restore the old DOS

[issue45710] Junction/symbolic folder access error on Windows 11

2021-11-07 Thread Eryk Sun
Eryk Sun added the comment: All we can do here is document the store app's limitation on cross-volume reparse points (junctions, symlinks) in "%UserProfile%\AppData". I suppose it's a rare enough problem that it can just be closed as a third-party issue. -- resolution: wo

[issue45742] python -h can't find -R option

2021-11-07 Thread Eryk Sun
Eryk Sun added the comment: Either the documentation [1] or the behavior needs to be fixed. The following statement is false: Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled

[issue45742] python -h can't find -R option

2021-11-07 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45742> ___ ___ Python-bugs-list mailing list Unsub

[issue45742] python -h can't find -R option

2021-11-07 Thread Eryk Sun
Eryk Sun added the comment: Apparently -R is still implemented in Python 3, even though hash randomization is enabled by default now. Unlike Python 2, in Python 3 -R overrides the PYTHONHASHSEED environment variable, making it effectively the same as "PYTHONHASHSEED=random". F

[issue45719] SubProcess stdin.flush freezes when running python interpreter

2021-11-06 Thread Eryk Sun
Eryk Sun added the comment: Interactive mode isn't automatically enabled when stdin isn't a tty, so the interpreter tries to read all of stdin, until the result is empty (i.e. EOF). You can force interactive mode with the -i command-line option. The example would also benefit from passing

[issue45710] Junction/symbolic folder access error on Windows 11

2021-11-06 Thread Eryk Sun
Eryk Sun added the comment: > does this or does this not look to you like a bug in CPython? It's better to leave the detailed explanation of limits up to the document that's referenced for further information [1], but this issue isn't even briefly mentioned there. Maybe it would help s

[issue45720] Remove shlwapi dependency on Windows

2021-11-05 Thread Eryk Sun
Eryk Sun added the comment: > I also don't actually see gdi32 being transitively loaded as > claimed in the Twitter thread, even back to 3.8. So presumably > there's something else going on to cause that issue. Since Windows XP, shlwapi.dll has increasingly made use of delay loading

[issue45710] Junction/symbolic folder access error on Windows 11

2021-11-04 Thread Eryk Sun
Eryk Sun added the comment: It's not completely surprising that attempting to traverse a name-surrogate reparse point under "%UserProfile%\AppData" fails when using the store app. If you can't or won't move the mountpoint up to %UserProfile%, or anywhere else outside of the applic

[issue12168] SysLogHandler incorrectly appends \000 to messages

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405704 ___ Python tracker <https://bugs.python.org/issue12168> ___ ___ Python-bugs-list mailin

[issue12168] SysLogHandler incorrectly appends \000 to messages

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) -Regular Expressions nosy: -ahmedsayeed1982, ezio.melotti, mrabarnett versions: -Python 3.10 ___ Python tracker <https://bugs.python.org/issue12

[issue17482] functools.update_wrapper mishandles __wrapped__

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405702 ___ Python tracker <https://bugs.python.org/issue17482> ___ ___ Python-bugs-list mailin

[issue17482] functools.update_wrapper mishandles __wrapped__

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: -IO nosy: -ahmedsayeed1982 versions: -Python 3.9 ___ Python tracker <https://bugs.python.org/issue17482> ___ ___ Python-bug

[issue33725] Python crashes on macOS after fork with no exec

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +macOS -Library (Lib) nosy: +ned.deily, ronaldoussoren -ahmedsayeed1982 versions: +Python 3.8 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue33

[issue33725] Python crashes on macOS after fork with no exec

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405703 ___ Python tracker <https://bugs.python.org/issue33725> ___ ___ Python-bugs-list mailin

[issue28524] Set default argument of logging.disable() to logging.CRITICAL

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405700 ___ Python tracker <https://bugs.python.org/issue28524> ___ ___ Python-bugs-list mailin

[issue28524] Set default argument of logging.disable() to logging.CRITICAL

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) -Subinterpreters nosy: -ahmedsayeed1982 versions: +Python 3.7 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue28

[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405699 ___ Python tracker <https://bugs.python.org/issue13936> ___ ___ Python-bugs-list mailin

[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) -Tkinter nosy: -ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue13936> ___ ___ Python-bug

[issue21082] os.makedirs(exist_ok=True) is not thread-safe: umask is set temporary to 0, serious security problem

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405701 ___ Python tracker <https://bugs.python.org/issue21082> ___ ___ Python-bugs-list mailin

[issue21082] os.makedirs(exist_ok=True) is not thread-safe: umask is set temporary to 0, serious security problem

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) -Subinterpreters nosy: -ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue21082> ___ ___ Pytho

[issue38379] finalizer resurrection in gc

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405696 ___ Python tracker <https://bugs.python.org/issue38379> ___ ___ Python-bugs-list mailin

[issue38379] finalizer resurrection in gc

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Interpreter Core -IDLE nosy: -ahmedsayeed1982, terry.reedy versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker <https://bugs.python.org/issue38

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405694 ___ Python tracker <https://bugs.python.org/issue12782> ___ ___ Python-bugs-list mailin

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Interpreter Core -IDLE nosy: -ahmedsayeed1982, terry.reedy ___ Python tracker <https://bugs.python.org/issue12782> ___ ___

[issue39926] unicodedata for Unicode 13.0.0

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: -Argument Clinic ___ Python tracker <https://bugs.python.org/issue39926> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39926] unicodedata for Unicode 13.0.0

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405697 ___ Python tracker <https://bugs.python.org/issue39926> ___ ___ Python-bugs-list mailin

[issue39926] unicodedata for Unicode 13.0.0

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -ahmedsayeed1982, larry versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue39926> ___ ___ Pytho

[issue38692] add a pidfd child process watcher

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405695 ___ Python tracker <https://bugs.python.org/issue38692> ___ ___ Python-bugs-list mailin

[issue38692] add a pidfd child process watcher

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +asyncio -Build nosy: +asvetlov, yselivanov -ahmedsayeed1982 versions: +Python 3.9 -Python 3.11 ___ Python tracker <https://bugs.python.org/issue38

[issue27773] Excessive Py_XDECREF in the ssl module:

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405691 ___ Python tracker <https://bugs.python.org/issue27773> ___ ___ Python-bugs-list mailin

[issue27773] Excessive Py_XDECREF in the ssl module:

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -ahmedsayeed1982, lys.nikolaou, pablogsal versions: +Python 3.6 -Python 3.11 ___ Python tracker <https://bugs.python.org/issue27

[issue3262] re.split doesn't split with zero-width regex

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405692 ___ Python tracker <https://bugs.python.org/issue3262> ___ ___ Python-bugs-list mailin

[issue3262] re.split doesn't split with zero-width regex

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue3262> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405693 ___ Python tracker <https://bugs.python.org/issue38605> ___ ___ Python-bugs-list mailin

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +AlexWaygood, Anthony Sottile, BTaskaya, barry, brett.cannon, eric.smith, gousaiyang, gvanrossum, levkivskyi, lukasz.langa, methane, miss-islington, pablogsal, serhiy.storchaka, steven.daprano, terry.reedy, veky -ahmedsayeed1982, ezio.melotti, vstinner

[issue27863] multiple issues in _elementtree module

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue27863> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27863] multiple issues in _elementtree module

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405690 ___ Python tracker <https://bugs.python.org/issue27863> ___ ___ Python-bugs-list mailin

[issue7673] audioop: check that length is a multiple of the size

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue7673> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7673] audioop: check that length is a multiple of the size

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405688 ___ Python tracker <https://bugs.python.org/issue7673> ___ ___ Python-bugs-list mailin

[issue17239] XML vulnerabilities in Python

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib), XML versions: +Python 3.7, Python 3.9 ___ Python tracker <https://bugs.python.org/issue17239> ___ ___ Pytho

[issue17239] XML vulnerabilities in Python

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405689 ___ Python tracker <https://bugs.python.org/issue17239> ___ ___ Python-bugs-list mailin

[issue17239] XML vulnerabilities in Python

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405686 ___ Python tracker <https://bugs.python.org/issue17239> ___ ___ Python-bugs-list mailin

[issue17239] XML vulnerabilities in Python

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +Arfrever, barry, benjamin.peterson, christian.heimes, eli.bendersky, ezio.melotti, franck, georg.brandl, jwilk, larry, martin.panter, mcepl, mitar, ned.deily, pitrou, rhettinger, rsandwick3, scoder, serhiy.storchaka, steve.dower, vstinner

[issue39573] [C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue39573> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39573] [C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405687 ___ Python tracker <https://bugs.python.org/issue39573> ___ ___ Python-bugs-list mailin

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -Alex.Willmer, ahmedsayeed1982 ___ Python tracker <https://bugs.python.org/issue26903> ___ ___ Python-bugs-list mailing list Unsub

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405712 ___ Python tracker <https://bugs.python.org/issue26903> ___ ___ Python-bugs-list mailin

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2021-11-01 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -gustavoxo, jugnugee2, kevingeller, printerhelpcenter ___ Python tracker <https://bugs.python.org/issue32545> ___ ___ Python-bug

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2021-11-01 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg368787 ___ Python tracker <https://bugs.python.org/issue32545> ___ ___ Python-bugs-list mailin

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2021-11-01 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg389658 ___ Python tracker <https://bugs.python.org/issue32545> ___ ___ Python-bugs-list mailin

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2021-11-01 Thread Eryk Sun
Change by Eryk Sun : -- nosy: -emmajohan ___ Python tracker <https://bugs.python.org/issue32545> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2021-11-01 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405432 ___ Python tracker <https://bugs.python.org/issue32545> ___ ___ Python-bugs-list mailin

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-30 Thread Eryk Sun
Eryk Sun added the comment: Here's an example test that calls WinAPI GetConsoleWindow() and IsWindowVisble() in a child process. if mswindows: try: import ctypes except ImportError: ctypes = None # added in Win32ProcessTestCase def

[issue45645] Deep recursion terminates script execution with no error (Windows, Python 3.9)

2021-10-29 Thread Eryk Sun
Eryk Sun added the comment: In theory, a crash could be prevented in most cases by setting a larger stack guarantee (i.e. region of guard pages) via SetThreadStackGuarantee() [1] and using a vectored exception handler [2]. The exception handler can set a flag in the thread state

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-29 Thread Eryk Sun
Eryk Sun added the comment: > There's nothing gained by complicating this API with more options. Yes, both options is too much. I suggested force_hide_console as an alternative to force_hide, not for both to be implemented. It would be the same as CreateNoWindow in .NET ProcessStartInfo

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-28 Thread Eryk Sun
Eryk Sun added the comment: If only force_hide is implemented, based on `wShowWindow=SW_HIDE`, please ensure that it's clearly documented that this option hides the main window (i.e. first top-level window) of any application that doesn't bypass the default behavior of the window manager

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-28 Thread Eryk Sun
Eryk Sun added the comment: > is it feasible to just have one option that handles all cases? I'm in favor of whatever has broad support and is least surprising for users. I like CREATE_NO_WINDOW, which is restricted to console applications. The alternative is hiding the window, like what

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-28 Thread Eryk Sun
Eryk Sun added the comment: > What is the most trivial way to test it's behaviour? With CREATE_NO_WINDOW, the child process is attached to a console that has no window. Thus calling GetConsoleWindow() in the child returns NULL without an error. OTOH, if the child has no console (

[issue45617] sys.stdin does not iterate correctly on '\r' line separator

2021-10-27 Thread Eryk Sun
Eryk Sun added the comment: > like those returned by the open() function. Their parameters are > chosen as follows..." The `newline` argument for sys.std* isn't documented, but it should be. It happens to be newline='\n' on every platform except Windows. > its newlines at

[issue45617] sys.stdin does not iterate correctly on '\r' line separator

2021-10-26 Thread Eryk Sun
Eryk Sun added the comment: > '\r' is not handled, though it is documented that it > should be supported. Where is it documented that sys.stdin uses universal newlines mode? The newline behavior isn't documented in the sys module [1], though it should be. It's hard coded in create

[issue45545] chdir __exit__ is not safe

2021-10-25 Thread Eryk Sun
Eryk Sun added the comment: > Alternatively, can't we just os.chdir(self._old_cwd) in __enter__ and > preemptively fail? If the context manager isn't going to address the long-path case reliably using either a file-descriptor approach or repeated relative chdir() calls, then I

[issue45511] Batch-mode input() limited to 4095 characters on *NIX

2021-10-25 Thread Eryk Sun
Eryk Sun added the comment: > but I'm interrested in knowing more about the issue/original cause. When the readline module is imported in interactive mode, the PyOS_ReadlineFunctionPointer function pointer is set to call_readline(), which uses GNU Readline. Otherwise PyOS_Readline() ca

[issue45603] [Windows] account privileges and updating Python packages

2021-10-25 Thread Eryk Sun
Eryk Sun added the comment: The pip package installer is not part of Python's standard library. Issues with pip should be reported at the following site: https://github.com/pypa/pip/issues Note that pip 20.0+ automatically switches to a --user installation if the user lacks the required

[issue45600] First sentence in docs for os.environ

2021-10-24 Thread Eryk Sun
Eryk Sun added the comment: The os.environ description appears to be worded as the "string environment" in contrast to the os.environb "environment as byte strings". I like the emphasis on the "process environment". How about "A mapping object of ke

[issue45597] os.path.realpath returns invalid path for junction pointing to letter-less volume

2021-10-24 Thread Eryk Sun
Eryk Sun added the comment: This is from checking whether the \\?\ prefix can be stripped. The _getfinalpathname() call that it makes fails with the initial winerror (ERROR_PATH_NOT_FOUND), since nt._getfinalpathname() still lacks support for volume GUID paths. In this case, it assumes

[issue45545] chdir __exit__ is not safe

2021-10-21 Thread Eryk Sun
Eryk Sun added the comment: Sorry, I seem to have missed your post last month when I scanned over the thread on python-ideas [1]. In POSIX, it could try to handle ENAMETOOLONG by walking the path forward with a relative chdir(). This could try to consume as many components as possible

[issue45545] chdir __exit__ is not safe

2021-10-20 Thread Eryk Sun
Eryk Sun added the comment: > # I thought this would have to be 16, i.e. a path length over 4096, PATH_MAX > # but seemingly just crossing 1050 is enough to fail If os.pathconf() and PC_PATH_MAX are supported, the maximum allowed length of an absolute path is os.pa

[issue25355] Windows installer does not add py.exe launcher to "App Paths" key

2021-10-19 Thread Eryk Sun
Eryk Sun added the comment: > IMO, this makes it the 'system' Python. "App Paths" entries can be used like versioned symlinks in POSIX. For example, an "App Paths" entry for "python3.exe" can refer to a particular installation's "python.exe". That

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-18 Thread Eryk Sun
Eryk Sun added the comment: I was intending force_no_window as an alternative to adding force_hide, since CREATE_NO_WINDOW only affects console applications. Maybe a better name is force_hide_console. -- ___ Python tracker <ht

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-16 Thread Eryk Sun
Eryk Sun added the comment: The force_hide option could also force the use of a new hidden window, even if the current process has a console. That way the output is always hidden. For example: if force_hide or shell: if force_hide and not (creationflags

[issue45488] Powershell Commands no Longer Recognised

2021-10-15 Thread Eryk Sun
Eryk Sun added the comment: This tracker is for issues with the Python language and standard library. You can ask for help with configuration problems on the Users discussion forum: https://discuss.python.org/c/users/7 -- nosy: +eryksun resolution: -> not a bug stage: -> re

[issue45429] [Windows] time.sleep() should use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION

2021-10-11 Thread Eryk Sun
Eryk Sun added the comment: It's up to the core devs whether or not Python should try to use a high-resolution timer, which is currently undocumented in the Windows API and implemented only in recent releases of Windows 10 and 11. But if this does get supported, the code should fall back

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-10 Thread Eryk Sun
Eryk Sun added the comment: > Absolute timeout using can reduce the overhead time of any variable > and object intialization cost before the WaitForMultipleObjects() Again, timer objects store the due time in interrupt time, not system time (i.e. InterruptTime vs Syst

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread Eryk Sun
Eryk Sun added the comment: > Is there any benefit of calling SetWaitableTimer() with an > absolute timeout No, the due time of a timer object is stored in absolute interrupt time, not absolute system time. This has to be calculated either way, and it's actually more work for the

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread Eryk Sun
Eryk Sun added the comment: > In Python 3.11, time.sleep() is now always implemented with a > waitable timer. A regular waitable timer in Windows becomes signaled with the same resolution as Sleep(). It's based on the current interrupt timer period, which can be lowered to 1

[issue45382] platform() is not able to detect windows 11

2021-10-07 Thread Eryk Sun
Eryk Sun added the comment: > use the build number as reference instead of the major.minor It could check the (major, minor, build) tuple, which allows reporting 10.1+ as "post11" and minimizes hard coding of build numbers. For example, given win32_ver() iterates by (major,

[issue45375] Windows assertion in out-of-tree debug build

2021-10-06 Thread Eryk Sun
Eryk Sun added the comment: I left a message on the PR a day ago about a one-off error in the allocation of `buff`. The size should be `MAXPATHLEN + 1`. That's what's used everywhere else in PC/getpathp.c and what gets passed in the PathCchCombineEx(buff, MAXPATHLEN + 1, ...) call

[issue45382] platform() is not able to detect windows 11

2021-10-05 Thread Eryk Sun
Eryk Sun added the comment: The _WIN32_CLIENT_RELEASES table based on major.minor version number isn't helpful since Windows 10 and 11 have the same version number. win32_ver() needs a workaround to return release "11" if the build number is 22000 or greater. Is there any n

[issue45354] test_winconsoleio fails on Windows 11

2021-10-04 Thread Eryk Sun
Eryk Sun added the comment: > This will be the change to make "special" filenames only be > special when used on their own, and not as part of a path For some reason, Windows 11 still reserves case-insensitive "nul" in qualified paths, but none of the other DOS dev

[issue45301] pycore_condvar.h: remove Windows conditonal variable emulation, use Windows native conditional variable

2021-09-28 Thread Eryk Sun
Eryk Sun added the comment: FYI, waiting for a condition variable can cause a thread to enter a wait state that's interruptible, in theory, but the mechanism is different since condition variables and SRW locks are pointer-sized values in user space, instead of NT objects in kernel space

[issue45301] pycore_condvar.h: remove Windows conditonal variable emulation

2021-09-27 Thread Eryk Sun
Eryk Sun added the comment: > IMO it's time to remove _PY_EMULATED_WIN_CV code path from > pycore_condvar.h. SleepConditionVariableSRW() can't be interrupted in PyCOND_WAIT() and PyCOND_TIMEDWAIT(). Maybe a hybrid solution could be adopted. Use native condition variables for t

[issue45274] Race condition in Thread._wait_for_tstate_lock()

2021-09-27 Thread Eryk Sun
Eryk Sun added the comment: This is the same as bpo-21822, so I suppose it should be closed as well with a reference to this issue. -- ___ Python tracker <https://bugs.python.org/issue45

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