[issue26630] Windows EXE extension installers not finding 32bit Python 3.5 installation

2016-03-23 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> bdist_wininst created binaries fail to start and find 32

[issue26632] __all__ decorator

2016-03-24 Thread Eryk Sun
Eryk Sun added the comment: > work off its __name__ and __module__ Why is __module__ required? It seems to me this should only operate on the current module. I added a prototype to Python/bltinmodule.c that gets or creates the __all__ list from the current globals (i.e. PyEval_GetGlob

[issue26628] Undefined behavior calling C functions with ctypes.Union arguments

2016-03-24 Thread Eryk Sun
Eryk Sun added the comment: > I would strongly argue to generally prohibit this > with an exception I agree. A warning in the tutorial isn't sufficient. ctypes should raise an error when setting a union or bitfield struct type in argtypes or when passing one by value. Here's

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

2016-03-24 Thread Eryk Sun
Eryk Sun added the comment: The `value` of a c_char_p or c_wchar_p pointer is a Python bytes or str object. Since `value` won't consistently be the address value, it may be better to introduce a read-only `as_void` attribute that can be implemented consistently for all pointer

[issue8557] subprocess PATH semantics and portability

2016-03-24 Thread Eryk Sun
Eryk Sun added the comment: As is documented for CreateProcess [1], the search path always includes the following directories: * The directory from which the application loaded. * The current directory for the parent process. * The Windows system directory. Use the

[issue26658] test_os fails when run on Windows ramdisk

2016-03-28 Thread Eryk Sun
Eryk Sun added the comment: > I'm inclined to believe that this is a bug in the ImDisk device driver Junctions, and other filesystem reparse points, are implemented by volume devices, not disk devices. NTFS and ReFS support reparse points, but FAT, FAT32, and exFAT do not. Does the

[issue26658] test_os fails when run on Windows ramdisk

2016-03-30 Thread Eryk Sun
Eryk Sun added the comment: I see now. It's not a problem with the junction. In the stat implementation, after verifying that the directory or file is a reparse point, it opens it again without FILE_FLAG_OPEN_REPARSE_POINT, in order to open the target instead of the link. I don't

[issue26658] test_os fails when run on Windows ramdisk

2016-03-30 Thread Eryk Sun
Eryk Sun added the comment: I don't disagree with using os.path.lexists. However, I think it should also use a temporary target directory. Also, if it's possible to fix the behavior of os.stat when GetFinalPathNameByHandle fails (considering we already have a handle for the tar

[issue26825] Variable defined in exec(code) unreachable inside function call with visible name in dir() results

2016-04-22 Thread Eryk Sun
Eryk Sun added the comment: In Python 2, using the exec statement makes the compiler disable fast locals: >>> def foo(): pass ... >>> def bar(): exec '' ... >>> foo.__code__.co_flags & inspect.CO_OPTIMIZED 1 >>>

[issue7980] time.strptime not thread safe

2016-04-22 Thread Eryk Sun
Eryk Sun added the comment: SilentGhost, msg263977 is spam copied from msg206393 to try to fool people into clicking on the link. I've marked all of these messages from editor-buzzfeed as spam. -- nosy: +eryksun ___ Python tracker

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

2016-04-27 Thread Eryk Sun
Eryk Sun added the comment: Generally the directory that an application needs for its configuration files and data is either the script directory or an %AppData% or %LocalAppData% subdirectory. If the initial working directory matters for some reason (e.g. for writing output files), the

[issue26882] The Python process stops responding immediately after starting

2016-04-29 Thread Eryk Sun
Eryk Sun added the comment: python.dmp is from Windows 8.1 (NT 6.3): 0:000> ?? @$peb->OSMajorVersion; ?? @$peb->OSMinorVersion unsigned long 6 unsigned long 3 with the following command line and working directory: 0:000> ?? @$peb->ProcessParameters->Comm

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

2016-05-05 Thread Eryk Sun
Eryk Sun added the comment: The access control list of a file may not grant or may deny the current user the right to read file attributes (i.e. lstat). Generally you don't have to worry about granted access to parent directories when attempting to stat the file or directory, since

[issue22107] tempfile module misinterprets access denied error on Windows

2016-05-06 Thread Eryk Sun
Eryk Sun added the comment: The Windows API loses information when mapping kernel status values to Windows error codes. For example, the following status values are all mapped to ERROR_ACCESS_DENIED: STATUS_INVALID_LOCK_SEQUENCE 0xc01e STATUS_INVALID_VIEW_SIZE 0xc01f

[issue26708] Constify C string pointers in the posix module

2016-05-07 Thread Eryk Sun
Eryk Sun added the comment: I get the following warnings: ..\Modules\posixmodule.c(7422): warning C4090: 'function': different 'const' qualifiers [...] ..\Modules\posixmodule.c(7423): warning C4090: 'function': different 'const' qualifiers [...]

[issue26708] Constify C string pointers in the posix module

2016-05-07 Thread Eryk Sun
Eryk Sun added the comment: It looks good to me. There are no errors or warnings. -- ___ Python tracker <http://bugs.python.org/issue26708> ___ ___ Python-bug

[issue27083] PYTHONCASEOK is ignored on Windows

2016-05-21 Thread Eryk Sun
New submission from Eryk Sun: importlib ignores the PYTHONCASEOK environment variable on Windows. _relax_case checks for b'PYTHONCASEOK' in os.environ, which is never true because os.environ is Unicode. On Windows, _make_relax_case should return a function that instead

[issue27048] distutils._msvccompiler._get_vc_env() fails with UnicodeDecodeError if an env var is not encodable

2016-05-22 Thread Eryk Sun
Eryk Sun added the comment: When writing to a file or pipe, cmd's internal commands default to either the current codepage of the attached console or, for a detached process, the system locale codepage. It uses a best-fit encoding that tries to map characters to similar characters i

[issue27091] Python IDLE doesn't like 💙

2016-05-24 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> IDLE crashes when pasting non-BMP unicode char on Py3 ___ Python tracker <http://bugs.python

[issue23026] Winreg module doesn't support REG_QWORD, small DWORD doc update

2016-05-25 Thread Eryk Sun
Eryk Sun added the comment: In Py2Reg, `(*retDataBuf==NULL)` needs spaces around the == operator. Should the changes to the winreg docs be noted as new in 3.6? Bikeshedding: in "What's New" you mention the change to QueryValueEx, but Reg2Py and Py2Reg affect EnumValue, Qu

[issue27119] `compile` doesn't compile into an AST object as specified

2016-05-25 Thread Eryk Sun
Eryk Sun added the comment: What you're looking for is in the 2nd paragraph of the ast docs: An abstract syntax tree can be generated by passing ast.PyCF_ONLY_AST as a flag to the compile() built-in function, or using the parse() helper provided in this module. The result

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

2016-09-01 Thread Eryk Sun
Eryk Sun added the comment: This is a consequence of several factors. It starts with the __init__ method of ctypes.Array, Array_init. This function doesn't hard-code calling the base sq_ass_item slot function, Array_ass_item. If it did, it wouldn't be nearly as slow. Instead it

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

2016-09-01 Thread Eryk Sun
Changes by Eryk Sun : -- versions: +Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue27926> ___ ___ Python-bugs-list mailin

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: Probably Python 2's UTF-16 decoder should be as broken as the encoder, which will match the broken behavior of the UTF-8 and UTF-32 codecs: >>> u'\ud83d\uda12'.encode('utf-8').decode('utf-8') u'\ud83d\uda12&#x

[issue27962] null poiter dereference in set_conversion_mode due uncheck _ctypes_conversion_encoding

2016-09-06 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> null poiter dereference in set_conversion_mode due uncheck _ctypes_conversion_errors ___ Python tracker <http://bugs.python

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: Victor, it seems the only option here (other than closing this as won't fix) is to modify the UTF-16 decoder in 2.7 to allow lone surrogates, which would be consistent with the UTF-8 and UTF-32 decoders. While it's too late to enforce strict compliance

[issue27980] Add better pythonw support to py launcher

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: py.exe is a console application. There's no point in using it to run pythonw.exe. Use pyw.exe, as Zachary suggests. Or better yet, just run `MyGuiApp.pyw %*`. Unless you've reconfigured the .pyw file association, it should run via pyw.exe. -

[issue27980] Add better pythonw support to py launcher

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: > Naturally pyw -h produces no output It needs help: `pyw -h 2>&1 | more`. This sets the StandardOutput and StandardError as the write end of a pipe. more.com reads from the pipe and pages the help text to the console. Maybe this needs a new issue to ha

[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: Why do you need to call getpreferredencoding()? Isn't that already the default if you call TextIOWrapper with encoding as None? For example: text_mode = encoding or errors or universal_newlines self.stdin = io.open(p2cwrite, 'wb', bufsize)

[issue27984] singledispatch register should typecheck its argument

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: The register() method should raise a TypeError if it's called with an object that's not a type. Consider the following: from functools import singledispatch class C: pass obj = C() @singledispatch def foo(x):

[issue27998] Add support of bytes paths in os.scandir()

2016-09-07 Thread Eryk Sun
Eryk Sun added the comment: This is implemented in Steve's latest patch in issue 27781. For example: >>> sys.platform 'win32' >>> os.mkdir('test') >>> f = open('test/\U0001.txt', 'w') >>> n

[issue28011] winreg KEY_READ also fails for some keys

2016-09-07 Thread Eryk Sun
Eryk Sun added the comment: It's not a bug that you can't read those keys. The DACL (discretionary access control list) of those two keys doesn't grant any access to standard users. However, administrators do have full control, in case your account is a UAC restricted admin wit

[issue1602] windows console doesn't print or input Unicode

2016-09-09 Thread Eryk Sun
Eryk Sun added the comment: Martin, the console should be in line-input mode, in which case ReadConsole will block if there isn't at least one line in the input buffer. It reads up to the lesser of a complete line or the number of UTF-16 codes requested. If the previous call read the e

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-09 Thread Eryk Sun
Eryk Sun added the comment: Considering the UTF-16 codec isn't self-consistent, it's a stretch to say it's not a bug. It's misbehavior, and it either will be or won't be fixed. From Victor's response it's looking like the latter. -- ___

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-09 Thread Eryk Sun
Eryk Sun added the comment: I wasn't trying to put words in your mouth, Victor. I was replying to Terry (msg275406). -- ___ Python tracker <http://bugs.python.org/is

[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-10 Thread Eryk Sun
Eryk Sun added the comment: The leak is due the pointer-type cache that ctypes.POINTER uses. The type the pointer refers to is used as the key. In this case, VS_FIXEDFILEINFO is created each time win32_ver is called, so the pointer-type cache grows without bound. Example leak: >>&g

[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-11 Thread Eryk Sun
Eryk Sun added the comment: Limiting the pointer-type cache could be a problem. It's expected that POINTER() returns a reference to an existing pointer type. ctypes uses Python types to ensure compatible C data types. For example: LP_c_int = ctypes.POINTER(ctypes.c_int)

[issue28075] os.stat fails when access is denied

2016-09-11 Thread Eryk Sun
Eryk Sun added the comment: Python 3's os.stat tries to open a handle for the file or directory in order to call GetFileInformationByHandle. Opening a file handle via CreateFile requests at least FILE_READ_ATTRIBUTES and SYNCHRONIZE access when it calls NtCreateFile. If access is d

[issue28075] os.stat fails when access is denied

2016-09-11 Thread Eryk Sun
Eryk Sun added the comment: I overlooked attempting to open a paging-file for any access, which is hard coded as a sharing violation. The attached patch checks for both cases. -- keywords: +patch Added file: http://bugs.python.org/file44554/issue_28075_01.patch

[issue28075] os.stat fails when access is denied

2016-09-11 Thread Eryk Sun
Changes by Eryk Sun : -- stage: -> patch review ___ Python tracker <http://bugs.python.org/issue28075> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue27827] pathlib is_reserved fails for some reserved paths on Windows

2016-09-11 Thread Eryk Sun
Eryk Sun added the comment: The attached patch adds tests and the suggested enhancement to _WindowsFlavour.is_reserved. Shouldn't it also return True if the name contains ASCII control characters? They're only valid in NTFS stream names. Also, I think a name containing a colon

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

2016-09-12 Thread Eryk Sun
Eryk Sun added the comment: > It might be worth testing a patch that changes expanduser to > decode the environment variables If expanduser() is passed a unicode path, it can use _winreg.ExpandEvironmentStrings(u'%USERPROFILE%') instead of decoding os.environ['

[issue28113] Remove Py_CreateSymbolicLinkW

2016-09-12 Thread Eryk Sun
New submission from Eryk Sun: In 3.6, the Windows implementation of os.symlink can be simplified to directly call CreateSymbolicLinkW, since this function was added in Windows Vista. The support code for Py_CreateSymbolicLinkW can be removed from Modules/posixmodule.c. enable_symlink can also

[issue28113] Remove Py_CreateSymbolicLinkW

2016-09-12 Thread Eryk Sun
Eryk Sun added the comment: This patch also updates Win32SymlinkTests and Win32JunctionTests to use the user's %TEMP% directory instead of the source tree. It's much more likely that %TEMP% is on the system volume, which should be an NTFS volume that supports symbolic links and

[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread Eryk Sun
Eryk Sun added the comment: parse_envlist is calling PyUnicode_FromFormat with the format "%U=%U", but passing it bytes: |Debug Error! Program: C:\Program Files\Python36\python_d.exe abort() has been called (Press Retry to debug the application) (1e8.3

[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread Eryk Sun
Eryk Sun added the comment: Here's a snippet to reproduce this bug: import os, sys environb = {os.fsencode(k):os.fsencode(v) for k,v in os.environ.items()} os.spawnve(os.P_WAIT, sys.executable, ('python', '--version'), environb) (Now that Windows Python pro

[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun
Eryk Sun added the comment: Berker, this is basically what I had in my initial patch on the Unix side. I also addressed the Windows issues in parse_envlist and fsconvert_strdup. I'm uploading that patch for reference. It needs a test. I also need to verify that there are no addit

[issue28142] windows installer not adding PYTHONHOME

2016-09-14 Thread Eryk Sun
Eryk Sun added the comment: PYTHONHOME should only be set temporarily for special cases. If running python.exe without PYTHONHOME fails to find the standard library, then your system is misconfigured. For additional help with this problem, ask on either python-list or python-win32

[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun
Eryk Sun added the comment: Thanks for the spawn test framework, Victor. I've added a use_bytes argument to encode the args and env using os.fsencode. It's encoding args as well because parse_arglist calls fsconvert_strdup, which was assuming Unicode strings on Windows instea

[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun
Changes by Eryk Sun : Added file: http://bugs.python.org/file44663/issue_28114_03.patch ___ Python tracker <http://bugs.python.org/issue28114> ___ ___ Python-bugs-list m

[issue28161] Opening CON for write access fails

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: When opening the CON device the underlying CreateFile call needs to use either GENERIC_READ or GENERIC_WRITE access, but not both. Currently opening for writing fails as follows: >>> open('CON', 'wb', buffering=0) Tra

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: For a console readall(), if the first line starts with '\x1a' (i.e. Ctrl+Z), it breaks out of its read loop before incrementing len. Thus the input isn't handled properly as EOF, for which the check requires len > 0. Instead it ends up calling W

[issue28163] WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: WindowsConsoleIO fileno() gets a file descriptor on demand by calling _open_osfhandle. As a low I/O function this expects _open flags, but currently the code is passing 'rb' (int 0x7262) and 'wb' (int 0x7762). It should use _O_RDONLY | _O_

[issue28164] _PyIO_get_console_type fails for various paths

2016-09-14 Thread Eryk Sun
New submission from Eryk Sun: _PyIO_get_console_type currently hard codes the names "CON", "CONIN$", and "CONOUT$" and doesn't use a case-insensitive comparison. For example, opening "conin$" doesn't get directed to WindowsConsoleIO: >

[issue28166] WindowsConsoleIO misbehavior when Ctrl+C is ignored

2016-09-15 Thread Eryk Sun
New submission from Eryk Sun: _PyOS_WindowsConsoleReadline should continue to read when interrupted by Ctrl+C if SIGINT is ignored or the handler doesn't raise an exception. Currently it breaks out of the read loop, which looks like an EOF: >>> import signal >

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-15 Thread Eryk Sun
New submission from Eryk Sun: On Unix, waiting on an instance of subprocess.Popen in the main thread is interruptible by Ctrl+C. On Windows, it currently calls _winapi.WaitForSingleObject, which isn't interruptible. It should instead call _winapi.WaitForMultipleObjects, which automati

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-15 Thread Eryk Sun
Eryk Sun added the comment: This patch makes the trivial change to the Popen.wait() method and also modifies _winapi.WaitForMultipleObjects to restart the wait if SIGINT is ignored or the handler didn't raise an exception. -- keywords: +patch stage: needs patch -> patch revi

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-15 Thread Eryk Sun
Changes by Eryk Sun : Added file: http://bugs.python.org/file44674/issue_28168_02.patch ___ Python tracker <http://bugs.python.org/issue28168> ___ ___ Python-bugs-list m

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun
Changes by Eryk Sun : Removed file: http://bugs.python.org/file44674/issue_28168_02.patch ___ Python tracker <http://bugs.python.org/issue28168> ___ ___ Python-bugs-list m

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun
Changes by Eryk Sun : Added file: http://bugs.python.org/file44698/issue_28168_03.patch ___ Python tracker <http://bugs.python.org/issue28168> ___ ___ Python-bugs-list m

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun
Changes by Eryk Sun : Removed file: http://bugs.python.org/file44673/issue_28168_01.patch ___ Python tracker <http://bugs.python.org/issue28168> ___ ___ Python-bugs-list m

[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun
Eryk Sun added the comment: Hopefully this is my last change until someone reviews this. I decided to make it an error to pass an empty sequence, which previously would implicitly wait on the SIGINT event. This way simplifies the code and prevents someone from accidentally waiting forever on

[issue28188] os.putenv should support bytes arguments on Windows

2016-09-17 Thread Eryk Sun
New submission from Eryk Sun: This suggestion may be controversial: os.putenv should decode bytes arguments as UTF-8, the new Windows filesystem encoding. Moreover, os.environb should also be implemented. This would be consistent with bytes support in os.spawnve and os.execve. The

[issue28188] os.putenv should support bytes arguments on Windows

2016-09-17 Thread Eryk Sun
Changes by Eryk Sun : -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file44714/issue_28188_01.patch ___ Python tracker <http://bugs.python.org/issu

[issue28164] _PyIO_get_console_type fails for various paths

2016-09-17 Thread Eryk Sun
Eryk Sun added the comment: > check that a handle is actually a real console handle or > what type it is Did you mean a path here? Certainly you can check a handle, but that means opening the path twice. You can use GetFullPathName to classify the path, and then use GetFullPathName

[issue28217] Add interactive console tests

2016-09-20 Thread Eryk Sun
Eryk Sun added the comment: Here's the ctypes code (mentioned on issue 1602) for writing to the input buffer and reading from the screen buffer. For output testing I also have a context manager to create and temporarily activate a new screen buffer with a given number of columns and row

[issue28217] Add interactive console tests

2016-09-20 Thread Eryk Sun
Changes by Eryk Sun : Added file: http://bugs.python.org/file44765/conout.py ___ Python tracker <http://bugs.python.org/issue28217> ___ ___ Python-bugs-list mailin

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-20 Thread Eryk Sun
Eryk Sun added the comment: For breaking out of the readall while loop, you only need to check if the current read is empty: /* when the read is empty we break */ if (n == 0) break; Also, the logic is wrong here: if (len == 0 || buf[0] == '\x1a'

[issue28246] Unable to read simple text file

2016-09-22 Thread Eryk Sun
Eryk Sun added the comment: The default encoding on your system is Windows codepage 1251. However, your file is encoded using UTF-8: >>> lines = open('ResourceStrings.rc', 'rb').read().splitlines() >>> print(*lines, sep='\n') b&#

[issue28246] Unable to read simple text file

2016-09-22 Thread Eryk Sun
Eryk Sun added the comment: Codepage 1251 is a single-byte encoding and a superset of ASCII (i.e. ordinals 0-127). UTF-8 is also a superset of ASCII, so there's no problem as long as the encoded text is strictly ASCII. But decoding non-ASCII UTF-8 as codepage 1251 produces nonsense, othe

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Eryk Sun
Eryk Sun added the comment: Specifically, while CreateProcess does execute batch scripts via the %ComSpec% interpreter, the only extension it infers is ".exe". To run a ".cmd" or ".bat" file, you have to use the full name with the extensi

[issue21903] ctypes documentation MessageBoxA example produces error

2016-09-28 Thread Eryk Sun
Eryk Sun added the comment: The GetWindowRect example seems fine, for the most part. The docs don't have to show it being called. If I were to call it, I'd use GetForegroundWindow to get a window handle. GetActiveWindow returns the active window attached to the current thread'

[issue28345] 8/3 is calculated incorrectly

2016-10-03 Thread Eryk Sun
Eryk Sun added the comment: A CPython float uses the platform's double-precision floating point. The significand of a double has 53 bits of precision, which is 15 decimal digits of precision. However, uniquely representing a double in decimal requires 17 digits, which is why the str and

[issue28344] Python 3.5.2 hangs when running in session 0

2016-10-03 Thread Eryk Sun
Eryk Sun added the comment: Are you running python.exe without a script or command? That runs the REPL in session 0, which will block reading from stdin. It's harmless to kill this process. The REPL could detect that it's running in session 0 and exit. However, I'm not in

[issue28344] Python 3.5.2 installer hangs when run in session 0

2016-10-03 Thread Eryk Sun
Eryk Sun added the comment: For some reason you're trying to schedule the installer to run in session 0. I thought you were running python.exe in session 0 via the task scheduler, which would hang in the REPL [1]. [1]: https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print

[issue28259] Ctypes bug windows

2016-10-03 Thread Eryk Sun
Eryk Sun added the comment: Since this is 32-bit, are you using CDLL (cdecl) or WinDLL (stdcall)? Either way, I made a simple test for the given function prototype, and it worked fine in 32-bit 3.5.2 on Windows 10 for both calling conventions. You'll have to provide a minimal example

[issue28259] Ctypes bug windows

2016-10-03 Thread Eryk Sun
Eryk Sun added the comment: If you want a resolution to this issue, then you need to provide a minimal example that reproduces the problem. It would also be helpful if you could provide a download link for the library that you're wrapping. If not, at least upload a dump file, preferably

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

2016-10-04 Thread Eryk Sun
Eryk Sun added the comment: 3.3 added os.replace, which on Windows entailed a switch from calling MoveFile to MoveFileEx in order to specify the MOVEFILE_REPLACE_EXISTING flag. However, not passing the MOVEFILE_COPY_ALLOWED broke compatibility with os.rename on Windows for versions prior to

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

2016-10-04 Thread Eryk Sun
Eryk Sun added the comment: In scanning over issue 8828, I see no discussion of the consequences of not using MOVEFILE_COPY_ALLOWED in Antoine's patch, so it appears that this behavior change was unintentional. > For now I switched to shutil.move() but I suppose its not > as

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

2016-10-05 Thread Eryk Sun
Eryk Sun added the comment: In 2.7, the _handle attribute is a _subprocess_handle object, which automatically calls CloseHandle when deallocated. For example: >>> p = subprocess.Popen('python -c "import time; time.sleep(120)"') CreateProcess returns both the

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

2016-10-06 Thread Eryk Sun
Eryk Sun added the comment: Switching to ReadConsoleW in 3.6+ solves the problem with not seeing ERROR_OPERATION_ABORTED in Windows 8+, and with proper handling this potentially solves issues with Ctrl+C handling (when I last checked there were still bugs with this in the 3.6 beta). However

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Eryk Sun
Eryk Sun added the comment: When I pointed this issue out in code reviews, I assumed you would add the relatively simple fix to decode the prompt and call WriteConsoleW. The long-term fix in issue 17620 has to be worked out with cross-platform support, and ISTM that it can wait for 3.7. Off

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Eryk Sun
Eryk Sun added the comment: I'm sure Steve already has this covered, but FWIW here's a patch to call WriteConsoleW. Here's the result with the patch applied: >>> sys.ps1 = '»»» ' »»» input("αβψδ: ") αβψδ: spam 'spam' and wi

[issue27998] Bytes paths now are supported in os.scandir() on Windows

2016-10-08 Thread Eryk Sun
Eryk Sun added the comment: Here's an alternative patch, using PyUnicode_FSDecoder. It also adds path_object_error and path_object_error2 helper functions. -- Added file: http://bugs.python.org/file45017/issue_27998_01.patch ___ Python tr

[issue27998] Bytes paths now are supported in os.scandir() on Windows

2016-10-08 Thread Eryk Sun
Eryk Sun added the comment: With the patch I uploaded, test_glob and test_os BytesWalkTests both pass, in both Windows 10 and Linux. Without it those tests fail for me in Windows 10. -- ___ Python tracker <http://bugs.python.org/issue27

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-13 Thread Eryk Sun
Eryk Sun added the comment: MultibyteToWideChar includes the trailing NUL when it gets the string length, so the WriteConsoleW call needs to use (wlen - 1). -- ___ Python tracker <http://bugs.python.org/issue28

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

2016-10-17 Thread Eryk Sun
Eryk Sun added the comment: Due to a race condition, the Popen call in the second process is inadvertently inheriting the handle for the write end of the pipe that's created for the first process. Thus stdout.readline() in the first thread doesn't see EOF until that handle is clo

[issue28467] Installer should be a 64-bit executable

2016-10-18 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden versions: +Python 3.7 ___ Python tracker <http://bugs.python.org/issue28

[issue28481] Weird string comparison bug

2016-10-19 Thread Eryk Sun
Eryk Sun added the comment: Interning of strings is an implementation detail for the efficient storage of variable and attribute names. A string with ':' in it cannot be a variable or attribute name and thus is not interned. But you don't need to know which strings are interned

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

2016-10-20 Thread Eryk Sun
Eryk Sun added the comment: Kelvin is calling WlanScan [1], which returns an error code that apparently can include HRESULT (signed) values cast as DWORD (unsigned) values, including 0x80342002 (ERROR_NDIS_DOT11_POWER_STATE_INVALID). ctypes.FormatError calls FormatMessage [2] with the flag

[issue28490] inappropriate OS.Error "Invalid cross-device link"

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

[issue28505] pip installation issues with default path on Windows

2016-10-22 Thread Eryk Sun
Eryk Sun added the comment: Issues with pip should be reported to its GitHub site. But installing to the "Program Files" directory certainly isn't a problem for pip. You need to run it with administrator rights. -- nosy: +eryksun resolution: -> not a bug stage:

[issue28514] Python (IDLE?) freezes on file save on Windows

2016-10-24 Thread Eryk Sun
Eryk Sun added the comment: > Windows 7 is very old. 3.8 will probably be the last Python version to support Windows 7 (2020-01 EOL). 3.6 is the last to support Vista. -- nosy: +eryksun ___ Python tracker <http://bugs.python.org/issu

[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-25 Thread Eryk Sun
Eryk Sun added the comment: os.DirEntry exists in 3.6, but the change wasn't backported to 3.5. See issue 27038. As a workaround, you can scan a non-empty directory to get a reference to the DirEntry type, e.g.: import os import tempfile with tempfile.NamedTemporaryFile()

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Eryk Sun
Eryk Sun added the comment: I forgot to include the link to the python-list thread where this came up: https://mail.python.org/pipermail/python-list/2016-October/715428.html -- ___ Python tracker <http://bugs.python.org/issue28

[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Eryk Sun
Eryk Sun added the comment: I installed "WinPython-64bit-3.6.0.0Zerorc2.exe" on Windows 10. As you can see below, the included version of IDLEX depends on idlelib implementation details that have changed between 3.5 and 3.6: C:\WinPython36\python-3.6.0b2.amd64>.\python P

[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-26 Thread Eryk Sun
Eryk Sun added the comment: You may have uncovered a bug in Python that's causing the invalid parameter handler to be invoked. It would help if you uploaded the zipped dump file for the crashed process. The status code you're getting (i.e. STATUS_STACK_BUFFER_OVERRUN, 0xC409)

[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-28 Thread Eryk Sun
Eryk Sun added the comment: > ignore PYTHONPATH and the current working directory Generally it's the script directory that isolated mode removes from sys.path. It's the working directory when there is no script. -- ___ Python t

[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-31 Thread Eryk Sun
Eryk Sun added the comment: To clarify, DirEntry is only exposed in the posix/nt and os modules starting in 3.6. To get a reference to it in 3.5 you have to fall back on something like the following: import os try: from os import DirEntry except ImportError

[issue28592] Installation freezes on C Runtime Install

2016-11-02 Thread Eryk Sun
Eryk Sun added the comment: Supported versions of Windows Vista and later should have the CRT update [1] installed via Windows Update. (3.5.2 is bundled with the older KB2999226 update [2].) A Windows 7 system that I checked had this automatically installed last March. But maybe for some

<    16   17   18   19   20   21   22   >