[issue25631] Segmentation fault with invalid Unicode command-line arguments in embedded Python

2015-11-16 Thread Eryk Sun
Eryk Sun added the comment: The interpreter isn't initialized, so calling PyErr_Format in a release build segfaults when it tries to dereference a NULL PyThreadState. OTOH, a debug build should call PyThreadState_Get, which in this case calls Py_FatalError and aborts the process

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Eryk Sun
Eryk Sun added the comment: You have to subclass ctypes.Array with a _type_ and _length_. But ctypes types also implement sequence repetition (*) to facilitate creating array types. For example: import array, ctypes a1 = array.array('l') a1.fromlist(range(10)) c1

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-16 Thread Eryk Sun
Eryk Sun added the comment: As a workaround you can open a file descriptor via os.open: >>> import os >>> fd = os.open(r'\\.\PhysicalDrive0', os.O_RDONLY | os.O_BINARY) >>> os.read(fd, 512)[:8] b'3\xc0\x8e\xd0\xbc\x00|\x8e' > _Py_fstat result not

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun
Eryk Sun added the comment: Based on matplotlib's win32InstalledFonts function [1], I created a small test to check the data strings returned by winreg.EnumValue for the presence of null characters. I tested on Windows 7 and 10 but couldn't reproduce the problem. Please run nullcheck.py

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun
Eryk Sun added the comment: You should be able to run nullcheck.py in the command prompt by changing to the directory where it's saved and entering nullcheck.py. For example, if you saved it in your Downloads folder: >cd /d C:\Users\Anshul\Downloads >nullcheck.py If that

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun
Eryk Sun added the comment: I only wrote it for Python 3, but it would be interesting to see what you get with Python 2. Please try nullcheck2.py. -- Added file: http://bugs.python.org/file41213/nullcheck2.py ___ Python tracker <

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

2015-12-01 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: -- nosy: +benjamin.peterson, twouters ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Eryk Sun
Eryk Sun added the comment: REG_SZ and REG_EXPAND_SZ are documented as null-terminated strings [1], which shouldn't have an embedded null character. As such, the default result in the high-level environment of Python shouldn't have embedded nulls. However, since the buffer is sized, I think

[issue25794] __setattr__ does not always overload operators

2015-12-04 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: Removed file: http://bugs.python.org/file41235/issue25794_1.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25794] __setattr__ does not always overload operators

2015-12-04 Thread Eryk Sun
Eryk Sun added the comment: Normally Python code calls built-in setattr, which calls the C API PyObject_SetAttr. This API interns the attribute name before calling the type's tp_setattro or tp_setattr function. Interning the string is a critical step, since the implementation for updating

[issue25794] __setattr__ does not always overload operators

2015-12-04 Thread Eryk Sun
Eryk Sun added the comment: This updated patch calls PyUnicode_Check to ensure the name is a string before calling PyUnicode_InternInPlace. -- Added file: http://bugs.python.org/file41236/issue25794_2.patch ___ Python tracker <rep...@bugs.python.

[issue25789] py launcher stderr is not piped to subprocess.Popen.stderr

