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

2015-11-09 Thread eryksun
eryksun added the comment: Steve, do you think it's OK to abandon localization for exception messages? If so, should we be using English for all FormatMessage calls? It's a bit ugly that Python's exceptions and the CRT error messages are in English, but then whenever we call FormatMessage

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

2015-11-08 Thread eryksun
eryksun added the comment: The "DLL load failed" message is from Python, but the rest is the text for the Windows error code, ERROR_BAD_EXE_FORMAT (0x00c1) [1]. The "%1" in the string can be expanded as the first element of the Arguments array parameter of FormatMessag

[issue25565] subprocess.Popen creates inheritable file descriptors on Windows, can leak to other child processes

2015-11-06 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows: subprocess.Popen: race condition for leaking inheritable handles ___ Python tracker <r

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-11-02 Thread eryksun
eryksun added the comment: > As for the suggestion to install SP1 1... As for the manual > installation I am not sure which file to download from It's one of these three, depending on your system architecture: windows6.1-KB976932-X86.exe - This application installs Sp1 to a

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-29 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: Added file: http://bugs.python.org/file40890/ctypes_from_buffer_2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue24765] Move .idlerc to %APPDATA%\IDLE on Windows

2015-10-29 Thread eryksun
eryksun added the comment: On Windows, how about creating a junction (_winapi.CreateJunction in 3.5, or the shell's mklink /j) from ~\.idlerc to %APPDATA%\idle? If ~\.idlerc already exists, it could be moved to %APPDATA%\idle before creating the junction. New code would directly use %APPDATA

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- keywords: +patch Added file: http://bugs.python.org/file40884/ctypes_from_buffer_1.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: Added file: http://bugs.python.org/file40883/ctypes_crash.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: Removed file: http://bugs.python.org/file40884/ctypes_from_buffer_1.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-27 Thread eryksun
eryksun added the comment: In subprocess.py there's the following code that builds a sequence of potential paths for the executable [1]: executable = os.fsencode(executable) if os.path.dirname(executable): executable_list = (executable,) else: # This matches

[issue25492] subprocess with redirection fails after FreeConsole

2015-10-27 Thread eryksun
eryksun added the comment: For me, fails() lives up to its name in Windows 7, but it doesn't fail in Windows 10. It shouldn't fail in Windows 8, either. In Windows 8+ the console interface is implemented using a kernel device. Console handles reference virtual files on the ConDrv device

[issue25492] subprocess with redirection fails after FreeConsole

2015-10-27 Thread eryksun
eryksun added the comment: I forgot to first check whether p2cread is None: ERROR_INVALID_HANDLE = 0x0006 if stdin is None: p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE) if p2cread is not None: try: os.get_handle_inheritable

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-26 Thread eryksun
eryksun added the comment: I meant that you need a check in buffered_close such as the following: if (res == NULL) { if (PyErr_ExceptionMatches(PyExc_BlockingIOError)) goto end; PyErr_Fetch(, , ); } else Py_DECREF(res); For 2.7 you could create

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-26 Thread eryksun
eryksun added the comment: Per issue 16597, when an exception occurs in flush(), the file is closed anyway. You'd have to check the exception and only skip to the end for EWOULDBLOCK or EAGAIN. That way you're not introducing a regression for ENOSPC and other exceptions for which retrying

[issue25356] Idle (Python 3.4 on Ubuntu) does not allow typing accents

2015-10-26 Thread eryksun
eryksun added the comment: This seems to be a problem with Tk 8.6 when using an international keyboard layout on Linux. I ran the following test.tcl script via wish: text .t pack .t Initially dead keys work, but they stop working if I switch away from the text entry to another window

