[issue26111] On Windows, os.scandir will keep a handle on the directory until the iterator is exhausted

2021-02-24 Thread Eryk Sun
Eryk Sun added the comment: Issue 25994 added support for the context-manager protocol and close() method in 3.6. So it's at least much easier to ensure that the handle gets closed. The documentation of scandir() links to WinAPI FindFirstFile and FindNextFile, which at least mention

[issue25585] Bad path leads to: ImportError: DLL load failed: %1 is not a valid Win32 application.

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: In 3.8+, the DLL search path for dependent DLLs when importing extension modules excludes PATH and the current working directory. So it's far less likely for an import to fail with ERROR_BAD_EXE_FORMAT. Currently the error message in Python 3 includes the

[issue26658] test_os fails when run on Windows ramdisk

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: os.stat() was redesigned in issue 37834, which entailed extensive updates across the standard library to improve support for Windows reparse points. As part of this, Win32JunctionTests.tearDown() was changed to use a more reliable lexists() check, which resolves

[issue26866] Inconsistent environment in Windows using "Open With"

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue26866> ___ ___

[issue26968] glob.glob incorrect results under windows when pathname exists but interpreter does not have access permissions to pathname

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: Issue 28075 extended the os.stat() and os.lstat() implementation to query basic stat informatiom from the parent directory if opening the file fails with ERROR_ACCESS_DENIED. This change first became available in Python 3.5.3. Previously it was only querying the

[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue20140] UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue27889] ctypes interfers with signal handling

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue27889> ___ ___

[issue28356] Windows: os.rename different in python 2.7.12 and python 3.5.2

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: The documentation of os.rename() should mention that on Windows the "operation will fail if src and dst are on different filesystems". For POSIX, instead of "will" it says "may", but the failure is a certainty in Windows since MO

[issue28364] Windows - Popen (subprocess.py) does not call _handle.Close() at all

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue28364> ___ ___

