[issue33898] pathlib issues with Windows device paths

2018-06-18 Thread Eryk Sun
New submission from Eryk Sun : For \\?\ extended device paths, pathlib removes the trailing slash for the root directory if the device isn't UNC or a logical (A-Z) drive. Correct: >>> str(Path('//?/UNC/')) '?\\UNC\\' >>> str(Pa

[issue33895] LoadLibraryExW called with GIL held can cause deadlock

2018-06-19 Thread Eryk Sun
Eryk Sun added the comment: In some of these cases, it would be simpler to just remove the explicit dynamic linking. 3.6+ doesn't support XP, so CancelIoEx, CreateSymbolicLinkW, RegDeleteKeyExW, RegDisableReflectionKey, RegEnableReflectionKey, and RegQueryReflectionKey can be l

[issue33922] Enforce 64bit Python by Launcher

2018-06-20 Thread Eryk Sun
Eryk Sun added the comment: Limiting to 64-bit is already implemented in the latest version of the launcher. For example, below I've renamed the registry key for 64-bit Python 3.5 to "xxx3.5" to prevent the launcher from finding it: C:\>py -3.5-64 Pytho

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

2018-06-21 Thread Eryk Sun
Eryk Sun added the comment: David, this is a bug in Python, and the proposed patch is insufficient. We use the volume serial number as st_dev, and this is not guaranteed to be unique in Windows, and may be 0, just as a file's index number is also allowed to be 0. Both possibilities are

[issue33946] os.symlink on Windows should use the new non-admin flag

2018-06-23 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add non-elevated symlink support for dev mode Windows 10 type: -> enhancement ___ Python tracker <https://bugs.pyt

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2018-06-28 Thread Eryk Sun
Change by Eryk Sun : -- stage: needs patch -> patch review versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue29097> ___ ___ Py

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

2018-06-30 Thread Eryk Sun
Eryk Sun added the comment: Sebastian, the problem in this case is that startupinfo.lpAttributeList['handle_list'] contains the duplicated standard-handle values from the previous call, which were closed and are no longer valid. subprocess.Popen has always modified STARTUPINF

[issue34011] Default preference not given to venv DLL's

2018-07-02 Thread Eryk Sun
Eryk Sun added the comment: Offhand I don't know why it copies PYD and DLL files from the DLLs directory. It's part of the standard library. The virtual environment should only need to copy or symlink the binaries in the application directory, such as python.exe, pythonw.exe,

[issue34011] Default preference not given to venv DLL's

2018-07-02 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue34011> ___ ___ Python-bugs-list mailing list Unsub

[issue33922] [Windows] Document the launcher's -64 suffix

2018-07-06 Thread Eryk Sun
Change by Eryk Sun : -- assignee: -> docs@python components: +Documentation dependencies: +Allow windows launcher to specify bit lengths with & without minor version nosy: +docs@python resolution: duplicate -> stage: resolved -> patch review status: closed -> open s

[issue34062] Python launcher on Windows does not work with --list or --list-paths

2018-07-06 Thread Eryk Sun
Eryk Sun added the comment: I don't think the launcher has unit tests. The if statement in process() that calls show_python_list only checks for "-0". It needs to check for the long names as well, e.g.: if (argc == 2) { /* First check for -0[p], --list,

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

2018-07-08 Thread Eryk Sun
Eryk Sun added the comment: This PR works around a bug in CMD, so I'm inclined to close it as a third-party issue. CMD is supposed to implement the following behavior: 1. If all of the following conditions are met, then quote characters on the command line are pres

[issue34069] shutil.move fails with AttributeError

2018-07-08 Thread Eryk Sun
Eryk Sun added the comment: This issue isn't specific to Windows. It's a bug in shutil._basename: def _basename(path): # A basename() variant which first strips the trailing slash, if present. # Thus we always get the last component of the path, even for d