2015-12-04 Thread Eryk Sun
Eryk Sun added the comment: Patch 2 additionally modifies run_child to call exit() instead of ExitProcess. For example: >>> import os, subprocess >>> os.environ['PYLAUNCH_DEBUG'] = '1' >>> p = subprocess.Popen(r'py -3 -c ""', stderr=sub

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Eryk Sun
Eryk Sun added the comment: > add a QueryRawValue[Ex] function Or QueryValueEx and EnumValue could take a boolean argument named "raw" or "binary", which if True forces the data to be returned as REG_BINARY regardles

Re: Unicode failure

2015-12-05 Thread eryk sun
On Sat, Dec 5, 2015 at 12:10 AM, Chris Angelico wrote: > On Sat, Dec 5, 2015 at 5:06 PM, Terry Reedy wrote: >> On 12/4/2015 10:22 PM, Random832 wrote: >>> >>> On 2015-12-04, Terry Reedy wrote: Tk widgets, and hence IDLE windows,

[issue25803] pathlib.Path('/').mkdir() raises wrong error type

2015-12-05 Thread Eryk Sun
Eryk Sun added the comment: The mkdir method needs a fix similar to what was done for issue 25583. For example, currently on Windows the exist_ok option doesn't handle the PermissionError raised when [accidentally] trying to create the root directory: >>> pathlib.Path('C:

[issue25815] Improper subprocess output of arguments with braces in them on windows

2015-12-06 Thread Eryk Sun
Eryk Sun added the comment: Using the cmd shell's "echo" command requires shell=True. You must have an "echo.exe" somewhere in your PATH. Check "where echo" in cmd. -- nosy: +eryksun ___ Python tracker

[issue25815] Improper subprocess output of arguments with braces in them on windows

2015-12-06 Thread Eryk Sun
Eryk Sun added the comment: AFAICT, there's no place where subprocess.Popen would be responsible for removing braces from the output. I think it's something unusual with the "echo.exe" program. In the cmd.exe shell -- i.e. no msys, bash, etc -- what do you get for the following?

[issue25803] pathlib.Path('/').mkdir() raises wrong error type

2015-12-05 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: -- nosy: +pitrou versions: +Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue16458] subprocess.py throw "The handle is invalid" error on duplicating the STD_INPUT_HANDLE

2015-12-05 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess failing in GUI applications on Windows ___ Python tracker <rep...@bugs.python.org>

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

2015-12-05 Thread Eryk Sun
Eryk Sun added the comment: test_CTRL_C_EVENT can be removed from Lib/test/test_os.py. It's of no practical consequence. Ctrl+Break is always enabled in the child process, so test_CTRL_BREAK_EVENT should remain. When using CREATE_NEW_PROCESS_GROUP, the child process is started with Ctrl+C

[issue25492] subprocess with redirection fails after FreeConsole

2015-12-05 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess failing in GUI applications on Windows ___ Python tracker <rep...@bugs.python.org>

[issue13368] Possible problem in documentation of module subprocess, method send_signal

2015-12-04 Thread Eryk Sun
Eryk Sun added the comment: You can send CTRL_C_EVENT to a process group. But it requires the group leader to manually enable Ctrl+C handling. Initially it's disabled when creating a process with CREATE_NEW_PROCESS_GROUP. The attached script demonstrates sending CTRL_C_EVENT to a process

Re: Unicode failure

2015-12-05 Thread eryk sun
On Sat, Dec 5, 2015 at 4:03 PM, Terry Reedy wrote: > On 12/5/2015 2:44 PM, Random832 wrote: >> As someone else pointed out, I meant that as a list of codepages >> which support all Unicode codepoints, not a list of codepoints >> not supported by Tk's UCS-2. Sorry, I assumed

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Eryk Sun
Eryk Sun added the comment: > I don't like the idea of having a mismatch between what we set and > what we get, even if what we're setting technically shouldn't be > allowed. Currently if you set a string with null, you won't see it using either regedit.exe or reg.exe: >

[issue25772] Misleading descriptions about built-in `super.`

2015-12-01 Thread Eryk Sun
Eryk Sun added the comment: > Just FYI, 'super' is not a type No, super is a type: >>> super It's one of 3 types defined in Objects/typeobject.c: PyBaseObject_Type : "object" PyType_Type : "type" PySuper_Type : "super&qu

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread eryk sun
On Wed, Dec 2, 2015 at 3:28 AM, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 7:22 PM, Serhiy Storchaka wrote: >> >> I use vars() exclusively for introspection in interactive environment. As >> well as dir() and help(). Sad that it doesn't work with