[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-25 Thread eryksun
eryksun added the comment: Steve, I think you're right that it's simpler and more reliable to add a command-line option that sets IDLE's working directory to the current user's home directory. Terry, the default behavior in Linux, at least in Ubuntu, is to start IDLE with the working

[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-21 Thread eryksun
eryksun added the comment: > 'Start in:' is blank and for what ever reason, the default is ...system32. When the "Start in" field of a .lnk shortcut is blank, the child process inherits the working directory of the parent process (i.e. the process that runs the shortcut), unle

[issue25448] Exception ABC doesn't work in Python 3 (but does in Python 2.7)

2015-10-20 Thread eryksun
eryksun added the comment: In Python 2, PyErr_GivenExceptionMatches [1] calls PyObject_IsSubclass. To handle calling __subclasscheck__ in this case, 2.7 (but not 2.6) temporarily increases the recursion limit by 5. For example: class CMeta(type): def __subclasscheck__(self, other

[issue25448] Exception ABC doesn't work in Python 3 (but does in Python 2.7)

2015-10-20 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Catching virtual subclasses in except clauses ___ Python tracker <rep...@bugs.python.org>

[issue25432] isinstance documentation doesn't explain what happens when type is tuple

2015-10-17 Thread eryksun
eryksun added the comment: Since Python has multiple inheritance, it could be misconstrued as a conjunctive test. For example, if c is an instance of C, which subclasses both A and B, then someone might think isinstance(c, (A, B)) requires c to be an instance of both A and B. The description

[issue25405] User install of 3.5 removes py.exe from C:\Windows

2015-10-16 Thread eryksun
eryksun added the comment: Setting a new default for py.exe doesn't require admin privileges. You can use the PY_PYTHON environment variable: C:\>py --version Python 2.7.10 C:\>set PY_PYTHON=3 C:\>py --version Python 3.5.0 which you can easily persist in the

[issue25386] msvcrt_putch/msvcrt_putwch don't check the return value of _putch/_putwch

2015-10-13 Thread eryksun
eryksun added the comment: > It would be interesting to know under what circumstances these > functions can fail. The CRT _put[w]ch and _get[w]ch[e] functions will fail when called in a process that doesn't have a console. (Except get[w]ch may succeed if it follows unge

[issue25361] Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this?

2015-10-10 Thread eryksun
eryksun added the comment: > Windows requires SSE these days, since Vista IIRC, so the problem > is probably someone on XP. Windows 8 is the first to require SSE2 [1][2]. I'm sure it's no coincidence that this became the default in VS 2012. There is probably a small minority of

[issue25361] Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this?

2015-10-10 Thread eryksun
eryksun added the comment: Sorry, I forgot to include the link to readme.txt: [2]: https://hg.python.org/cpython/file/v3.5.0/PCbuild/readme.txt -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25361] Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this?

2015-10-10 Thread eryksun
eryksun added the comment: Building Python 3.5 requires Visual Studio 2015 and Windows 8.1, so this would be a vanishingly small audience that's building to deploy on old 32-bit Windows 7 machines. I don't think the PSF needs to worry about this. Anyway, the "/arch (x86)" docs [1] e

[issue25361] Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this?

2015-10-10 Thread eryksun
eryksun added the comment: With Visual Studio 2010 and earlier, SSE support had to be explicitly enabled. Starting with VS2012 it's on by default [1]: Because the x86 compiler generates code that uses SSE2 instructions by default, you must specify /arch:IA32 to disable generation

[issue25360] pyw should search for pythonw to implement #!/usr/bin/env python

2015-10-09 Thread eryksun
New submission from eryksun: The Windows launcher searches PATH to implement the shebang "#!/usr/bin/env". Given "#!/usr/bin/env python", it always searches for L"python" (see issue 17903), even in pyw.exe. maybe_handle_shebang in PC/launcher.c should instead us

[issue25360] pyw should search for pythonw to implement #!/usr/bin/env python

2015-10-09 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- nosy: +vinay.sajip ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25360> ___ __

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-08 Thread eryksun
eryksun added the comment: > it does not generates any .evtx file Start a command prompt; change to the directory that has the MSU, and run it with the option "/log:kb2999226.evtx". For me this creates kb2999226.evtx in the current directory, which can be converted to XML u

[issue25345] Unable to install Python 3.5 on Windows 10

2015-10-08 Thread eryksun
eryksun added the comment: Please attach "Python 3.5.0 (32-bit)_*_core_JustForMe.log", if it exists. According to the log, initially the installer can't create a restore point because, I assume, you have the volume shadow copy (VSS) service disabled, i.e. the

[issue25327] Python 3.5 Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: Removed file: http://bugs.python.org/file40706/Python 3.5.0 (64-bit)_20151006150920.log ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread eryksun
eryksun added the comment: Yes, if you explicitly use big-ending or little-endian UTF, then you need to manually include a BOM if that's required. That said, if a file format or data field is specified with a particular byte order, then using a BOM is strictly incorrect. See the UTF BOM FAQ

[issue25327] Python 3.5 Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25323] Bus error: 10 when executing recursive program

2015-10-06 Thread eryksun
eryksun added the comment: I don't know about OS X, but in 64-bit Linux I can increase the recursion limit to 10 if I allow the main thread to grow to 64 MiB by setting the RLIMIT_STACK soft limit. For example: soft, hard = resource.getrlimit(resource.RLIMIT_STACK) soft = max(soft

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread eryksun
eryksun added the comment: Error code WU_E_NOT_APPLICABLE (0x80240017) just tells us that "there are no applicable updates". Perhaps the Windows Update log has more information. Shirshendu, try directly installing the [Universal CRT update][1] from the command prompt. Run it wit

[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread eryksun
eryksun added the comment: My suggestion is only for 3.5 / 3.6, because Windows XP is no longer supported. Starting with Windows Vista, both cmd.exe and CreateProcess support this behavior. I realize that disabling searching the current director by default is going beyond what cmd.exe does

[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread eryksun
eryksun added the comment: Please don't default to searching the current directory: if is_windows: # The current directory takes precedence on Windows. if not os.curdir in path: path.insert(0, os.curdir) Add a keyword option to enable this, with a warning

[issue22080] Add windows_helper module helper

2015-10-02 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden versions: +Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25273] Console interpreter holds a hard link on last displayed object

2015-09-29 Thread eryksun
eryksun added the comment: In interactive mode the extra reference is held by the "_" built-in variable. >>> a 'test string A' >>> del __builtin__._; sys.getrefcount(a) - 1 1 Look at the following disassembled code, compiled in the 'single' interac

[issue25125] "Edit with IDLE" does not work for shortcuts

2015-09-28 Thread eryksun
eryksun added the comment: > I don't believe %1 is necessarily correct here either, but maybe > with %* it's redundant anyway %0, %1, or %L is lpFile. On older systems "%L" guarantees using the long filename, but this is pointless nowadays. %* (i.e. %2 through %9) is lpP

[issue25125] "Edit with IDLE" does not work for shortcuts

2015-09-28 Thread eryksun
eryksun added the comment: > Does notepad handle clicking "edit" on a shortcut to a batch file? > Maybe subcommands don't have exactly the same semantics as regular > verbs... In Windows 7 SP1 a regular verb works fine from a shortcut, but apparently not a subcommand. OTO

[issue23606] ctypes.util.find_library("c") no longer makes sense

2015-09-28 Thread eryksun
eryksun added the comment: > some code that uses it will need updating (due to API changes > since VC9/VC10) For example, I discovered that the stdio exports don't include printf, etc. Using __stdio_common_vfprintf to implement printf relies on calling __acrt_iob_func to get

[issue25241] ctypes: access violation reading

2015-09-26 Thread eryksun
eryksun added the comment: The default function pointer restype is c_int, and the default integer argument conversion is also c_int. However, the handle returned by FindFirstVolume is a pointer to a private structure that it uses for the volume enumeration, so you must set restype

[issue25241] ctypes: access violation reading

2015-09-26 Thread eryksun
eryksun added the comment: Here's a rewrite with a cleaner while loop, at least to me: def list_volumes(): vname = ctypes.create_unicode_buffer(wintypes.MAX_PATH) vhandle = kernel32.FindFirstVolumeW(vname, len(vname)) if vhandle == INVALID_HANDLE_VALUE

[issue25125] "Edit with IDLE" does not work for shortcuts

2015-09-26 Thread eryksun
eryksun added the comment: > Ah, I misread that part. Will have to look deeper, but I'm not > actually sure that shortcuts are supposed to support the same > operations (though if it shows up, I guess it should work). A LNK shortcut should support the same commands (e.g. open, edi

[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-25 Thread eryksun
eryksun added the comment: > Dependency Walker doesn't know how to resolve those DLLs on > any platform - Win10 looks exactly the same. On older systems the api-ms-win-crt-* DLLs should be physically installed in System32, so Dependency Walker should find them if they exist. For e

[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-25 Thread eryksun
eryksun added the comment: > this update doesn't apply to you system Was that Windows6.0-KB2999226-x86.msu? Open a command prompt and enter the following: wmic os get Version, OSArchitecture Windows Vista SP 2 is version 6.0.6002, and the OS architecture should be 32-

[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread eryksun
eryksun added the comment: Try directly installing the Universal CRT update, [Windows6.0-KB2999226-x86.msu][1]. Run it with the /log option, e.g. Windows6.0-KB2999226-x86.msu /log:kb2999226.evtx You can view this log in the Windows event viewer, or convert it to text XML on the command

[issue4918] Windows installer created with Python X.Y does not work with Python X.Y+1

2015-09-24 Thread eryksun
eryksun added the comment: There haven't been any fundamental changes to bdist_wininst in years, and bdist_wheel has mostly replaced it nowadays. I'm fairly certain this issue was fixed by Mark Hammond's fix for issue 4566. Just to be certain, I updated the code to use print as a function

[issue21506] Windows MSI installer should mklink (symlink) python.exe to python2.7.exe

2015-09-24 Thread eryksun
eryksun added the comment: Creating a symbolic link can't be relied on for a per-user installation. Administrators have to elevate to create symbolic links, and most regular users also lack this privilege. -- ___ Python tracker <

[issue25205] setattr accepts invalid identifiers

2015-09-23 Thread eryksun
eryksun added the comment: Even MvL appears to slip up when he states "some may accept non-strings as attribute names". That would be pointless in a __setattr__ method since setattr / PyObject_SetAttr reject non-string values

[issue25164] Windows default installation path is inconsistent between per-user and system-wide installation

2015-09-23 Thread eryksun
eryksun added the comment: Also, why does the per-user install path have a seemingly pointless "Python" base directory? I expected it to install directly into FOLDERID_UserProgramFiles, to be consistent with installing to FOLDERID_ProgramFiles. Also, I doubt anyone cares, but t

[issue25213] Regression: Python 3.5.0 shutil.copy2 doesn't raise PermissionError on Windows 7

2015-09-22 Thread eryksun
eryksun added the comment: This issue doesn't pertain to the 64-bit version. C:\Temp>py -3.5 Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license

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

2015-09-22 Thread eryksun
eryksun added the comment: > import locale > locale.setlocale(locale.LC_ALL, '') > > import importlib > import time > importlib.reload(time) > > it does not work when imported after importing time. > What is the reason? Does reload() work only for > m

[issue25205] setattr accepts invalid identifiers

2015-09-22 Thread eryksun
eryksun added the comment: This is a documentation issue and not specific to a particular version of Python. What's the rule on version tagging in this case? -- components: +Documentation ___ Python tracker <rep...@bugs.python.org>

[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-22 Thread eryksun
eryksun added the comment: > The problem here is probably that installing the CRT update > required a restart I saw that, but it didn't make any sense to me that the DLL isn't available immediately after wusa.exe exits. Is it in limbo until the system is restarted? I know in Wind

[issue25166] Windows AllUsers installation places uninstaller in user profile

2015-09-22 Thread eryksun
eryksun added the comment: Where is the API documented to change the install scope dynamically? I see where it's apparently defined in the burn manifest (extracted from the executable) as PerMachine="no": http://schemas.microsoft.com/wix/2008/Burn;> <>

[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread eryksun
eryksun added the comment: Lauri changed the version from 3.4 to 3.2, and I was able to reproduce the problem in 3.2.5: C:\Temp>py -3.2 --version Python 3.2.5 C:\Temp>py -3.2 nospace.py removing fill.txt Traceback (most recent call last): File "nospace.

[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread eryksun
eryksun added the comment: See issue 16597. This wasn't fixed for 3.2, so it won't close the file if flush() fails. You'll either have to work around this or upgrade to 3.3+. -- nosy: +eryksun resolution: -> out of date stage: -> resolved status: open -&g

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

2015-09-21 Thread eryksun
eryksun added the comment: > local_encoding = locale.getdefaultlocale()[1] Use locale.getpreferredencoding(). > b = eval('b' + ascii(result)) > result = b.decode(local_encoding) It's simpler and more reliable to use 'latin-1' and 'mbcs' (ANSI). For example: result = result.enco

[issue25205] setattr accepts invalid identifiers

2015-09-21 Thread eryksun
eryksun added the comment: To clarify using a unicode name in 2.x, it has to be encodable using the default encoding, sys.getdefaultencoding(). Normally this is ASCII. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25205] setattr accepts invalid identifiers

2015-09-21 Thread eryksun
eryksun added the comment: The name can be any str/unicode string, including language keywords: >>> setattr(o, 'def', 'allowed') >>> getattr(o, 'def') 'allowed' >>> o.def File "", line 1 o.def ^ SyntaxError: inv

[issue25189] An issue about os.access

2015-09-20 Thread eryksun
eryksun added the comment: > This looks as a duplicate of issue2528. No, yangyanbo's problem is unrelated to the file's security descriptor, and it's not a bug. telnet.exe is manually installed via "Programs and Features", which only installs a 64-bit version into System32 (d

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

2015-09-19 Thread eryksun
eryksun added the comment: To decode the tzname strings, Python calls mbstowcs, which on Windows uses Latin-1 in the "C" locale. However, in this locale the tzname strings are actually encoded using the system ANSI codepage (e.g. 1250 for Central/Eastern Europe). So it ends up dec

[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-17 Thread eryksun
eryksun added the comment: Per "Python 3.5.0 (32-bit)_20150914055131.log", the installer detects the OS as NT 6.2.9200 (Windows 8/Server 2012), and installs Windows8-RT-KB2999226-x64.msu. [0A68:0EC8][2015-09-14T05:51:31]i001: Burn v3.10.0.1823, Windows v6.2 (

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread eryksun
eryksun added the comment: The issue as I understand it is that, on this particular Windows 8.1 system, passing a non-NULL lpEnvironment to CreateProcess works when starting a native 64-bit executable, but fails when starting a 32-bit executable via the WOW64 system. The child process instead

[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-16 Thread eryksun
eryksun added the comment: There should be a bunch of logs named "Python 3.5.0*.log" in your user's %TEMP% directory. If you don't mind, zip them up and attach the file to this issue for Steve Dower to review when he returns from vacation. In the mean time, try directly

[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-16 Thread eryksun
eryksun added the comment: > Pre-compiling should generally not be needed It's a useful optimization if Python is installed to a directory that doesn't grant write access to regular users, such as %ProgramFiles%. -- ___ Python tracker &

[issue25118] OSError in os.waitpid

2015-09-15 Thread eryksun
eryksun added the comment: This bug is due to issue 23285, which improved support for EINTR handling. os_waitpid_impl was changed to use the following do-while loop: do { Py_BEGIN_ALLOW_THREADS res = _cwait(, pid, options); Py_END_ALLOW_THREADS } while (res <

[issue25119] Windows installer fails to install VCRUNTIME140.DLL

2015-09-15 Thread eryksun
eryksun added the comment: virtualenv fails to copy vcruntime140.dll. Use the standard library's venv module instead. -- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <rep...@bug

[issue25120] No option displayed in the Python install on windows XP

2015-09-15 Thread eryksun
eryksun added the comment: Maybe the download page should direct XP users to install 3.4.x. -- nosy: +eryksun ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25107] Windows 32-bit: exe-files doesn't run

2015-09-14 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- components: +Windows -IDLE ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25107> ___ _

[issue25107] Windows 32-bit: exe-files doesn't run

2015-09-14 Thread eryksun
eryksun added the comment: The latest version that supports Windows XP is 3.4.3. -- components: +IDLE -Windows nosy: +eryksun ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25092] Regression: test_datetime fails on 3.5, Win 7, works on 3.4

2015-09-14 Thread eryksun
eryksun added the comment: > errno should always be cleared before use (in C99 at least, > not sure what the crt does). The CRT's strftime doesn't clear errno. I suggested clearing it in issue 25029, msg250215. -- nosy: +eryksun ___ Python t

[issue25051] 'compile' refuses BOM.

2015-09-10 Thread eryksun
eryksun added the comment: You're passing an already decoded string, so the BOM is treated as text. Instead open the file in binary mode, i.e. open("bom3.py", "rb"). This way the BOM will be detected when decoding the source bytes. Here's an example that passes the sour

[issue25023] time.strftime('%a'), ValueError: embedded null byte, in ko locale

2015-09-08 Thread eryksun
eryksun added the comment: It seems VC 14 has a bug here. In the new C runtime, strftime is implemented by calling wcsftime as follows: size_t const result = _Wcsftime_l(wstring.get(), maxsize, wformat.get(), timeptr, lc_time_arg, locale); if (result == 0) return 0

[issue25029] MemoryError in test_strptime

2015-09-08 Thread eryksun
eryksun added the comment: Steve, it seems to me that for MSVC the EINVAL test should come first: _Py_BEGIN_SUPPRESS_IPH olderr = errno; errno = 0; buflen = format_time(outbuf, i, fmt, ); err = errno; errno = olderr; _Py_END_SUPPRESS_IPH if (buflen == 0

[issue25027] Python 3.5.0rc3 on Windows can not load more than 127 C extension modules

2015-09-08 Thread eryksun
eryksun added the comment: I think 3.5 should be distributed with vcruntime140.dll. It seems a waste for python.exe, python35.dll, and all of the extension modules and dependent DLLs to each take an FLS slot: >>> import ctypes # +1 for _ctypes >>> kernel32 = ctype

[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread eryksun
eryksun added the comment: With MSVC, if errno is cleared before calling strftime, then when buflen == 0 you know whether it's an invalid format string (EINVAL) or maxsize is too small (ERANGE). There's no need to guess. Oddly, only EINVAL is documented, even though setting ERANGE has been

[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread eryksun
eryksun added the comment: > MSVC seems somewhat inconsistent about its response: > >>> strftime('aaa%') > '' That's not due to MSVC. It's setting errno to EINVAL. The problem is that time_strftime is testing (buflen > 0 || i >= 256 * fmtlen). The initial value of t

[issue24917] time_strftime() Buffer Over-read

2015-09-05 Thread eryksun
eryksun added the comment: > On Windows, the C lib strftime() segfaults with a trailing '%', > just as it does with unsupported format codes. No, it doesn't segfault; it invokes the invalid parameter handler (IPH). This could always be configured for the whole process, but with VC 14

[issue24917] time_strftime() Buffer Over-read

2015-09-05 Thread eryksun
eryksun added the comment: > Rather than debating about how various platforms handle malformed > format strings for strftime(), and whether or not they crash, we > should simply prevent the native strftime() function from seeing > them in the first place. Of course the

[issue25012] pathlib should allow converting to absolute paths without resolving symlinks

2015-09-05 Thread eryksun
eryksun added the comment: There's a public method that's almost what you want: >>> print(pathlib.Path.absolute.__doc__) Return an absolute version of this path. This function works even if the path doesn't point to anything. No normalization is done,

[issue24998] docs: subprocess.Popen example has extra/invalid parameter

2015-09-04 Thread eryksun
Changes by eryksun <eryk...@gmail.com>: -- keywords: +easy priority: normal -> low versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue24977] shutil copy to non-existant directory

2015-09-02 Thread eryksun
eryksun added the comment: Do you mean the dst path has a trailing slash, but the directory doesn't exist? shutil.copy doesn't check for a trailing slash, so it attempts to open dst as a regular file. On Linux, and probably most POSIX systems, this results in an EISDIR (is a directory) error

[issue24983] Wrong AttributeError propagation

2015-09-02 Thread eryksun
eryksun added the comment: > exception instance raised in __getattr__ should not lead > to its another call but propagated to outer level In this case the next outer level is your descriptor implementation. You have to ensure it doesn't leak the AttrubuteError. Otherwise the asso

[issue24971] os.environ.get() does not return the Environment Value in Linux

2015-08-31 Thread eryksun
eryksun added the comment: Did you mark the variable for export in your shell? For example: $ v=1 $ python -c 'import os;print os.environ.get("v")' None $ export v $ python -c 'import os;print os.environ.get("v")' 1 -

[issue24958] Segfault in REPL after pressing r and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread eryksun
eryksun added the comment: Maybe the problem is using escape characters (0x1b) instead of \e. Try using the following: \e[5~: history-search-backward FWIW, your inputrc doesn't crash my system (64-bit Linux, readline 6.3 and Python 3.4). -- nosy: +eryksun

[issue24958] Segfault in REPL after pressing r and PgUp twice (on Mageia Linux x86-64 6)

2015-08-29 Thread eryksun
eryksun added the comment: A gdb backtrace may be of more help than strace. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24958 ___ ___ Python

[issue24829] Use interactive input even if stdout is redirected

2015-08-28 Thread eryksun
eryksun added the comment: If you dropped the isatty() check for stdout in Linux, you may end up with the output of Readline in the file (assuming Readline is okay with this). The file would include all the cursor positioning codes, backspaces, etc, that Readline generates. But I haven’t

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-08-23 Thread eryksun
eryksun added the comment: The 3.5 build uses MSVC 14 (VS 2015): https://docs.python.org/3.5/using/windows.html#compiling-python-on-windows https://hg.python.org/cpython/file/3.5/PCbuild/readme.txt -- nosy: +eryksun ___ Python tracker rep

[issue24920] shutil.get_terminal_size throws AttributeError

2015-08-23 Thread eryksun
eryksun added the comment: FYI, the size of the terminal associated with the C's stdout isn't related to the IDLE shell. For example, in Linux when I run IDLE from the GUI, the associated terminal size is 0x0. On Windows, os.get_terminal_size uses the console API GetConsoleScreenBufferInfo

[issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'

2015-08-21 Thread eryksun
eryksun added the comment: It is not clear why the absence of _setmode(fd, os.O_BINARY) is not detected by tests. It's only a problem when an existing text-mode file descriptor is passed in. For example, in text mode the CRT handles b'\x1a' as an EOF marker: Python 3.5.0b4 (v3.5.0b4

[issue1384175] random module - Provider DLL failed to initialize correctly

2015-08-21 Thread eryksun
eryksun added the comment: I forgot to set errcheck: import ctypes userenv = ctypes.WinDLL('userenv', use_last_error=True) def errcheck_bool(result, func, args): if not result: raise ctypes.WinError(ctypes.get_last_error()) return args

[issue1384175] random module - Provider DLL failed to initialize correctly

2015-08-21 Thread eryksun
eryksun added the comment: Albert, this issue was opened for Python 2.4 and was closed over 6 years ago. Open a new issue if you believe there's a bug or room for improvement in a currently supported Python version. FYI, on Windows _PyOS_URandom first initializes the Crypto API by calling

[issue24908] sysconfig.py and distutils.sysconfig.py disagree on directory spelling on Windows

2015-08-21 Thread eryksun
eryksun added the comment: Within the standard library, I think only the site module uses the top-level sysconfig module, which IIRC it uses to set up sys.path. Note that WINDOWS_SCHEME in distutils.command.install uses Include. Also for virtual environments

[issue24901] (2, )!=(2) and (2, 3)==(2, 3, ) why ??? tested in each version

2015-08-20 Thread eryksun
eryksun added the comment: Refer to section 6.2.3, parenthesized forms: https://docs.python.org/3/reference/expressions.html#parenthesized-forms if the list contains at least one comma, it yields a tuple; otherwise, it yields the single expression that makes up the expression list

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

2015-08-18 Thread eryksun
eryksun added the comment: The patch for issue 23465 (PEP 486) updated the docs to explain the behavior of #!/usr/bin/env as follows: The /usr/bin/env form of shebang line has one further special property. Before looking for installed Python interpreters, this form will search

[issue24859] ctypes.Structure bit order is reversed - counts from right

2015-08-15 Thread eryksun
eryksun added the comment: No, ctypes.Structure should use native endianness. So on a little-endian it's the same as ctypes.LittleEndianStructure, and on a big-endian system it's the same as ctypes.BigEndianStructure. ARM processors can work in either mode. IIRC, the Raspberry Pi is built

[issue24859] ctypes.Structure bit order is reversed - counts from right

2015-08-15 Thread eryksun
eryksun added the comment: It seems you want a BigEndianStructure: from ctypes import * class SAEJ1939MsgId(BigEndianStructure): _fields_ = (('reserved', c_uint8, 3), ('priority', c_uint8, 3), ('extended_data_page

  1   2   3   >