[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2018-07-09 Thread Eryk Sun
Eryk Sun added the comment: Serhiy, an empty file path shouldn't crash the interpreter. The per-thread invalid parameter handler is suppressed before calling _wspawnv, so it should raise OSError (EINVAL) if the file path is empty. That's what I observe in 3.7. Are you suggestin

[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2018-07-10 Thread Eryk Sun
Eryk Sun added the comment: > I don't understand why Python behaves differently in debug mode. > For me, if Python is able to trigger an exception on EINVAL, we > should also get a regular Python exception in debug mode (and not > a crash) The debug build's behavio

[issue34142] Windows launcher version lookup flawed

2018-07-18 Thread Eryk Sun
Eryk Sun added the comment: This line in the docs is incorrect: If PY_PYTHON=3 and PY_PYTHON3=3.1, the commands python and python3 will both use specifically 3.1 It implies that setting the `python` virtual command to "3" or "2" will use the configured version

[issue28166] WindowsConsoleIO misbehavior when Ctrl+C is ignored

2018-07-20 Thread Eryk Sun
Eryk Sun added the comment: > all the input before the ignored Ctrl+C is lost The console host process doesn't know that Python is ignoring Ctrl+C, so it cancels the read and flushes the input buffer. For now, we have to accept this as a limitation of relying on the high-level con

[issue34187] Issues with lazy fd support in _WindowsConsoleIO fileno() and close()

2018-07-22 Thread Eryk Sun
New submission from Eryk Sun : The _WindowsConsoleIO implementation of fileno should raise a ValueError if the internal handle value is INVALID_HANDLE_VALUE. Currently it raises io.UnsupportedOperation, and only if closefd=True. >>> f = open('conin$', &

[issue34115] code.InteractiveConsole.interact() closes stdin

2018-07-22 Thread Eryk Sun
Eryk Sun added the comment: > On Windows Console, sys.stdin.close() does not prevent a second > interact call. This might be considered a bug. This is a bug in io._WindowsConsoleIO. In Python 3, the sys.std* file objects that get created at startup use closefd

[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Eryk Sun
Eryk Sun added the comment: os__getvolumepathname_impl in Modules/posixmodule.c doesn't directly modify the case. So that leaves WinAPI GetVolumePathNameW as the culprit, but, according to the following test, apparently not in Windows 10.0.17134: kernel32 = ctypes.WinDLL(

[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Eryk Sun
Eryk Sun added the comment: > the directory in which I'm building (c:\work-in-progress) is actually > a junction to c:\users\\work-in-progress That makes sense. GetVolumePathName traverses backwards from the final component. If it reaches a reparse point (other than a junction t

[issue34208] Change in 3.7 expression evaluation?

2018-07-24 Thread Eryk Sun
Eryk Sun added the comment: Please refrain from using the issue tracker to satisfy your curiosity. This is a question about compiler optimizations that should be asked on python-list, or maybe python-dev. You can use the dis module to get a superficial answer in terms of the constants in

[issue34233] subprocess.check_output goes to infinte loop

2018-07-26 Thread Eryk Sun
Eryk Sun added the comment: `cmd.exe dir` ignores the unrecognized `dir` argument and runs the interactive shell. The shell is waiting for input on stdin. You can type "exit" and press enter to return to Python. When you run this from IDLE (i.e. via pythonw.exe), there's n

[issue34240] Convert test_mmap to use tempfile

2018-07-26 Thread Eryk Sun
Eryk Sun added the comment: > tests are competing with each other to delete and recreate the file When is this an issue? Each parallel test process should have its own working directory under "{TEMPDIR}/test_python_{pid}". -- n

[issue34240] Convert test_mmap to use tempfile

2018-07-26 Thread Eryk Sun
Eryk Sun added the comment: To clarify, TEMPDIR in this case is from the following code in Lib/test/libregrtest/main.py: # When tests are run from the Python build directory, it is best practice # to keep the test files in a subfolder. This eases the cleanup of leftover # files

[issue34274] Python launcher behavior with "#!/usr/bin/env python" shebang

2018-07-31 Thread Eryk Sun
Eryk Sun added the comment: See the discussion in issue 28686 regarding the use of version detection and/or versioned executable names with env shebangs. I think the launcher should at least support searching PATH for pythonX.exe and pythonX.Y.exe, so users can at least manually copy or

[issue34217] windows: cross compilation fails due to headers with uppercase

2018-08-16 Thread Eryk Sun
Eryk Sun added the comment: > New windows will support case sensitive filesystem too. NTFS in Windows 10 supports a flag to mark a directory as case sensitive [*] via NtSetInformationFile: FileCaseSensitiveInformation, which can be set from the command line via fsutil.exe. In recent bui

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

2018-08-21 Thread Eryk Sun
Eryk Sun added the comment: The Windows implementation shouldn't map file-descriptor values 0, 1, and 2 to the process standard handles. fileno(stdout) may not even be 1 in some cases. It should use `handle = _get_osfhandle(fd)`, which is more generally correct and not limited to hard-

[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2018-08-29 Thread Eryk Sun
Eryk Sun added the comment: Changing the system timer resolution doesn't appear to help, given the current design combined with what looks like a bug in Windows (at least in Windows 10). We can set the system clock resolution below a millisecond via NtSetTimerResolution. I tested at 0

[issue34545] error in the repl due to indentation

2018-08-30 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> third party stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue34618] Encoding error running in subprocess with captured output

2018-09-09 Thread Eryk Sun
Eryk Sun added the comment: The interpreter uses the system ANSI codepage for non-console files. In your case this is codepage 1252. In my current setup I can't reproduce this issue since I'm using the new (beta) support in Windows 10 to configure the ANSI codepage as UTF-8 (65

[issue32245] OSError: raw write() returned invalid length on latest Win 10 Consoles

2018-09-18 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> third party stage: test needed -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread Eryk Sun
Eryk Sun added the comment: This may be the same problem as issue 32245, which was a third-party bug that Microsoft fixed in the last Spring update of Windows 10. Which version of Windows are you using? -- nosy: +eryksun ___ Python tracker

[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Eryk Sun
Eryk Sun added the comment: Python doesn't go out of its way to fake a cross-platform POSIX environment in Windows, complete with emulated fork and exec. I don't recommend using nt.execv[e] or the os.exec* functions in Windows. Their behavior is almost always undesired. I'd

[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread Eryk Sun
Eryk Sun added the comment: With Windows 10 release 1803, I can't reproduce either this problem or the problems from issue 32245. I'm marking this issue closed as a duplicate. Open a new issue if you still experience the problem after updating to Windows 10 release 18

[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Eryk Sun
Eryk Sun added the comment: nt.execv[e] wraps calling the C runtime _wexecv[e] function. The other os.exec* functions are in turn based on these calls. As to spawn, for Windows _P_OVERLAY just means to exit the current process. The source code is published, so you can see how simple the

[issue34780] Hang on startup if stdin refers to a pipe with an outstanding concurrent operation on Windows

2018-09-23 Thread Eryk Sun
Eryk Sun added the comment: > lseek() succeeds on pipes on Windows, but is nearly useless lseek isn't meaningful for pipe and character files (i.e. FILE_TYPE_PIPE and FILE_TYPE_CHAR). While SEEK_SET and SEEK_CUR operations trivially succeed in these cases, the underlying devic

[issue31405] shutil.which doesn't find files without PATHEXT extension on Windows

2018-09-26 Thread Eryk Sun
Eryk Sun added the comment: In a patch review [1] for issue 24505, I had a discussion with Toby Tobkin about extending the behavior of shutil.which() on Windows. This was to match the behavior of the CMD shell, including securing the search path via NeedCurrentDirectoryForExePath, searching

[issue34816] ctypes + hasattr

2018-09-27 Thread Eryk Sun
Eryk Sun added the comment: ctypes.windll is an instance of ctypes.LibraryLoader, which has a __getattr__ method that calls ctypes.WinDLL(name) and caches the result as an instance attribute. I suppose with chained exceptions it's reasonable to handle OSError in __getattr__ by ra

[issue34711] Fix test_httpservers on AIX (trailingSlashOK)

2018-10-02 Thread Eryk Sun
Eryk Sun added the comment: > I confirm that in a junction point This path-parsing bug that strips a trailing slash occurs when a traversed directory is a reparse point, such as a mount-point (junction) or directory symbolic link. It may be limited to just the NTFS and ReFS file-sys

[issue34840] dlopen() error with no error message from dlerror()

2018-10-05 Thread Eryk Sun
Eryk Sun added the comment: > FWIW, the method does not exist on Windows In Windows it's FreeLibrary, for which the implementation in NT calls loader and runtime library functions such as LdrUnloadDll and RtlImageNtHeaderEx. These OS functions internally use structured exception

[issue34980] KillPython target doesn't detect 64-bit processes

2018-10-15 Thread Eryk Sun
Eryk Sun added the comment: > there shouldn't be any problem with 33-bit/64-bit here. Windows > doesn't separate processes like that. Accessing the MainModule property of a .NET Process object raises an exception if the current process is 32-bit and the process is 64-

[issue35060] subprocess output seems to depend on size of terminal screen

2018-10-24 Thread Eryk Sun
Eryk Sun added the comment: This is due to the ps command itself. You'd have the same problem when piping to grep or redirecting output to a file. I don't know how it determines terminal size. I tried overriding stdin, stdout and stderr to pipes and calling setsid() in the fo

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread Eryk Sun
Eryk Sun added the comment: > Windows getcwd() returns a path without resolved symbolic links This provides consistency. If the working directory were resolved, then accessing "../file.ext" after chdir("C:/Temp/link") could be inconsistent with accessing "C:/Tem

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

2018-11-02 Thread Eryk Sun
Eryk Sun added the comment: The Windows command line often has inconsistently localized strings. In this case it's from the ulib.dll utility library. For German, message 0x7692 in "de-DE\ulib.dll.mui" is "Aktive Codepage: %1.\r\n", which has a period after the %1

[issue26660] tempfile.TemporaryDirectory() cleanup exception on Windows if readonly files created

2018-11-03 Thread Eryk Sun
Eryk Sun added the comment: Serhiy, do you also plan to work around immutable files in POSIX? What about permissions on directories that prevent deleting files? In BSD and macOS, we have os.chflags for modifying file flags. Modifying the immutable flag requires superuser access. In Linux

[issue35154] subprocess.list2cmdline() does not allow running some commands.

2018-11-03 Thread Eryk Sun
Eryk Sun added the comment: In case you don't know, on Windows an args sequence has to be converted to a command line that's compatible with CreateProcess[AsUser]. If the executable path isn't passed separately, the system has to parse it from the command line, and in this

[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2018-11-04 Thread Eryk Sun
Eryk Sun added the comment: > file mode and flags which can be set by os.chmod() and os.chflags() > by unprivileged user. I remembered incorrectly about chflags. It's not a single immutable flag, but several (depending on the OS). The owner or superuser can modify U

[issue35154] subprocess.list2cmdline() does not allow running some commands.

2018-11-04 Thread Eryk Sun
Eryk Sun added the comment: > he himself puts double quotes or calls CommandLineToArgvW CommandLineToArgvW has nothing to do with creating a command line for use with CreateProcess. It's used by a process to parse its own command line using the common VC++ rules. > subprocess.l

[issue35180] Ctypes segfault or TypeError tested for python2.7 and 3

2018-11-07 Thread Eryk Sun
Eryk Sun added the comment: Assign an errcheck function to check the return value and raise an OSError exception on failure. Load the C library with use_errno=True to get the value of C errno. Make sure to properly handle encoding Unicode strings for the file-system encoding, including

[issue35205] os.path.realpath preserves the trailing backslash on Windows in python 3.6.7 and python 3.7.1

2018-11-09 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35205> ___

[issue34949] ntpath.abspath no longer uses normpath

2018-11-09 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34949> ___

[issue35216] misleading error message from shutil.copy()

2018-11-13 Thread Eryk Sun
Eryk Sun added the comment: The EINVAL error in Windows also needs improvement, but I don't what can be done after the fact. If there's a trailing slash when opening or creating a regular file, the NtCreateFile system call returns STATUS_OBJECT_INVALID_NAME. The Windows API ma

[issue35223] Pathlib incorrectly merges strings.

2018-11-13 Thread Eryk Sun
Eryk Sun added the comment: os.path.join and pathlib are working as designed and documented. Similarly in POSIX we have the following: >>> p = os.path.join("/123/345", "/", "folder///filename.bin") >>> print(p) /folder///filename.bi

[issue35254] Process finished with exit code -1073741795 (0xC000001D)

2018-11-14 Thread Eryk Sun
Eryk Sun added the comment: 0xC01D is STATUS_ILLEGAL_INSTRUCTION. This is probably due to a third-party bug that's corrupting the return address on the stack, so I'm closing this issue for now. It can be reopened if the developers of the face_recognition module determine t

[issue22121] IDLE should start with HOME as the initial working directory

2018-11-15 Thread Eryk Sun
Eryk Sun added the comment: > I am not sure what a 'post-installation script' means in practice. IIRC, there's no way to prevent environment-variable expansion when shortcuts are created by an MSI, so the shortcuts need to be created or modified after installing IDLE. P

[issue28781] On Installation of 3.5 Python get error message

2016-11-28 Thread Eryk Sun
Eryk Sun added the comment: No, Python 3.5 is the first version to always place the interpreter DLL in the installation directory, beside python.exe. Installing for all users does not place python35.dll in "%SystemRoot%\System32". -- nosy

[issue28781] On Installation of 3.5 Python get error message

2016-11-28 Thread Eryk Sun
Eryk Sun added the comment: Please zip and upload the installation logs since your most recent attempt in msg281849. They might help to figure out why it's doing a per-user uninstall that removes python35.dll. -- ___ Python tracker

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

2016-11-28 Thread Eryk Sun
Eryk Sun added the comment: I've come across a few problems when passing a modified os.environ.copy() to a child process via subprocess.Popen. Ideally it shouldn't be an issue, as long as the OS or C runtime functions are used, but some troublesome programs do their own case-sensit

[issue26363] __builtins__ propagation is misleading described in exec and eval documentation

2016-11-30 Thread Eryk Sun
Eryk Sun added the comment: As shown above, exec and eval default to calling PyEval_GetBuiltins when the globals dict doesn't define '__builtins__'. PyEval_GetBuiltins uses the current frame's f_builtins. If there isn't a current frame, it defaults to the interpreter

[issue28906] Can't inherit sockets with multiprocessing on Windows

2016-12-08 Thread Eryk Sun
Eryk Sun added the comment: You should be able to directly pass the socket to the child process. multiprocessing registers a reduction for this. On Windows it uses the DupSocket class from multiprocessing.resource_sharer: class DupSocket(object): '''Picklable wrapp

[issue28906] Can't inherit sockets with multiprocessing on Windows

2016-12-08 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <http://bugs.python.org/issue28906> ___ ___

[issue28906] Can't inherit sockets with multiprocessing on Windows

2016-12-08 Thread Eryk Sun
Changes by Eryk Sun : -- stage: -> resolved ___ Python tracker <http://bugs.python.org/issue28906> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue28983] Python 3.5.2 won't install on my computer

2016-12-15 Thread eryk sun
Changes by eryk sun : -- components: +Installation, Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware type: performance -> behavior ___ Python tracker <http://bugs.python.org/issu

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-19 Thread eryk sun
eryk sun added the comment: It looks like you've accidentally created and selected an auto-generated association between .py and python.exe. You should be able to restore the original file association to get the "Edit with IDLE" menu back. In Windows 10 the "open with&qu

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-20 Thread eryk sun
eryk sun added the comment: When you change the association for executing scripts (either via Default Programs or the Open with => Choose another app menu), do not "look for another app on this PC". Manually associating files with an executable such as py.exe creates a ProgI

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-20 Thread eryk sun
eryk sun added the comment: > There's no reason to for IDLE to be a system-level association if > the user has not chosen the association Ok, to clarify, SystemFileAssociations can be defined in either the system or user hive. It's fine if the IDLE menu is added this way whe

[issue29031] 'from module import *' and __all__

2016-12-21 Thread eryk sun
eryk sun added the comment: Python 3 does not skip names in __all__ that start with an underscore. wintypes in 2.x uses `from ctypes import *`, so it needs to define __all__. In 3.x it uses `import ctypes`, so it doesn't define __all__, and the private names _COORD, _FILETIME, _LARGE_IN

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread eryk sun
eryk sun added the comment: There are many possible points of failure, so I'd like to get a clearer picture of your system configuration. Please download and run the attached batch file "dump_py_config.bat" and upload the "py_config.txt" file that it creates. --

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread eryk sun
Changes by eryk sun : Removed file: http://bugs.python.org/file45988/dump_py_config.bat ___ Python tracker <http://bugs.python.org/issue29014> ___ ___ Python-bugs-list m

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread Eryk Sun
Changes by Eryk Sun : Added file: http://bugs.python.org/file45989/dump_py_config.bat ___ Python tracker <http://bugs.python.org/issue29014> ___ ___ Python-bugs-list m

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread Eryk Sun
Eryk Sun added the comment: Let's do a bit of house cleaning. Run the following commands in a command prompt: reg delete HKCU\SOFTWARE\Classes\.py /f reg delete HKCU\SOFTWARE\Classes\py_auto_file /f reg delete HKCU\SOFTWARE\Classes\Applications\python.exe /f reg delete

[issue29031] 'from module import *' and __all__

2016-12-21 Thread Eryk Sun
Changes by Eryk Sun : -- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread Eryk Sun
Eryk Sun added the comment: To remove the broken "Edit with IDLE" entry, open an elevated (administrator) command prompt and run the following: reg delete "HKLM\SOFTWARE\Classes\Python.File\shell\Edit with IDLE" /f -- ___ P

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread Eryk Sun
Eryk Sun added the comment: > I did that, and now all the options are gone. Removing the broken HKLM entry shouldn't have removed all of the options. The "Edit with IDLE" menu should be there as long as Python.File is selected for the file association. It's defined

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread Eryk Sun
Eryk Sun added the comment: > I want this to be a regular installation of Python wherein I can > associate .py files with IDLE That isn't a regular installation. It's not even an optional configuration, and never has been. You'd have to set that up manually. Are you loo

[issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10

2016-12-21 Thread Eryk Sun
Eryk Sun added the comment: openwithidle_for_frostyelsa.reg adds an open command for the current user that opens the target file in IDLE. This will take precedence over the per-machine open command that executes the file using the launcher. It also adds "Run" and "Run a

[issue29045] Outdated C api doc about Windows error

2016-12-21 Thread Eryk Sun
Eryk Sun added the comment: PyErr_SetFromWindowsErrWithFilenameObject was never implemented. See issue 11210. Since 3.3 WindowsError is simply an alias for OSError. See PEP 3151. -- nosy: +eryksun ___ Python tracker <http://bugs.python.

[issue29085] Python 3.6 on Windows doesn't seed Random() well enough

2016-12-27 Thread Eryk Sun
Eryk Sun added the comment: > It's presumably failing to read nonblocking random from CrpytGen > and falling back to seeding using time and pid. Yes and no. CryptGenRandom is not failing, but it is nonetheless calling random_seed_time_pid: >>> r = random.Random()

[issue29037] Python 2.7.13 prints version header and exits immediately on Windows 10 x64

2016-12-28 Thread Eryk Sun
Eryk Sun added the comment: In the cmd shell, run `where python` to confirm that "python" runs 2.7 python.exe, and not a python.bat or python.lnk file. Also, check whether stdin is an interactive terminal by running `python -c "import sys; print sys.stdin.isatty()"

[issue29037] Python 2.7.13 prints version header and exits immediately on Windows 10 x64

2016-12-28 Thread Eryk Sun
Eryk Sun added the comment: You have pyreadline installed, a 3rd party module that takes over reading from the console. Try disabling it temporarily by deleting "E:\Python27\lib\site-packages\readline.pyc" and renaming "E:\Python27\lib\site-packages\readline.py"

[issue29037] Python 2.7.13 prints version header and exits immediately on Windows 10 x64

2016-12-28 Thread Eryk Sun
Changes by Eryk Sun : -- Removed message: http://bugs.python.org/msg284186 ___ Python tracker <http://bugs.python.org/issue29037> ___ ___ Python-bugs-list mailin

[issue29085] Python 3.6 on Windows doesn't seed Random() well enough

2016-12-28 Thread Eryk Sun
Eryk Sun added the comment: The secrets module uses SystemRandom, which overrides random() and getrandbits() to use os.urandom, so it's not affected. -- ___ Python tracker <http://bugs.python.org/is

[issue29059] Windows: Python not using ANSI compatible console

2016-12-28 Thread Eryk Sun
Eryk Sun added the comment: > As there is no good interface in core Python to the kernel32 console > operations (and there probably shouldn't be, it would be better to be > consistent), I suggest just flipping the bit at startup on Windows. I don't follow your statemen

[issue29093] Windows launcher breaks history in Git Bash

2016-12-31 Thread Eryk Sun
Eryk Sun added the comment: git-bash.exe runs bash.exe via cmd.exe, which means the console (conhost.exe) ends up with 5 attached processes: cmd.exe bash.exe bash.exe py.exe python.exe The default console configuration uses 4 history

[issue29124] Freeze fails to compile on windows

2017-01-01 Thread Eryk Sun
Eryk Sun added the comment: Using platform.architecture [1] is fine here. `bits` defaults to the size of a pointer in the current process, i.e. `struct.calcsize('P') * 8`. On Windows, it's useless for anything except the default parameters. It doesn't call GetBinaryType [

[issue29131] Calling printf from the cdll does not print the full string

2017-01-02 Thread Eryk Sun
Eryk Sun added the comment: > from ctypes import * > msvcrt = cdll.msvcrt > message_string = "Hello World!\n" > msvcrt.printf("Testing: %s", message_string) Avoid using libraries as attributes of cdll and windll. They get cached, and in turn they cache fun

[issue29131] Calling printf from the cdll does not print the full string

2017-01-02 Thread Eryk Sun
Changes by Eryk Sun : -- Removed message: http://bugs.python.org/msg284525 ___ Python tracker <http://bugs.python.org/issue29131> ___ ___ Python-bugs-list mailin

[issue29131] Calling printf from the cdll does not print the full string

2017-01-02 Thread Eryk Sun
Eryk Sun added the comment: > from ctypes import * > msvcrt = cdll.msvcrt > message_string = "Hello World!\n" > msvcrt.printf("Testing: %s", message_string) Avoid using libraries as attributes of cdll and windll. They get cached, and in turn they cache fun

[issue29131] Calling printf from the cdll does not print the full string

2017-01-02 Thread Eryk Sun
Eryk Sun added the comment: > I am following the "Gray Hat Python - Python Programming for Hackers and > Reverse Engineers" >From what I've seen in Stack Overflow questions asked by people reading that >book, its ctypes code is generally of poor quality. It only

[issue29173] Python 3.6 on Windows wastes a lot of CPU cycles in a while loop

2017-01-05 Thread Eryk Sun
Changes by Eryk Sun : -- stage: -> resolved ___ Python tracker <http://bugs.python.org/issue29173> ___ ___ Python-bugs-list mailing list Unsubscrib

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

2017-01-06 Thread Eryk Sun
Eryk Sun added the comment: Implementing pass_fds on Windows is a problem if Popen has to implement the undocumented use of the STARTUPINFO cbReserved2 and lpReserved2 fields to inherit CRT file descriptors. I suppose we could implement this ourselves in _winapi since it's unlikely tha

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

2017-01-07 Thread Eryk Sun
Eryk Sun added the comment: > Python already has a multiprocessing module which is able to pass > handles (maybe also FD? I don't know) to child processes on > Windows. Popen doesn't implement the undocumented CRT protocol that's used to smuggle the file-descriptor ma

[issue29178] Adding bytes.frombuffer(byteslike) constructor

2017-01-07 Thread Eryk Sun
Eryk Sun added the comment: Isn't the proposed workaround also relying on CPython reference counting to immediately deallocate the sliced view? It fails if I keep a reference to the sliced view: byteslike = bytearray(b'abc') with memoryview(byteslike) as m1:

[issue24699] TemporaryDirectory is cleaned up twice

2017-01-09 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> out of date stage: -> resolved ___ Python tracker <http://bugs.python.org/issue24699> ___ ___ Python-bugs-list

[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Eryk Sun
Eryk Sun added the comment: As a workaround, the platform's default Ctrl+C handler should allow killing the process: >>> signal.signal(signal.SIGINT, signal.SIG_DFL) >>> counter = itertools.count() >>> 'count' in counter

[issue29224] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-10 Thread Eryk Sun
Changes by Eryk Sun : -- stage: -> resolved ___ Python tracker <http://bugs.python.org/issue29224> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue29248] os.readlink fails on Windows

2017-01-12 Thread Eryk Sun
New submission from Eryk Sun: win_readlink in Modules/posixmodule.c mistakenly treats the PrintNameOffset field of the reparse data buffer as a number of characters instead of bytes. Thus, if the offset is non-zero, the value returned is incorrect stack garbage. For example, the following

[issue29250] islink and stat follow_symlinks are inconsistent on Windows

2017-01-12 Thread Eryk Sun
New submission from Eryk Sun: win32_xstat_impl in Modules/posixmodule.c doesn't check the value of reparse_tag to limit traversal to only tags that are considered links. So we have cases in which os.path.islink returns False (e.g. junctions, pending the resolution of issue 23407), but os

[issue23407] os.walk always follows Windows junctions

2017-01-12 Thread Eryk Sun
Eryk Sun added the comment: I opened issue 29248 for the os.readlink bug and issue 29250 for the inconsistency between os.path.islink and os.stat. Handling junctions as links is new behavior, so I've changed this issue to be an enhancement for 3.7. If the notion of a link is generaliz

<    12   13   14   15   16   17   18   19   20   21   >