[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun
Eryk Sun added the comment: Here's a patch for Python 3 that modifies the Reg2Py function in PC/winreg.c for the case of REG_SZ/REG_EXPAND_SZ. The existing code took a conservative approach by only removing a null character at the end of a buffer. I modified it to use wcsnlen instead. I

[issue25789] py launcher stderr is not piped to subprocess.Popen.stderr

2015-12-03 Thread Eryk Sun
Eryk Sun added the comment: The error() function in PC/launcher.c should call exit(rc) instead of ExitProcess(rc). This allows the CRT to terminate properly and flush the stderr FILE stream. With this change it works as expected: >>> import subprocess >>> p = subpro

[issue23948] Deprecate os.kill() on Windows

2015-12-09 Thread Eryk Sun
Eryk Sun added the comment: The signal module switched to using an enum for signal values: >>> print(*map(repr, sorted(signal.Signals)), sep='\n') We can use the console API when passed the CTRL_C_EVENT or CTRL_BREAK_EVENT enu

Re: cannot open file with non-ASCII filename

2015-12-16 Thread eryk sun
On Tue, Dec 15, 2015 at 11:04 AM, Ulli Horlacher wrote: > > Ehhh... I started Python programming some weeks ago and I know nearly > nothing about Windows. I am a UNIX and VMS guy :-) You should feel right at home, then. The Windows NT kernel was designed and

Re: cannot open file with non-ASCII filename

2015-12-14 Thread eryk sun
On Mon, Dec 14, 2015 at 4:17 PM, Ulli Horlacher wrote: > > ImportError: No module named pyreadline > > Is it a python 3.x module? > > I am limited to Python 2.7 pyreadline is available for 2.7-3.5 on PyPI. Anyway, I tried it to no avail. When dropping a file path

Re: cannot open file with non-ASCII filename

2015-12-14 Thread eryk sun
On Mon, Dec 14, 2015 at 6:07 PM, Laura Creighton wrote: > In a message of Mon, 14 Dec 2015 23:41:21 +0100, "Thomas 'PointedEars' Lahn" > wr > ites: > >>Why do you have to use msvcrt? >> >>I would use curses for user input, but: >>

Re: Problem on ctypes arguments in a DLL function

