[issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True

2017-04-15 Thread Eryk Sun
Eryk Sun added the comment: In Unix, passing an args list with shell=True makes the first element the -c command. The remaining elements are arguments for the shell itself, which makes them $N variables. For example: >>> subprocess.call(['echo $0, $1', 'sp

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

2017-04-17 Thread Eryk Sun
Eryk Sun added the comment: Hiding the console is required often enough that a keyword-only parameter for this would be useful. Other platforms could simply ignore it, in contrast to writing platform-dependent code that passes startupinfo. Note that this option would also hide the window of

[issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista

2017-04-19 Thread Eryk Sun
Eryk Sun added the comment: In case you didn't get notified by Rietveld, I made a couple suggestions on your latest patch. Also, if you wouldn't mind, please update the patch to apply cleanly to 3.7 -- especially since STARTUPINFO now has an __ini

[issue30151] Race condition in use of _PyOS_SigintEvent on windows

2017-04-24 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior ___ Python tracker <http://bugs.python.org/issu

[issue5115] Extend subprocess.kill to be able to kill process groups

2017-04-24 Thread Eryk Sun
Eryk Sun added the comment: Using a Windows job object should be paired with the creation flag CREATE_SUSPENDED. Callers may also need CREATE_BREAKAWAY_FROM_JOB, but setting that creation flag shouldn't be integrated into Popen. The child has to be created suspended to ensure it doesn&#x

[issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only

2017-04-27 Thread Eryk Sun
Eryk Sun added the comment: PathCchCombineEx isn't an import dependency. It's used dynamically via LoadLibraryW and GetProcAddress, with a fallback to PathCombineW. Does Wine maybe have a stub for this function that returns E_NOTIMPL (not implemented)? -- nosy

[issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only

2017-04-27 Thread Eryk Sun
Eryk Sun added the comment: I didn't mean that there's support to fall back on PathCombineW if PathCchCombineEx returns E_NOTIMPL. I was just guessing at what the stub in Wine might be doing. I took a look at the source. It seems the Wine stub function for unimplemented fu

[issue30191] >

2017-04-27 Thread Eryk Sun
Eryk Sun added the comment: This issue tracker is only for CPython. win32com is part of PyWin32, which is an independent project that's hosted at the following SourceForge site: https://sourceforge.net/projects/pywin32 I suggest that you ask for help on the python-win32 list:

[issue26362] Approved API for creating a temporary file path

2017-05-01 Thread Eryk Sun
Eryk Sun added the comment: For Windows, use os.replace instead of os.rename, which will replace the destination file if it exists. However, a request to replace an existing file will be denied access if the file is currently open. Unlinking an open file isn't allowed, even if it's

[issue26362] Approved API for creating a temporary file path

2017-05-01 Thread Eryk Sun
Eryk Sun added the comment: > the lack of Windows' os.rename() atomicity rename/replace is two system calls: NtOpenFile to get a handle for the source file and NtSetInformationFile to rename it. The difference is only that replace() sets the ReplaceIfExists field in the FileRenameInf

[issue30237] Access violation due to CancelSynchronousIo of console read

2017-05-02 Thread Eryk Sun
New submission from Eryk Sun: When ReadConsole is canceled by CancelSynchronousIo [1], for some reason the call still succeeds. It's probably related to the hack that maps STATUS_ALERTED to ERROR_OPERATION_ABORTED when a console read is interrupted by Ctrl+C. The problem is that,

[issue30237] Access violation due to CancelSynchronousIo of console read

2017-05-02 Thread Eryk Sun
Eryk Sun added the comment: Oops, I pasted the MSDN link for ReadConsole instead of CancelSynchronousIo [1]. [1]: https://msdn.microsoft.com/en-us/library/aa363794 -- ___ Python tracker <http://bugs.python.org/issue30

[issue30286] ctypes FreeLibrary fails on Windows 64-bit

2017-05-05 Thread Eryk Sun
Eryk Sun added the comment: It's documented that the default conversion for integer arguments is a 32-bit C int, which is also the default for result types. Whenever pointers (and Windows handles, which are sometimes 64-bit pointers, such as HMODULE values) are passed as arguments, in

[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2017-05-07 Thread Eryk Sun
Eryk Sun added the comment: I don't see a pressing need to support a -64 architecture suffix. If you run 3.6 and get a 32-bit version, you can assume there's no 64-bit version installed and error out if you need 64-bit. That said, supporting this suffix would make the interface

[issue30295] msvcrt SetErrorMode not documented

2017-05-07 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <http://bugs.python.org/issue30295> ___ ___

[issue30295] msvcrt SetErrorMode not documented

2017-05-07 Thread Eryk Sun
Eryk Sun added the comment: msvcrt set_error_mode, CrtReportMode, CrtReportFile and the associated CRT constants should be documented for use with debug builds. Also, msvcrt is missing the set_error_mode constants _OUT_TO_DEFAULT, _OUT_TO_STDERR, _OUT_TO_MSGBOX, and _REPORT_ERRMODE

[issue16865] ctypes arrays >=2GB in length causes exception

2017-05-10 Thread Eryk Sun
Eryk Sun added the comment: In older versions of ctypes, before it was added to the standard library, the underlying length field was a C int, and CArrayType_new used the PyInt_AS_LONG macro. ctypes was added to the standard library in 2.5, by which time the length field is Py_ssize_t, but

[issue16283] ctypes.util.find_library does not find all DLLs anymore

2017-05-13 Thread Eryk Sun
Changes by Eryk Sun : -- status: pending -> closed ___ Python tracker <http://bugs.python.org/issue16283> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue16283] ctypes.util.find_library does not find all DLLs anymore

2017-05-13 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> pending ___ Python tracker <http://bugs.python.org/issue16283> ___ ___

[issue30350] devguide suggests to use VS 2008 to build Python 2.7, but VS 2008 is no more supported?

2017-05-15 Thread Eryk Sun
Eryk Sun added the comment: >> It's a pain to try to install VS 2008 in 2017: it disappeared from >> microsoft.com, at least the Express edition. > I believe that is why Microsoft released the Visual C++ Compiler for > Python 2.7 > (https://www.microsoft.com/en-u

[issue30374] Make win_add2path.py take effect without having to log off

2017-05-15 Thread Eryk Sun
Eryk Sun added the comment: Are people actually using this script? Maybe it should simply be removed. I see a few problems with it [1]: * A default value of "%PATH%" is wrong. That causes the system PATH to be concatenated with itself. * For the user scripts directory,

[issue30405] build.bat: register binaries for py launcher

2017-05-19 Thread Eryk Sun
Eryk Sun added the comment: The launcher could be extended to support additional suffixes in the version string. Currently -32 is supported after the minor version number (e.g. 3.6-32), and (per a recent update) the latest version of the launcher will also support -64, with and without

[issue30362] Launcher add list and list with paths options

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: I'm -0 on the "-0" option, but I think printing the list of registered Python installations would be useful in the --help text and when the launcher fails to find a requested version. -- nosy: +eryksun ___

[issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: How about this? The character encoding is platform-dependent. Non-Windows platforms use the locale encoding (see locale.getpreferredencoding()). On Windows, UTF-8 is used for console character devices (i.e. CON, CONIN$, and CONOUT$). However

[issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: I discussed character devices mostly because of the NUL device. It could be surprising that Python dies on an encoding error when output is redirected to NUL: C:\>chcp 1252 Active code page: 1252 C:\>python -c "print('\u20ac')&qu

[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: Seeing EINVAL here while the child process is alive could mean the read end of the pipe was closed. For example: >>> import time, subprocess >>> cmd = 'python -c "import os, time; os.close(0); time.sleep(15)"'

[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: > but the error is only ignored when the child process is still alive. This should instead be the error is only ignored when child process is *no longer* alive. -- ___ Python tracker <http://bugs.python.org/issu

[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: Addressing the underlying problem would require rewriting _Py_read and _Py_write_impl to directly call ReadFile and WriteFile instead of the CRT read and write functions. Barring that, on Windows _stdin_write would have to always ignore EINVAL

[issue30431] input function truncates prompt by NULL byte

2017-05-22 Thread Eryk Sun
Eryk Sun added the comment: PyOS_Readline uses a null-terminated prompt string. So input() needs to raise a ValueError if the prompt contains null characters, e.g. if PyBytes_GET_SIZE(po) != strlen(promptstr). -- nosy: +eryksun ___ Python tracker

[issue30405] build.bat: register binaries for py launcher

2017-05-22 Thread Eryk Sun
Eryk Sun added the comment: Supporting PEP 514 tags is an interesting idea, but maybe you could go into more detail about what you have in mind. Are you thinking of using the SysVersion, SysArchitecture, and [Windowed]ExecutablePath fields where available instead of parsing version tags and

[issue30405] build.bat: register binaries for py launcher

2017-05-22 Thread Eryk Sun
Eryk Sun added the comment: The existing code can be adapted to generalize support for version-number tags, i.e. X.Y[-32|-64]. locate_all_pythons() would need to search every company key to add executable installations that use version-number tags to the installed_pythons array. Whether a tag

[issue30435] Documentation either unclear or incorrect on comparisons between bytes and strings in Python 3

2017-05-22 Thread Eryk Sun
Eryk Sun added the comment: How about "cannot be compared by value" or "cannot be ordered by value"? Emphasizing the value aspect doesn't conflict with the default equality comparison by identity. Note that starting Python with the -b option causes the bytes type to

[issue30460] file opened for updating cannot write after read

2017-05-24 Thread Eryk Sun
Eryk Sun added the comment: It might be simplest to close this as 3rd party since it's similar to bpo-29817. A workaround is to call f.seek(0, 1) to reset the stream state when switching between reading and writing. That said, a switch to writing at EOF should be supported. The probl

[issue30469] Inconsistent Execution of Generic Descriptor Attributes

2017-05-24 Thread Eryk Sun
Eryk Sun added the comment: It looks like slot_tp_descr_get bypasses call_method in order to unset tp->tp_descr_get for descriptors that don't define __get__. I don't know where that's an issue. If a class doesn't define __get__, its tp_descr_get slot should already

[issue30480] samefile and sameopenfile fail for WebDAV mapped drives

2017-05-26 Thread Eryk Sun
New submission from Eryk Sun: os.path.samefile (used by shutil copyfile and move), os.path.sameopenfile, and pathlib.samefile rely on os.path.samestat (from genericpath.py), which compares corresponding st_dev and st_ino values. POSIX assures that the tuple (st_dev, st_ino) is unique. Windows

[issue30488] Documentation for subprocess.STDOUT needs clarification

2017-05-26 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout ___ Python tracker <http://bugs.python

[issue30431] input function truncates prompt by NULL byte

2017-05-27 Thread Eryk Sun
Eryk Sun added the comment: The solution to raise a ValueError for the PyOS_Readline case won't change the behavior of input() in cases where the prompt is written to sys.stdout. As to copying what print() would do, I guess it's possible to fake it for common platforms. You'd

[issue30494] python.exe crashed when open long path in windows 7

2017-05-27 Thread Eryk Sun
Eryk Sun added the comment: Your example works fine for me in Windows 10, and I see no reason why it would fail in Windows 7. The crash dialog in your screenshot shows that the problem occurred in a DLL named "winhadnt.dll". I suspect that this is malware injected into the python.e

[issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista

2017-05-30 Thread Eryk Sun
Eryk Sun added the comment: We can't reliably distinguish file descriptors from OS handles. They're overlapping sets of integers. A separate pass_handles parameter would be needed. The bigger problem with that idea is that the handles in the list have to be made inheritable befo

[issue30531] Windows 10 3.6.1 install disallows pip installs of packages

2017-05-31 Thread Eryk Sun
Eryk Sun added the comment: You installed Python for all users, which defaults to installing in %ProgramFiles% or %ProgramFiles(x86)%. Python's installation directory inherits the security of its parent directory, which in this case grants full control only to SYSTEM, TrustedInstaller

[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Eryk Sun
Eryk Sun added the comment: > Ah, looks like they require symlinks for the whole test, > which means you need to be admin when running them on Windows. The privilege to create symlinks isn't filtered out of a standard user's token. Are there any buildbots already running as

[issue30544] _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails

2017-06-02 Thread Eryk Sun
Eryk Sun added the comment: The following is an example of the problem, right? >>> fd = os.open('stdout.txt', os.O_CREAT | os.O_WRONLY) >>> os.dup2(fd, 1) >>> print('spam') Traceback (most recent call last): File ""

[issue25444] Py Launch Icon

2017-06-06 Thread Eryk Sun
Eryk Sun added the comment: The new launcher icon still has a rocket on it, which I especially like because it's easily distinguished when using the GUI to associate .py[w] scripts. However, it's not the icon used for .py[w] files, so it's rarely seen. -- nosy: +ery

[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread Eryk Sun
Eryk Sun added the comment: Segev included a fix for this leak in PR 1927 for bpo30555, but I suppose it's better to fix it separately. -- nosy: +Segev Finer, eryksun ___ Python tracker <http://bugs.python.org/is

[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-08 Thread Eryk Sun
Eryk Sun added the comment: The memory leak is in os_spawnv_impl and os_spawnve_impl in Modules/posixmodule.c. The call fails with a ValueError when the first argument in the argv list is an empty string, in which case these functions both mistakenly pass i (0) to free_string_array() as the

[issue30634] ctypes.cast(obj, ctypes.c_void_p) invalid return in linux_x64

2017-06-12 Thread Eryk Sun
Eryk Sun added the comment: It's undocumented that cast() should work to directly convert Python strings to pointers. Even when it seems to work, it's a risky thing to depend on because there's no source ctypes data object to reference. Thus there's neither _b_base_ nor

[issue36080] Ensurepip fails to install pip into a nested virtual environment (on Windows)

2019-02-24 Thread Eryk Sun
Change by Eryk Sun : -- superseder: -> Creating venv from venv no longer works in 3.7.2 ___ Python tracker <https://bugs.python.org/issue36080> ___ ___ Py

[issue36102] TestSharedMemory fails on AMD64 FreeBSD CURRENT Shared 3.x

2019-02-25 Thread Eryk Sun
Eryk Sun added the comment: > Given that this requirement is not universal and because a leading > slash controls other behaviors on platforms like Windows Forward slash has no special meaning anywhere in the names of NT objects, such as memory Section objects (aka file-mapping object

[issue36112] os.path.realpath on windows and substed drives

2019-02-25 Thread Eryk Sun
Eryk Sun added the comment: In Windows, realpath is currently an alias for abspath. Issue 14094 has a pending PR that implements realpath, but it's waiting on improved tests and final approval. I'm afraid it won't make it into 3.8. I suggest using the resolve() method of a pa

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2019-02-25 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +eryksun ___ Python tracker <https://bugs.python.org/issue32986> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36116] test_multiprocessing_spawn fails on AMD64 Windows8 3.x

2019-02-27 Thread Eryk Sun
Eryk Sun added the comment: > And depending on the OS, abort() calls (via Py_FatalError) sometimes > appear to be segfaults, so it could be any number of issues. > (Aside - I'd love to replace the abort() calls with specific exit > codes for configuration errors - they r

[issue36085] Enable better DLL resolution

2019-03-04 Thread Eryk Sun
Eryk Sun added the comment: > Alternatively, I'm totally happy to make a three month exception to > PEP 11 and just drop Win7 completely for 3.8. But I think that needs > to be made official as early as possible Windows 7 is still used on about 40% of Windows desktops, a

[issue35678] subprocess.check_output(): OSError: [WinError 87]

2019-03-05 Thread Eryk Sun
Eryk Sun added the comment: Geoff, we probably need a new issue for this, but first, please report the value of len(os.getcwd()) in a case where check_output() fails. Prior to Windows 10, the working directory is limited to MAX_PATH - 2 (258) characters. (Windows uses the last two

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-05 Thread Eryk Sun
Eryk Sun added the comment: > do you mind if I make a PR with your code(I will of course author you)? Go for it. I prefer no credit, but you're free to do as you wish. -- ___ Python tracker <https://bugs.python.org

[issue36199] libzmq.dll causes uncontrollable screen flickering when accessing windows 2012 R2 server through remote desktop

2019-03-05 Thread Eryk Sun
Eryk Sun added the comment: I'm closing this as third party. libzmq.dll is not part of a standard Python 3 distribution. Search for an existing issue at the site's for PyZMQ [1] and ZeroMQ [2]. [1]: https://github.com/zeromq/pyzmq [2]: https://github.com/zeromq/libzmq -

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread Eryk Sun
Eryk Sun added the comment: Long-path support in Windows 10 does not extend to the lpCurrentDirectory parameter of CreateProcessW. If the path length exceeds the old limit of MAX_PATH - 2 characters (not counting the required trailing backslash and null), CreateProcessW fails with either

[issue36244] Lock release fails under windows

2019-03-08 Thread Eryk Sun
Eryk Sun added the comment: If you're using a virtual environment, then this is most likely a duplicate of issue 35797. -- nosy: +eryksun ___ Python tracker <https://bugs.python.org/is

[issue36244] Lock release fails under windows

2019-03-09 Thread Eryk Sun
Change by Eryk Sun : -- superseder: -> concurrent.futures.ProcessPoolExecutor does not work in venv on Windows ___ Python tracker <https://bugs.python.org/issu

[issue36085] Enable better DLL resolution

2019-03-11 Thread Eryk Sun
Eryk Sun added the comment: > call SetDefaultDllDirectories() in Py_Main (i.e. not when embedded) > to ensure secure search paths are always used That will require rewriting many scripts and packages that use ctypes or cffi to load DLLs. It would also break DLLs that internally r

[issue36264] os.path.expanduser should not use HOME on windows

2019-03-12 Thread Eryk Sun
Eryk Sun added the comment: > `os.path.expanduser` in `ntpath` uses `HOME` in preference to > `USERPROFILE` / `HOMEDRIVE\\HOMEPATH` Guido intentionally added support for HOME in ntpath.expanduser way back in Python 1.5 (circa 1997), and now we're removing it over 20 years later

[issue36085] Enable better DLL resolution

2019-03-12 Thread Eryk Sun
Eryk Sun added the comment: > will this change just affect the embedded Python, or will it affect > the whole process SetDefaultDllDirectories affects the whole process and cannot be reverted back to the legacy search path that includes "%SystemRoot%", "%SystemRoot%

[issue36085] Enable better DLL resolution

2019-03-12 Thread Eryk Sun
Eryk Sun added the comment: Okay. Sorry for adding noise. My mental hiccup was in thinking it would continue to use LOAD_WITH_ALTERED_SEARCH_PATH in conjunction with SetDefaultDllDirectories: LOAD_LIBRARY_SEARCH_DEFAULT_DIRS. I forgot that it's documented that they shouldn't b

[issue36085] Enable better DLL resolution

2019-03-12 Thread Eryk Sun
Eryk Sun added the comment: > Since I just dug enough to find it, the best way to diagnose problems > with dependent DLLs not being found is probably to run Process Monitor > [1] while doing the import and checking its logs. It should show the > paths that were attempted to

[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-14 Thread Eryk Sun
Eryk Sun added the comment: > It appears that the venv module did not get added to the 3.7.3 rc1 > embedded distribution. Was that an oversight, or had I misunderstood > what was needed for this to have happened? I think it was supposed to be added to the nuget package: https://g

[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-15 Thread Eryk Sun
Eryk Sun added the comment: > Is this only targeted at 3.8, then? Steve said he was okay with adding it in 3.7.3, but it hasn't been added yet in 3.7.3-rc1. In msg337949 I linked to the 3.7.3-rc1 version of options.py, line 54, where "venv" would need to be added to the nu

[issue36305] Inconsistent behavior of pathlib.WindowsPath with drive paths

2019-03-15 Thread Eryk Sun
Eryk Sun added the comment: > WindowsPath('cc:').absolute() -> WindowsPath('C:/Users/maor/cc:') This is correct. "cc:" is not a drive, i.e. the `drive` attribute is an empty string. pathlib handles this as an unqualified filename that gets resolved rel

[issue3905] subprocess failing in GUI applications on Windows

2019-03-15 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +eryksun ___ Python tracker <https://bugs.python.org/issue3905> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15286] normpath does not work with local literal paths

2019-03-16 Thread Eryk Sun
Eryk Sun added the comment: For issue 7909, ntpath.normpath was modified to return the path unchanged if it begins with exactly either ".\\" or "?\\". Normalization is not skipped, however, if the prefix has one or more forward slashes instead of all backslash

[issue4071] ntpath.abspath fails for long str paths

2019-03-16 Thread Eryk Sun
Eryk Sun added the comment: I'm closing this as a resolved issue. Python 2 is approaching end of life, and I don't see a pressing need for my suggestion in msg237007. We should be using unicode for paths in Windows anyway since its file systems are natively Unicode. --

[issue3905] subprocess failing in GUI applications on Windows

2019-03-16 Thread Eryk Sun
Eryk Sun added the comment: > I am closing this as out of date because the problem seems to have been > fixed elsewise. This is a problem only in Windows 7, which we should have addressed years ago. It's common enough that we shouldn't leave it as just an unresolved third

[issue3905] subprocess failing in GUI applications on Windows

2019-03-16 Thread Eryk Sun
Eryk Sun added the comment: > A current test on a Win 7 machine similar to what I did > would still be good. Python 3.8 is the last version to support Windows 7 (i.e. NT 6.1). It should get bug fixes through Spring 2021, so we have a couple more years to fix this. We should con

[issue36319] Erro 0xC0000374 on windows 10

2019-03-17 Thread Eryk Sun
Eryk Sun added the comment: Windows Error Reporting should create a crash dump file. The default location for dump files is "%LocalAppData%\CrashDumps". The file should be named either "python.exe..dmp" (release build) or "python_d.exe..dmp" (debug build). You

[issue36334] pathlib.Path unexpected (wrong) behaviour when combining paths in a for loop

2019-03-17 Thread Eryk Sun
Eryk Sun added the comment: The drive is retained when a rooted path is joined to a drive-absolute or UNC-absolute path. This is documented behavior [1]: When several absolute paths are given, the last is taken as an anchor (mimicking os.path.join()’s behaviour): >>>

[issue36305] Inconsistent behavior of pathlib.WindowsPath with drive paths

2019-03-23 Thread Eryk Sun
Eryk Sun added the comment: Paul, I agree that joining Path(".") and Path("c:a") should yield Path("c:a"). However, I disagree that we should always be able to construct Path("a/b") from components Path("a") and Path("b"). It doesn

[issue36085] Enable better DLL resolution

2019-03-26 Thread Eryk Sun
Eryk Sun added the comment: > Any comments, questions or more feedback on the PR? I commented on the PR that I'm concerned that ctypes.CDLL will no longer open a path with slashes in it (e.g. CDLL("./spam.dll") or CDLL("eggs/spam.dll")) relative to th

[issue36085] Enable better DLL resolution

2019-03-27 Thread Eryk Sun
Eryk Sun added the comment: > There are no specific "import" tests, because it's such a pain to set > those up (I need to delete files from the build directory during the > test, and if other tests have already used them that will fail, or I > need to copy the Pyt

[issue36085] Enable better DLL resolution

2019-03-30 Thread Eryk Sun
Eryk Sun added the comment: WinDLL('./_sqlite3.dll') succeeds, which just delays the call to GetFullPathNameW to the CDLL constructor, so I don't see how the working directory is a factor. The difference I see is the lack of the LOAD_LIBRARY_SEARCH_DEFAULT_DIRS flag. Tr

[issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

2019-04-04 Thread Eryk Sun
Eryk Sun added the comment: There's still a potential problem when Reg2Py calls wcslen(str[index]). This could be addressed by having fixupMultiSZ take an int array to store the length of each string. For example: static void fixupMultiSZ(wchar_t **strings, int *lengths, wc

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

2019-04-05 Thread Eryk Sun
Eryk Sun added the comment: _sanitize_windows_name() fails to translate the reserved control characters (0x01-0x1F) and backslash in names. What I've seen done in some cases (e.g. Unix network shares mapped to SMB) is to translate names using the private use area block, e.g. 0

[issue36538] _thread.interrupt_main() no longer interrupts Lock.wait

2019-04-06 Thread Eryk Sun
Eryk Sun added the comment: Windows doesn't implement POSIX signals in the kernel, so _thread.interrupt_main (i.e. PyErr_SetInterrupt) can be useful as an abstraction. Currently PyErr_SetInterrupt (Modules/signalmodule.c) doesn't set our SIGINT event in Windows. It was suggeste

[issue31512] Add non-elevated symlink support for dev mode Windows 10

2019-04-08 Thread Eryk Sun
Eryk Sun added the comment: :ping: It seems this was ready to be merged a while ago. -- ___ Python tracker <https://bugs.python.org/issue31512> ___ ___ Pytho

[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-12 Thread Eryk Sun
Eryk Sun added the comment: Why is the bash/zsh "activate" script getting distributed with CRLF line endings? Apparently Windows builds of bash (e.g. git-bash) can handle CRLF line endings, but Cygwin bash cannot. As to Linux bash in WSL, the activate script from a virtual e

[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-12 Thread Eryk Sun
Eryk Sun added the comment: > This is assuming that in all these cases people are installing Python > for Windows and trying to use it from a non-Windows shell (both WSL > and Cygwin have their own "native" Python builds that presumably > work). It should work from

[issue36601] signals can be caught by any thread

2019-04-12 Thread Eryk Sun
Eryk Sun added the comment: > Maybe a similar thing exists in Linux? Back in the late 90s, Linux implemented threads as 'processes' (LinuxThreads), but with shared resources such as virtual memory and file descriptors. (The Linux kernel's clone system call is highly

[issue36634] venv: activate.bat fails for venv with parentheses in PATH

2019-04-16 Thread Eryk Sun
Eryk Sun added the comment: > my user path contains a stray double quotation mark (") Steve, do you think we should work around this by first removing double quote characters from PATH? This will fix the user's PATH, making one or more directories searchable again, but it co

[issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7

2019-04-17 Thread Eryk Sun
Eryk Sun added the comment: Try os.listdir(u'L:\\Temp') in Python 2. Using a unicode string should result in the same WINAPI FindFirstFileW call as in Python 3. You're running `python3`, but the standard installation doesn't include "python3.exe". Please sh

[issue36305] Inconsistent behavior of pathlib.WindowsPath with drive paths

2019-04-17 Thread Eryk Sun
Eryk Sun added the comment: > In contrast, in the case of CreateProcessW, both Path('./exec') and > Path('exec') are the *correct* paths to the executable. The ./ is not > necessary in that case to display the path correctly, but just to > interact correctly

[issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7

2019-04-17 Thread Eryk Sun
Eryk Sun added the comment: Did you try os.listdir(u'L:\\Temp') in Python 2? -- ___ Python tracker <https://bugs.python.org/issue36646> ___ ___

[issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7

2019-04-18 Thread Eryk Sun
Eryk Sun added the comment: For me in Windows 10, os.listdir(u"C:\\Temp") uses the same sequence of WINAPI and NT system calls in 2.7 and 3.6. Setup the query for all files ("*"), and return the first matching entry: FindFirstFileW FindFirstFileExW

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-20 Thread Eryk Sun
Eryk Sun added the comment: > It'll probably be mbcs or oem encoding. Certainly not UTF-8 Unless the system locale's codepage is set to UTF-8 in Windows 10. I stepped through this in the debugger. When writing to a pipe, typeperf.exe calls WideCharToMultiByte(CP_OEMCP, ...),

[issue35149] pip3 show causing Error for ConfigParaser

2019-04-21 Thread Eryk Sun
Eryk Sun added the comment: In Windows, Python defaults to the system ANSI codepage (e.g. 1252 in the West) for non-console standard I/O. For the case of a `for /f` loop in CMD, stdout is a pipe, so Python defaults to writing ANSI encoded text to its end of the pipe. I recommend overriding

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-24 Thread Eryk Sun
Eryk Sun added the comment: It's "oem", not "mbcs". -- ___ Python tracker <https://bugs.python.org/issue36670> ___ ___ Python-bug

[issue36736] Python crashes when calling win32file.LockFileEx

2019-04-27 Thread Eryk Sun
Eryk Sun added the comment: > win32file.LockFileEx(h, win32con.LOCKFILE_EXCLUSIVE_LOCK, 5, 5, None) This is a third-party issue in the PyWin32 package. win32file.LockFileEx shouldn't allow passing None for the required 5th parameter `ol` (i.e. the lpOverlapped parameter of WINAPI Lo

[issue1776160] Buffer overflow when listing deeply nested directory

2019-04-27 Thread Eryk Sun
Eryk Sun added the comment: In Windows 7, FindFirstFileA uses a per-thread static buffer to decode the input bytes path to Unicode. This buffer limits the length to 259 characters (MAX_PATH - 1), even if a "\\?\" device path is used. Windows 8+ uses a dynamic buffer, but I don

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-30 Thread Eryk Sun
Eryk Sun added the comment: >> A new issue should be raised to fix the FormatMessage calls in the >> standard library that mistakenly leave out >> FORMAT_MESSAGE_IGNORE_INSERTS. > > Do you suggest to modify OSError constructor to modify the call to > Forma

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-05-01 Thread Eryk Sun
Eryk Sun added the comment: > I suspect that we've not used the flags in those ones because we > think we *can* properly format the message, so fixing the use of > inserts is a better option than simply going back to the > unformatted message. We're advised that i

[issue35148] cannot activate a venv environment on a Swiss German windows

2019-05-03 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> venv activate.bat reset codepage fails on windows 10 ___ Python tracker <https://bugs.python

[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-04 Thread Eryk Sun
Eryk Sun added the comment: > cp65001 is *not* utf-8: Microsoft decided to handle surrogates > differently for some reasons. Do you mean valid UTF-16 surrogate pairs? For example: >>> codecs.code_page_encode(65001, '\ud800\udc00') (b'\xf0\x90\x80\x80&#x

[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-04 Thread Eryk Sun
Eryk Sun added the comment: > I think it is better to just make the check in the test conditional. Okay. The test verifies work done to minimize interpreter startup time, but probably the relative cost of importing functools (and thus collections et al) isn't significant compare

[issue36800] Invalid coding error hidden on Windows

2019-05-05 Thread Eryk Sun
Eryk Sun added the comment: > Note I am aware the actual problem is "utf8" vs "utf-8". That shouldn't be an issue since "utf8" is an alias. The fact that your test file has LF line endings is an issue. It should be fixed in 3.7.4. See issue 20844.

<    10   11   12   13   14   15   16   17   18   19   >