[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: Here's an example of how to change the isatty() method in Modules/_io/fileio.c to check for a console in Windows: _io_FileIO_isatty_impl(fileio *self) { long res; if (self->fd < 0) return

[issue28824] os.environ should preserve the case of the OS keys ?

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: In Windows, maybe the os.environ mapping could use a case-insensitive subclass of str for its keys, such as the following: @total_ordering class _CaseInsensitiveString(str): def __eq__(self, other): if not isinstance(other, str

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

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : Removed file: https://bugs.python.org/file48607/splitdrive.py ___ Python tracker <https://bugs.python.org/issue37609> ___ ___ Python-bugs-list mailin

[issue28708] Low FD_SETSIZE limit on Windows

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

[issue22302] Windows os.path.isabs UNC path bug

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: > figure out whether to do `Path.cwd() / path` Thus a UNC path is absolute, i.e. any path that starts with 2 or more slashes, and all other paths are relative unless they have both a drive and a root. For example: def isabs(s): """T

[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: This issue affects Windows 7 and earlier, so I'm changing the affected version to Python 3.8, the last version to support Windows 7. I don't have access to Windows 7 currently. If someone has access to an updated Windows 7 installation (all required an

[issue30460] file opened for updating cannot write after read

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue30460> ___ ___

[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue30979> ___ ___

[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: > The APIs are the same, so you can (should) LoadLibrary the one > that you want. The issue is that python3.dll doesn't depend on python3x.dll in the normal way. For example, LoadLibraryExW("path/to/python3.dll", NULL, LOAD_WITH_ALTERED

[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

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

[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

2021-02-25 Thread Eryk Sun
Eryk Sun added the comment: > I'm not sure we ever meant for LoadLibrary("python3.dll") to > actively load the concrete python3X.dll. IIRC, Paul Moore was doing something like this to create a script runner that loads "python3.dll", which runs as a regular app

[issue23425] Windows getlocale unix-like with french, german, portuguese, spanish

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 ___ Python tracker <https://bugs.python.org/issue23

[issue23425] Windows getlocale unix-like with french, german, portuguese, spanish

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue23425> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24747] ctypes silently truncates ints larger than C int

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- type: -> behavior versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issu

[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: The docs still need to clarified that isinstance(obj, type) is a necessary but not sufficient condition for success. It would also be helpful if the error message were less confusing in the case of registered subclasses such as numbers.Number. -- type

[issue26158] File truncate() not defaulting to current position as documented

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- type: -> behavior versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issu

[issue11361] suggestion for os.kill(pid,CTRL_C_EVENT) in tests

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue11

[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue20010> ___ ___

[issue26565] [ctypes] Add value attribute to non basic pointers.

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6 ___ Python tracker <https://bugs.python.org/issue26565> ___ ___

[issue27263] Tkinter sets the HOME environment variable, breaking scripts

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: ntpath.expanduser() no longer uses HOME (though the doc string still refers to $HOME), so at least that problem is resolved. I suppose IDLE could work around the HOME issue in Windows by passing env=os.environ.copy() in the subprocess.Popen() call that creates

[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: El Samuko, is that a Windows (Win32), Cygwin, MSYS2, WSL, or some other version of bash? The same for Python, and which version of Python is it. With these details, I can tell you what `os.kill($WINPID, signal.CTRL_C_EVENT)"` is probably

[issue27496] unicodedata.name() doesn't have names for control characters

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue27

[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: Update from my previous comment in 2016: in Python 3.7+, the socket module's setipaddr() function calls Winsock inet_pton() instead of inet_addr(), and falls back on getaddrinfo(). Neither supports octal addresses. At least using octal fails instead of mista

[issue24045] Behavior of large returncodes (sys.exit(nn))

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: It's still the case in 3.10 that unsigned status codes are limited to 0x7FFF_, and any larger value gets mapped to -1 (0x_). For example: >>> rc = subprocess.call([sys.executable, '-c', 'raise SystemExit(0

[issue28462] subprocess pipe can't see EOF from a child in case of a few children run with subprocess

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue28462> ___ ___

[issue28474] WinError(): Python int too large to convert to C long

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: format_error() can use format "L" (long long) and then check for a value in the accepted range `value >= LONG_MIN && value <= ULONG_MAX`. If the value is out of range, raise OverflowError. Otherwise assign the value to DWORD `code`.

[issue29045] Outdated C api doc about Windows error

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: The documentation still has two references to PyErr_SetFromWindowsErrWithFilenameObject, which is not a defined function in the C API. https://docs.python.org/3.10/c-api/exceptions.html#c.PyErr_SetFromWindowsErrWithFilename -- components: +Windows nosy

[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2021-02-26 Thread Eryk Sun
Eryk Sun added the comment: This problem can be addressed most easily in _get_handles() by combining the case of an invalid standard handle with that of a NULL standard handle, for which a file handle is validated via GetFileType(). However, that leaves a small window for the handle to

[issue31030] sys.executable can be not normalized

2021-02-27 Thread Eryk Sun
Eryk Sun added the comment: In Python 3.10 in POSIX, it's still the case that executable, prefix, exec_prefix, base_prefix, and base_exec_prefix in the sys module do not get normalized. For example, in Linux: $ .local/bin/../bin/python3.10 -c "import sys; print(sys.

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2021-02-27 Thread Eryk Sun
Eryk Sun added the comment: Issue 37424 fixed this for Python 3.7+ in POSIX. It's still broken in Windows, for which I'm leaving issue 31447 open. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed superseder: -> subprocess.run tim

[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2021-02-27 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib), Windows -Interpreter Core nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.

[issue31030] sys.executable can be not normalized

2021-02-27 Thread Eryk Sun
Eryk Sun added the comment: > If it was the tests, they seem to have been fixed elsewhere. The cited tests haven't been changed to work with non-normalized sys.executable, sys.prefix, etc. But it's not common to run the test suite with a non-normalized path such as "L

[issue43346] subprocess.run() sometimes ignores timeout in Windows

2021-02-28 Thread Eryk Sun
New submission from Eryk Sun : subprocess.run() handles TimeoutExpired by terminating the process and waiting on it. In POSIX, the exception object contains the partially read stdout and stderr bytes. For example: cmd = 'echo spam; echo eggs >&2; sleep 2' try: p = s

[issue43346] subprocess.run() sometimes ignores timeout in Windows

2021-02-28 Thread Eryk Sun
Eryk Sun added the comment: Demo Popen() methods, for discussion: def _read_output(self, fileobj): handle = msvcrt.get_osfhandle(fileobj.fileno()) output = self._fileobj2output[fileobj] while True: try: size

[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2021-03-01 Thread Eryk Sun
Eryk Sun added the comment: I'm changing this to a documentation issue and removing the Windows component. The documentation doesn't make it clear that communicate() may block indefinitely (in both POSIX and Windows) even after the process has terminated. As currently impleme

[issue33105] os.path.isfile returns false on Windows when file path is longer than 260 characters

2021-03-01 Thread Eryk Sun
Eryk Sun added the comment: I'm closing this as not a bug. If the process limits DOS paths to MAX_PATH, then checking os.path.isfile() should not be special cased to support longer DOS paths because calling open() on such a path will raise FileNotFoundError. My suggestion in msg3141

[issue14597] Cannot unload dll in ctypes until script exits

2021-03-01 Thread Eryk Sun
Eryk Sun added the comment: Automatically decrementing the reference count of a shared library (e.g. via WinAPI FreeLibrary or POSIX dlclose) when a CDLL instance is finalized would require significant design changes to ensure that all ctypes pointers, scalars, and aggregates that reference

[issue33245] Unable to send CTRL_BREAK_EVENT

2021-03-01 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT) ___ Python tracker <https://bugs.python

[issue34064] subprocess functions with shell=1 pass wrong command to win32 shell

2021-03-01 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> third party stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue8036] raise ValueError for empty `path` in os.spawnv[e]

2021-03-01 Thread Eryk Sun
Eryk Sun added the comment: The internal spawn function in ucrt, common_spawnv(), verifies its parameters as follows: _VALIDATE_RETURN(file_name != nullptr, EINVAL, -1); _VALIDATE_RETURN(file_name[0]!= '\0',EINVAL, -1); _VALIDATE_RETURN(arguments

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2021-03-01 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue19050] [Windows] fflush called on pointer to potentially closed file

2021-03-01 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue19050> ___ ___

[issue33515] subprocess.Popen on a Windows batch file always acts as if shell=True

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

[issue43364] Add shortcut to enable UTF-8 mode in start menu.

2021-03-02 Thread Eryk Sun
Eryk Sun added the comment: > `cmd.exe /c "SETX PYTHONUTF8 1 You can run "[WindowsFolder]System32\setx.exe" directly. It's not a shell command. -- nosy: +eryksun ___ Python tracker <https://

[issue35935] threading.Event().wait() not interruptable with Ctrl-C on Windows

2021-03-02 Thread Eryk Sun
Eryk Sun added the comment: > But on this particular issue, making the unconditional wait be > interruptable by signals shouldn't be impossible. PyThread_acquire_lock_timed() in Python/thread_nt.h currently ignores intr_flag. The current implementation calls EnterNonRecursiveMut

[issue35935] threading.Event().wait() not interruptable with Ctrl-C on Windows

2021-03-03 Thread Eryk Sun
Eryk Sun added the comment: Alexander, I wrote the above sample function to be slotted directly into the existing design based on the SIGINT event. I wasn't looking to rewrite everything using user-mode APCs and alertable waits. A change like that could have ramifications for applica

[issue36067] subprocess terminate() "invalid handle" error when process is gone

2021-03-03 Thread Eryk Sun
Eryk Sun added the comment: > I don't understand why any patch for CPython is needed at all. If and operation on self._handle fails as an invalid handle (due to an underlying STATUS_INVALID_HANDLE or STATUS_OBJECT_TYPE_MISMATCH), then call self._handle.Detach() and re-raise the e

[issue43364] Add shortcut to enable UTF-8 mode in start menu.

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: > I'm always very hesitant to modify system-wide (or user-wide) settings > like this though. I'd be more comfortable if we made it a PYTHONUTF8_310 > variable that _only_ applies to that specific version. Otherwise someone > might insta

[issue43395] os.path states that bytes can't represent all MBCS paths under Windows

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: > Vice versa, using bytes objects cannot represent all file names > on Windows (in the standard mbcs encoding), hence Windows > applications should use string objects to access all files. This is outdated advice that should be removed, or at least re

[issue20088] locale.getlocale() fails if locale name doesn't include encoding

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: The locale_alias database was extended to support "en_AG" and many others, but I'd still prefer Serhiy's suggestion to not guess the codeset when checking the default LC_CTYPE category. Use locale.nl_langinfo(locale.CODESET), if it's ava

[issue3905] subprocess failing in GUI applications on Windows

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: For whatever the reason and Windows version, it's still the case that _get_handles() should work around any bad standard handles in the current process. In bpo-25492, I suggested checking os.get_handle_inheritable(). That's too permissive. It should

[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: I forgot about the much older issue for this problem. I'm closing this issue, because the broken behavior should be fixed, not documented. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subproce

[issue19809] Doc: subprocess should warn uses on race conditions when multiple threads spawn child processes

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: I'm closing this issue because the behavior was addressed for Python 3 in POSIX and mostly addressed in Windows (PEP 443, bpo-19764). The switch to using PROC_THREAD_ATTRIBUTE_HANDLE_LIST with subprocess.Popen() in Windows at least makes scripts safe from

[issue4928] tempfile.NamedTemporaryFile: automatic cleanup by OS

2021-03-04 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue4

[issue22107] tempfile module misinterprets access denied error on Windows

2021-03-04 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue22

[issue23946] zero-valued timestamps are mishandled by os.stat() in Windows

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: For example, the named-pipe filesystem (NPFS), doesn't return timestamps for pipes in the directory listing, so the timestamps are all 0 (i.e. 1601-01-01): >>> write_time = win32file.FindFilesW('//./pipe/*')[0][3] >>> f

[issue39375] Document os.environ[x] = y and os.putenv() as thread unsafe

2021-03-04 Thread Eryk Sun
Change by Eryk Sun : -- type: -> enhancement versions: +Python 3.10 -Python 2.7, Python 3.7 ___ Python tracker <https://bugs.python.org/issue39375> ___ ___ Py

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

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

[issue43403] Misleading statement about bytes not being able to represent windows filenames in documentation

2021-03-04 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> os.path states that bytes can't represent all MBCS paths under Windows ___ Python tracker <https://bugs.p

[issue43403] Misleading statement about bytes not being able to represent windows filenames in documentation

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: > lets not claim that bytes cannot represent everything on a filesystem > with an encoding. Gregory, before changing the filesystem encoding to UTF-8 in Python 3.6, the [A]NSI file API (e.g. CreateFileA) was used for bytes paths and the [W]ide character fi

[issue30431] input function truncates prompt by NULL byte

2021-03-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Interpreter Core -IO versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue30

[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2021-03-04 Thread Eryk Sun
Eryk Sun added the comment: The is fixed in 3.7+. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue28712] Non-Windows mappings for a couple of Windows code pages

2021-03-04 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue28

[issue43395] os.path states that bytes can't represent all MBCS paths under Windows

2021-03-05 Thread Eryk Sun
Eryk Sun added the comment: > instead of the stated 'surrogatepass' In Python 3.6 and above, you can check this as follows: >>> sys.getfilesystemencoding() 'utf-8' >>> sys.getfilesystemencodeerrors() &#

[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue25

[issue28356] Windows: os.rename different in python 2.7.12 and python 3.5.2

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- type: behavior -> enhancement versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issu

[issue29533] urllib2 works slowly with proxy on windows

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6 ___ Python tracker <https://bugs.python.org/issue29533> ___ ___

[issue16272] C-API documentation clarification for tp_dictoffset

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

[issue16272] C-API documentation clarification for tp_dictoffset

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- type: -> enhancement versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker <https://bugs.python.org/issu

[issue30469] Inconsistent Execution of Generic Descriptor Attributes

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue30

[issue8557] subprocess PATH semantics and portability

2021-03-05 Thread Eryk Sun
Eryk Sun added the comment: The Popen() docs begin by explaining that it has "os.execvp()-like" behavior in POSIX and uses CreateProcess() in Windows. Personally, I do not think it's proper for Python's documentation to discuss details of how CreateProcess() handles

[issue25653] ctypes+callbacks+fork+selinux = crash

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue25

[issue27803] ctypes automatic byref failing on custom classes attributes

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5 ___ Python tracker <https://bugs.python.org/issue27803> ___ ___

[issue43409] [Win] Call subprocess.Popen() twice makes Thread.join() interruptible and deadlock

2021-03-05 Thread Eryk Sun
Eryk Sun added the comment: This is a variation on bpo-21822. If join() is called in the main thread, and it gets interrupted immediately after the lock.acquire(block, timeout) call, then subsequent calls will hang. In Windows, the acquire() call is not interruptible with Ctrl+C, so the

[issue27926] ctypes is too slow to convert a Python list to a C array

2021-03-05 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue27

[issue28259] Ctypes bug windows

2021-03-05 Thread Eryk Sun
Eryk Sun added the comment: I didn't have time to look deeper into this. I'm sorry for not getting back to you. The rather-large example that you uploaded didn't and doesn't run for me, so I wasn't able to reproduce the problem. The one bit of advice I have is t

[issue24890] Windows launcher docs don't fully explain shebang semantics

2021-03-05 Thread Eryk Sun
Eryk Sun added the comment: In summary, the launcher documentation needs to be extended as follows: * Include an example of a shebang with a normal Windows path: #!"C:\Program Files\Python310\python.exe" Highlight the importance of quoting paths that cont

[issue43414] os.get_terminal_size() should use file descriptors in Windows

2021-03-05 Thread Eryk Sun
New submission from Eryk Sun : Currently os.get_terminal_size() is hard coded to use the process standard handles in Windows. The function, however, is intended for arbitrary file descriptors, so should not be limited as follows: >>> f = open('conout$', 'w')

[issue43421] os.device_encoding(fd) should support any console fd in Windows

2021-03-06 Thread Eryk Sun
New submission from Eryk Sun : In Windows, os.device_encoding() is hard coded to map file descriptor 0 and descriptors 1 and 2 respectively to the console's input and output code page if isatty(fd) is true. But isatty() is true for any character device, such as "NUL". Also an

[issue14841] os.get_terminal_size() should check stdin as a fallback

2021-03-06 Thread Eryk Sun
Change by Eryk Sun : -- components: +Extension Modules, Library (Lib) versions: +Python 3.10, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue14

[issue30295] msvcrt SetErrorMode not documented

2021-03-06 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) type: -> enhancement versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issu

[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2021-03-06 Thread Eryk Sun
Eryk Sun added the comment: The solution for bpo-36779 changed init_timezone() to get tzname directly from WinAPI GetTimeZoneInformation(). Unfortunately the implementer didn't think to also support time.tzset(), so the value may be stale with no way to refresh it, or possibly diff

[issue43423] Subprocess IndexError possible in _communicate

2021-03-06 Thread Eryk Sun
Eryk Sun added the comment: The presumption I suppose is that these statements only execute if self.stdout_thread and/or self.stderr_thread completes successfully. I suppose that the read could fail or get canceled via CancelSynchronousIo(). Of course in that case you have a bigger problem

[issue10653] test_time test_strptime fails on windows

2021-03-07 Thread Eryk Sun
Eryk Sun added the comment: Update since msg243660: Python 3.8+ now calls setlocale(LC_CTYPE, "") at startup in Windows, as it has always done in POSIX, so decoding the output of strftime("%Z") with PyUnicode_DecodeLocaleAndSize() works again since both agree on using

[issue10653] test_time test_strptime fails on windows

2021-03-07 Thread Eryk Sun
Eryk Sun added the comment: > decoding the output of strftime("%Z") with PyUnicode_DecodeLocaleAndSize() > works again since both agree on using the process active code page At least it works as much as it ever did. It depends on the process active code page being com

[issue8304] time.strftime() and Unicode characters on Windows

2021-03-07 Thread Eryk Sun
Eryk Sun added the comment: Update since msg255133: Python 3.8+ now calls setlocale(LC_CTYPE, "") at startup in Windows, as 3.x has always done in POSIX. So decoding the output of C strftime("%Z") with PyUnicode_DecodeLocaleAndSize() 'works' again, since bot

[issue22790] some class attributes missing from dir(Class)

2021-03-07 Thread Eryk Sun
Eryk Sun added the comment: >> Why are __flags__, __basicsize__, __itemsize__, >>__dictoffset__, and __weakrefoffset__ interesting? > > I haven't said they are, but on the other hand I don't see > why consistency is a bad thing. IMO, they're not intere

[issue24800] exec docs should note that the no argument form in a local scope is really the two argument form

2021-03-07 Thread Eryk Sun
Eryk Sun added the comment: So there are a couple things to clarify here. When the documentation says "if the optional parts are omitted, the code is executed in the current scope", I think it should explicitly state that this is equivalent to calling exec(object, globals(), local

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

2021-03-08 Thread Eryk Sun
Eryk Sun added the comment: communicate() is incomplete, so decoding the output may fail. For example, say the encoding is UTF-8, and the last multibyte character sequence (2-4 bytes) is incomplete. Maybe communicate() should always set `stdout_bytes` and `stderr_bytes` attributes on the

[issue43432] Add function `clear` to the `os` module

2021-03-08 Thread Eryk Sun
Eryk Sun added the comment: The idea of adding some kind of clear_screen() function in the os or shutil module was discussed extensively on python-ideas a few months ago: https://mail.python.org/archives/list/python-id...@python.org/thread/EWQ2BOL3WVZAU2V2MT3HLXN3AEBHANNZ https

<    5   6   7   8   9   10   11   12   13   14   >