2015-12-18 Thread eryk sun
On Fri, Dec 18, 2015 at 2:41 AM, wrote: > ValueError: Procedure probably called with too many arguments (4 bytes in > excess The function's calling convention is x86 cdecl (CDLL, caller stack cleanup), but you're using the x86 stdcall convention (WinDLL, callee stack

Re: Should stdlib files contain 'narrow non breaking space' U+202F?

2015-12-18 Thread eryk sun
On Fri, Dec 18, 2015 at 3:51 AM, Steven D'Aprano wrote: > On Fri, 18 Dec 2015 11:02 am, Mark Lawrence wrote: > >> A lot of it is down to Windows, as the actual complaint is:- >> >> six.print_(source) > > Looks like a bug in six to me. > > See, without Unicode comments in

Re: cannot open file with non-ASCII filename

2015-12-14 Thread eryk sun
On Mon, Dec 14, 2015 at 10:24 AM, Ulli Horlacher wrote: > With Python 2.7.11 on Windows 7 my users cannot open/read files with > non-ASCII filenames. [...] > c = msvcrt.getch() This isn't an issue with Python per se, and the same problem exists in Python 3,

[issue25851] installing 3.5 on windows server 2003 x86 R2 Standard Edition Sp2 ENU,

2015-12-12 Thread Eryk Sun
Eryk Sun added the comment: It's the correct behavior. 3.5 supports all versions of Windows that had mainstream or extended support as of its release on 2015-09-13. Windows Server 2003 R2 extended support ended on 2015-07-14 [1]. [1]: https://support.microsoft.com/en-us/lifecycle/search?sort

Re: cannot open file with non-ASCII filename

2015-12-15 Thread eryk sun
On Tue, Dec 15, 2015 at 2:26 AM, Ulli Horlacher wrote: > Laura Creighton wrote: > >> PyPy wrote its own pyreadline. >> You can get it here. https://bitbucket.org/pypy/pyrepl > > As far as I can see, it has no getkey function. > My users do not hit

[issue26004] pip install lifetimes - throwing error and unable to install packages

2016-01-05 Thread Eryk Sun
Eryk Sun added the comment: You can build NumPy with only a C compiler, but it won't have accelerated BLAS/LAPACK. However, lifetimes requires SciPy, which in turn requires Fortran. This is a common requirement with a lot of the scientific-computing stack, so you may as well choose a complete

[issue21579] Python 3.4: tempfile.close attribute does not work

2015-12-30 Thread Eryk Sun
Eryk Sun added the comment: For anyone interested, this issue is solvable on Windows by working around how O_TEMPORARY is implemented. To do this the _winapi module would need a wrapper for SetFileInformationByHandle (available in Vista+), which would need to support at least

[issue25778] winreg.EnumValue does not truncate strings correctly

2016-01-01 Thread Eryk Sun
Eryk Sun added the comment: The current test works for 3.x because we keep the full string length via PyUnicode_AsWideCharString(value, ) when creating a REG_SZ value. OTOH, 2.x Py2Reg gets the length via strlen. I'd prefer to make this consistent with 3.x by using the full string length from

[issue25778] winreg.EnumValue does not truncate strings correctly

2016-01-01 Thread Eryk Sun
Changes by Eryk Sun <eryksun+pyb...@gmail.com>: Added file: http://bugs.python.org/file41470/issue25778_py36_2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25778] winreg.EnumValue does not truncate strings correctly

2016-01-01 Thread Eryk Sun
Changes by Eryk Sun <eryksun+pyb...@gmail.com>: Added file: http://bugs.python.org/file41469/issue25778_py27_1.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25778] winreg.EnumValue does not truncate strings correctly

2016-01-01 Thread Eryk Sun
Eryk Sun added the comment: I've added a patch for 2.7 that updates Py2Reg to use PyString_GET_SIZE instead of strlen and updates Reg2Py to use strnlen instead of returning strings with embedded NULs. -- ___ Python tracker <rep...@bugs.python.

[issue25999] Add support of native number in bin()

2016-01-03 Thread Eryk Sun
Eryk Sun added the comment: bin() returns a Python literal, which thankfully requires an explicit sign. 2's complement literals would be prone to human error. If you want 2's complement, you can write your own function. For example: def mybin(number, nbits=None, *, signed=True

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread Eryk Sun
Eryk Sun added the comment: PyLocale_setlocale in Modules/_localemodule.c is incorrectly passing the locale as a UTF-8 string ("z") instead of using the codepage of the current locale. As you can see below "å" is passed as the UTF-8 string "\xc3\xa5": >&g

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread Eryk Sun
Eryk Sun added the comment: Yes, it's ANSI. I should have said "system locale" instead of "current locale". To find the requested locale, the CRT function __get_qualified_locale calls EnumSystemLocalesA. The passed callback calls GetLocaleInfoA for each enumerated local

[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-01-09 Thread Eryk Sun
Eryk Sun added the comment: I didn't want to change the function in lieu of breaking someone's code. If this change is accepted, then it at least needs a documentation note to indicate the new behavior. -- versions: +Python 3.6 -Python 3.4

[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-01-09 Thread Eryk Sun
Changes by Eryk Sun <eryksun+pyb...@gmail.com>: -- components: +Documentation, Library (Lib) ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26065] python embedded 3.5 amd64 crash when using venv

2016-01-09 Thread Eryk Sun
Eryk Sun added the comment: 0xC409 (3221226505) is STATUS_STACK_BUFFER_OVERRUN due to the CRT calling __fastfail(FAST_FAIL_FATAL_APP_EXIT) in abort(). This is expected behavior in Windows 8+ [1]. Initially I couldn't reproduce this error because Python found the standard library from

[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-01-09 Thread Eryk Sun
Eryk Sun added the comment: I would call SetDllDirectory instead of changing the current directory. This replaces the current directory in the DLL search. Then call SetDllDirectory(NULL) to restore the default before returning. When you say "the CRT assembly", you're tal

[issue26024] Non-ascii Windows locale names

2016-01-09 Thread Eryk Sun
Eryk Sun added the comment: The issue isn't quite the same for 3.5+. The new CRT uses Windows Vista locale APIs. In this case it uses LOCALE_SENGLISHLANGUAGENAME instead of the old LOCALE_SENGLANGUAGE. This maps "Norwegian" to simply "Norwegian" instead o

Re: (Execution) Termination bit, Alternation bit.

2015-12-20 Thread eryk sun
On Sun, Dec 20, 2015 at 10:21 AM, Dennis Lee Bieber wrote: > On Sun, 20 Dec 2015 12:25:30 +0100, "Skybuck Flying" > declaimed the following: >> >>This does make me wonder how Windows 7 terminates threads/processes/hanging >>applications. >>

Re:

2015-12-21 Thread eryk sun
On Mon, Dec 21, 2015 at 3:08 AM, Animesh Srivastava wrote: > While installin python3.5.1 i m getting 0xc07b error 0xC07B is STATUS_INVALID_IMAGE_FORMAT, so there's something wrong with the executable. Try clearing your browser cache and download the installer again.

Re: IDLE 3.5.1 quits unexpectedly (portuguese keyboard)

2015-12-21 Thread eryk sun
On Fri, Dec 18, 2015 at 9:15 PM, Osvaldo Dias dos Santos wrote: > > Pressing the tilde key my iMac portuguese keyboard quits IDLE > unexpectedly (along with any associated files I may be working > on, including code). > > The keyboard image is attached. The tilde key is the

[issue21579] Python 3.4: tempfile.close attribute does not work

2015-12-21 Thread Eryk Sun
Eryk Sun added the comment: > To extend support for this to Windows, we can add a > feature to mkstmp to not use O_TEMPORARY O_TEMPORARY is only used for NamedTemporaryFile, not mkstemp. Regarding NamedTemporaryFile, that can be worked around to keep Windows from deleting the file

Re: 0x80070570-The file or directory is corrupted and unreadable

2015-12-22 Thread eryk sun
On Tue, Dec 22, 2015 at 11:51 AM, Dennis Lee Bieber wrote: > > http://www.tech-faq.com/how-to-fix-error-0x80070570.html > suggests a registry cleaner (my preference over downloading some > unknown/unvetted "repair" tool) > > Most of the links on Google are for getting the

[issue12797] io.FileIO and io.open should support openat

2015-12-22 Thread Eryk Sun
Eryk Sun added the comment: Марк, os.open added dir_fd support in 3.3, which is implemented on POSIX systems by calling openat. The dir_fd parameter is available for many os functions. This is discussed in section 1.5, Files and Directories [1]. It would be nice if we could support dir_fd

[issue25930] os.unlink != os.remove in python3.5

2015-12-22 Thread Eryk Sun
Eryk Sun added the comment: This is due to using argument clinic in Modules/posixmodule.c: /*[clinic input] os.remove = os.unlink builtin_function_or_method instances are equal if m_self (the module in this case) and m_ml->ml_meth (the C function) are the same. In 3.4, the funct

[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2015-12-22 Thread Eryk Sun
Eryk Sun added the comment: Starting a Windows process is expensive. Who not use threading, e.g. SocketServer.ThreadingTCPServer? It seems to me that it's a bug to even define ForkingMixIn, ForkingTCPServer, and ForkingUDPServer on Windows. Those should be conditionally defined depending

Re: 0x80070570-The file or directory is corrupted and unreadable

2015-12-22 Thread eryk sun
On Tue, Dec 22, 2015 at 8:02 AM, muizz hasan wrote: > Hi there! I've been recently trying to install Python for Windows 10 > and I've been encountering some issues. Every time i try to install > the program it just says"0x80070570-The file or directory is corrupted > and

[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2015-12-23 Thread Eryk Sun
Eryk Sun added the comment: Considering there's no plan to implement bytes paths for scandir on Windows, then the following line in the os docs needs to be modified: "All functions accepting path or file names accept both bytes and string objects, and result in an object of the same

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-23 Thread eryk sun
On Wed, Dec 23, 2015 at 7:16 AM, Nicky Mac wrote: > C:\Python\Python35\python.exe: Error while finding spec for > 'idlelib.__main__' (: bad magic number in 'idlelib': > b'\x03\xf3\r\n'); 'idlelib' is a package and cannot be directly executed 0xf303 (62211) is for Python

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 4:45 PM, Terry Reedy wrote: > >> This file should not exist. Python 3 stores .pyc files in a >> __pycache__ subdirectory. It won't even run "idlelib\__init__.pyc" if >> "idlelib\__init__.py" exists, so your installation is incomplete and >> damaged. I

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 4:33 PM, Terry Reedy wrote: >> somehow the new py3.5 has been added to the end, not the beginning. >> guess this path is what you meant by "my profile". > > Bizarre. I just installed 3.5.1 on top of 3.5.1rc1, on Win10 with the 64bit > .exe installer, and

[issue25939] _ssl.enum_certificates() fails with ERROR_ACCESS_DENIED if python.exe run with low integrity level

2015-12-24 Thread Eryk Sun
Eryk Sun added the comment: psexec.exe can be run from the the live server. >>> subprocess.call(r'\\live.sysinternals.com\tools\psexec.exe -s whoami') PsExec v2.11 - Execute processes remotely Copyright (C) 2001-2014 Mark Russinovich Sysinternals - www.sysinternals.com

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 3:29 PM, Nicky Mac wrote: > > C:\Users\Nick>python -m idlelib > ** IDLE can't import Tkinter. > Your Python may not be configured for Tk. ** In the 3.5 installation directory, ensure that tkinter is installed in Lib/tkinter. There should be an

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-23 Thread eryk sun
On Wed, Dec 23, 2015 at 8:38 AM, Nicky Mac wrote: > > I removed the old python2.7 entries in system Path, the PYTHON variables you > mentioned are not present. > All I have is Python35 in the PATH. Maybe there's still a stale directory on sys.path for another reason. Print

[issue25954] Python 3.5.1 installer fails on Windows 7

2015-12-25 Thread Eryk Sun
Eryk Sun added the comment: The main log file reports that installing the CRT exited with the code ERROR_INSTALL_ALREADY_RUNNING (0x652): Another installation is already in progress. Complete that installation before proceeding with this install. You may need to completely

[issue25954] Python 3.5.1 installer fails on Windows 7

2015-12-26 Thread Eryk Sun
Eryk Sun added the comment: Packages are installed from the ProgramData folder on the system volume. For example, the log shows the CRT update executed as follows: "C:\Windows\system32\wusa.exe" "C:\ProgramData\Package Cache\ D4036846864773E3D647F421DFE7F6CA536E307B\

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 8:52 AM, Nicky Mac wrote: > seems the user profile PATH is a registry entry, and was not updated when I > deinstalled Python2.7 > still haven't figured out how to change it - I will NOT attempy a regedit. As to PATH on Windows, it's split into

[issue25939] _ssl.enum_certificates() fails with ERROR_ACCESS_DENIED if python.exe run with low integrity level

2015-12-28 Thread Eryk Sun
Eryk Sun added the comment: Testing based on integrity level doesn't require creating a child process. I'm attaching a ctypes-based example that defines a context manager that temporarily sets the integrity level of the current thread's impersonation token. To get the impersonation token, I

[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2015-12-21 Thread Eryk Sun
Eryk Sun added the comment: The ANSI API is problematic because it returns a best-fit encoding to the system codepage. For example: >>> os.listdir('.') ['ƠƨưƸǀLjǐǘǠǨǰǸ'] >>> os.listdir(b'.') [b'O?u?|?iu?Kj?'] To somewhat work around this problem, listdir

Re: What interface is a ‘Popen.stdout’ presenting?

2015-12-23 Thread eryk sun
On Wed, Dec 23, 2015 at 7:36 PM, Ben Finney wrote: > So how do I get from a Python 2 ‘file’ object, to whatever > ‘io.TextIOWrapper’ wants? I would dup the file descriptor and close the original file. Then open the file descriptor using io.open: >>> p =

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-23 Thread eryk sun
On Wed, Dec 23, 2015 at 1:51 PM, Nicky Mac wrote: > > no sign of old Py2.7 anywhere :- > > C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')" > > C:\Python\Python35\python35.zip > C:\Python\Python35\DLLs > C:\Python\Python35\lib > C:\Python\Python35 >

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 8:52 AM, Nicky Mac wrote: > seems the user profile PATH is a registry entry, and was not updated when I > deinstalled Python2.7 > still haven't figured out how to change it - I will NOT attempy a regedit. I don't use the option to add the

Re: Why doesn't os.remove work on directories?

2015-12-23 Thread eryk sun
On Tue, Dec 22, 2015 at 10:29 PM, Random832 wrote: > > This is surprising to anyone accustomed to the POSIX C remove > function, which can remove either files or directories. Is there > any known rationale for this decision? Guido added os.remove as a synonym for

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 5:06 AM, Nicky Mac wrote: > > not sure what you mean by "my profile". > following your suggestion, looks normal: I meant your profile directory, "C:\Users\Nick". But printing the package path showed the problem is in your Python 3 installation

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Eryk Sun
Eryk Sun added the comment: Serhiy, when does sharing UTF-8 data occur in a compact object? It has to be ASCII since non-ASCII UTF-8 isn't sharable, but PyASCIIObject doesn't have the utf8 field. So it has to be a PyCompactUnicodeObject. But isn't ASCII always allocated as a PyASCIIObject? I

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

2015-11-25 Thread Eryk Sun
Eryk Sun added the comment: For "del X.__new__", type_setattro in Objects/typeobject.c indirectly calls update_one_slot. This finds object.__new__ fom the base object class when it looks up __new__ on the type. Since __new__ for built-in types is special-cased to be a built-in meth

[issue25741] Usual Installation Directory

2015-11-28 Thread Eryk Sun
Eryk Sun added the comment: > LOCALAPPDATA is set by the operating system, typically to > C:\Users\\AppData\Local (at least since Vista I > think? Certainly since Win7 Vista introduced LOCALAPPDATA, so there's no problem referencing it in the docs for 3.5+. On a related note

[issue25758] ensurepip/venv broken on Windows if path includes unicode

2015-11-28 Thread Eryk Sun
Eryk Sun added the comment: The problem is that the compile_source function in Modules/zipimport.c calls PyUnicode_EncodeFSDefault to get an encoded string to pass as the filename argument of Py_CompileString. On Windows this uses the ANSI codepage (i.e. 'mbcs'). Apparently your system's ANSI

[issue25763] I cannot use absolute path in sqlite3 , python 2.7.9, windows

2015-11-29 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: -- resolution: -> not a bug stage: -> resolved ___ Python tracker <rep...@bugs.python.org> <http://bugs.

[issue25765] Installation error

2015-11-30 Thread Eryk Sun
Eryk Sun added the comment: > The error code is from Windows Update (which we sometimes need to > run as part of the install), and there's so much spam out there > these days that it is impossible to find out what it means. The error is WU_E_NOT_INITIALIZED [1], "th

Re: Is vars() the most useless Python built-in ever?

2015-11-30 Thread eryk sun
On Mon, Nov 30, 2015 at 7:00 PM, Steven D'Aprano wrote: > Either way, vars() doesn't solve the problem. What problem does it solve? vars() used to be the way to list local variables. >From 4 May 1994, Python 1.0.2 [1]: vars() returns a dictionary containing the local

[issue25737] array is not a Sequence

2015-11-26 Thread Eryk Sun
Eryk Sun added the comment: This is a duplicate of issue 23864, i.e. only the "one-trick ponies" work: >>> issubclass(array.array, abc.Sized) True >>> issubclass(array.array, abc.Iterable) True >>> issubclass(array.array, abc.Container

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

2015-11-18 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: -- nosy: +eryksun ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25653> ___ __

[issue25678] int() from a buffer reads past the buffer boundaries

2015-11-20 Thread Eryk Sun
Eryk Sun added the comment: I just made a quick modification to check that it works. I'm sure you could do the same. But here it is anyway. -- keywords: +patch Added file: http://bugs.python.org/file41095/issue25678.patch ___ Python tracker <

[issue25678] int() from a buffer reads past the buffer boundaries

2015-11-20 Thread Eryk Sun
Eryk Sun added the comment: > Now we have an example, and can backport that patch. More seriously it's possible to get a buffer over-read using NumPy: >>> import numpy >>> int(buffer(numpy.array('123', dtype='c'))) Traceback (most recent call last):

[issue25678] int() from a buffer reads past the buffer boundaries

2015-11-20 Thread Eryk Sun
Eryk Sun added the comment: > I think the tests should be using buffer(..., a, b) instead. Thanks, you're right. :) -- Added file: http://bugs.python.org/file41102/issue25678_3.patch ___ Python tracker <rep...@bugs.python.org&

[issue25678] int() from a buffer reads past the buffer boundaries

2015-11-20 Thread Eryk Sun
Changes by Eryk Sun <eryk...@gmail.com>: Added file: http://bugs.python.org/file41101/issue25678_2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

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

2015-11-22 Thread Eryk Sun
Eryk Sun added the comment: The problem from issue 10653 is that internally the CRT encodes the time zone name using the ANSI codepage (i.e. the default system codepage). wcsftime decodes this string using mbstowcs (i.e. multibyte string to wide-character string), which uses Latin-1 in the C

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Eryk Sun
Eryk Sun added the comment: > Why do strings cache their UTF-8 encoding? Strings also cache the wide-string representation. For example: from ctypes import * s = '\241\242\243' pythonapi.PyUnicode_AsUnicodeAndSize(py_object(s), None) pythonapi.PyUnicode_AsUTF8AndSize(py_obj

[issue25709] greek alphabet bug it is very disturbing...

2015-11-23 Thread Eryk Sun
Eryk Sun added the comment: unicode_modifiable in Objects/unicodeobject.c should return 0 if there's cached PyUnicode_UTF8 data. In this case PyUnicode_Append won't operate in place but instead concatenate a new string. -- nosy: +eryksun ___ Python

[issue26086] Bug in standardmodule os

2016-01-11 Thread Eryk Sun
Changes by Eryk Sun <eryksun+pyb...@gmail.com>: -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26086] Bug in standardmodule os

2016-01-11 Thread Eryk Sun
Eryk Sun added the comment: The "yield from" syntax was added in Python 3.3, so somehow you're using the 3.5 standard library with either an old 3.x or 2.x version. The older version shouldn't use 3.5's standard library, unless you have either PYTHONHOME or PYTHONPATH defined.

[issue26083] ValueError: insecure string pickle in subprocess.Popen on Python 2

2016-01-11 Thread Eryk Sun
Eryk Sun added the comment: > I strongly recommend people use https://pypi.python.org/pypi/subprocess32/ I think this warrants a note that draws more attention to itself than the "see also" text. -- nosy: +eryksun ___ Python

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 11:10 AM, Chris Angelico wrote: > On Wed, Jan 13, 2016 at 3:51 AM, jkn wrote: >> I happy to carve some code without using urllib, but I am not clear what I >> actually need to do to 'open' such a URL using this protocol. FWIW I

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 11:52 AM, Chris Angelico wrote: > Is that properly escaped to handle any arbitrary URL? I doubt it. subprocess doesn't know how to quote a command line for the Windows shell, which doesn't follow the rules used by subprocess.list2cmdline. To make matters

Re: Python installation in windows

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 9:15 AM, Oscar Benjamin wrote: > > I thought this was suppose to have been fixed in 3.5.1 though so the installer > should now warn that it won't work on XP. The CRT update also requires service pack 1 on Windows 7 and service pack 2 on Vista.

[issue16192] ctypes - documentation example

2016-06-02 Thread Eryk Sun
Eryk Sun added the comment: > ``sizeof(long double) == sizeof(double)`` it is an alias to > :class:`c_double`. This should be "``sizeof(long) == sizeof(int)`` ... :class:`c_long`". -- resolution: fixed -> stage: resolved ->

  1   2   3   4   5   6   7   8   9   10   >