[issue23121] pip.exe breaks if python 2.7.9 is installed under c:\Program Files\Python

2014-12-27 Thread eryksun
eryksun added the comment: See issue 21699. This is fixed in distlib 0.1.9. The latest pip uses distlib 0.2.0, so just update from pip 1.5.6 to 6.0.3. C:\>"C:\Program Files\Python27\Scripts\pip.exe" --version

[issue22976] multiprocessing Queue empty() is broken on Windows

2014-12-02 Thread eryksun
eryksun added the comment: This also hangs for me in 2.7.8 64-bit, Windows 7. To poll the pipe, the parent process calls PeekNamedPipe, which blocks because the child has already called ReadFile. > It is possible that the problem is also present in Python 3. multiprocessing switched

[issue22977] Unformatted “Windows Error 0x%X” exception message

2014-12-02 Thread eryksun
eryksun added the comment: This also affects SEH-related exceptions raised by ctypes. For example, VC++ uses exception code 0xE06D7363 (i.e. b'\xe0msc'), so unhandled VC++ exceptions leak into Python like this: >>> ctypes.windll.kernel32.RaiseException(0xe

[issue22961] ctypes.WinError & OSError

2014-11-28 Thread eryksun
eryksun added the comment: > the default value is EINVAL. Should that be specified in the docs? Currently it states that "[t]he errno attribute is then an approximate translation, in POSIX terms, of that native error code". https://docs.python.org/3/library/exceptions

[issue22945] Ctypes inconsistent between Linux and OS X

2014-11-26 Thread eryksun
eryksun added the comment: c_void_p's getfunc returns the address as an integer. In turn, an integer argument gets converted to a C int. This mean you need to a create a new c_void_p from the address for _as_parameter_, e.g. self._as_parameter_ = c_void_p(self.g) Or set restype

[issue22916] Interpreter segfault on attempted tab complete

2014-11-22 Thread eryksun
eryksun added the comment: This isn't a bug in Python or tab completion. You can reproduce the fault by referencing s.transformable twice and then deleting both references. The getter for TransformableDrawable.transformable calls wrap_transformable to create a wrapper for the underly

[issue22888] ensurepip and distutils' build_scripts fails on Windows when path to Python contains accented characters

2014-11-16 Thread eryksun
eryksun added the comment: On Windows, shouldn't copy_scripts use UTF-8 instead of os.fsencode (MBCS)? The Python launcher executes the shebang line on Windows, and it defaults to UTF-8 if a script doesn't have a BOM. See line 1105 in maybe_handle_shebang: https://hg.python.org/cp

[issue22851] 2.7 core crashes with generator.gi_frame.f_restricted

2014-11-14 Thread eryksun
eryksun added the comment: The fix for issue 14432 was applied to 3.3, but I'm pretty sure 2.x PyFrame_IsRestricted is the only problem. Nothing else should see f_tstate when it's NULL. Also, f_tstate was dropped from PyFrameObj

[issue22851] core crashes

2014-11-12 Thread eryksun
eryksun added the comment: This is related to the fix for issue 14432. gen_send_ex sets f->f_tstate to NULL, so PyFrame_IsRestricted segfaults: #define PyFrame_IsRestricted(f) \ ((f)->f_builtins != (f)->f_tstate->interp->builtins) ------

[issue22790] some class attributes missing from dir(Class)

2014-11-04 Thread eryksun
eryksun added the comment: __doc__ and __module__ are also getsets (to support built-in types), but it's nothing to worry about since the attributes can't be deleted. I think the most value added here is for listing __mro__ and the others that Georg mentioned. Should the following

[issue22792] string replace() not documented

2014-11-04 Thread eryksun
eryksun added the comment: Follow the "String Methods" link at the top of the string module documentation. Or use this link: https://docs.python.org/3.4/library/stdtypes.html#str.replace See also help(str.replace) and help(str) in the interactive shell. -- assignee: ->

[issue22790] some class attributes missing from dir(Class)

2014-11-04 Thread eryksun
eryksun added the comment: See type_dir: https://hg.python.org/cpython/file/ab2c023a9432/Objects/typeobject.c#l2984 -- ___ Python tracker <http://bugs.python.org/issue22

[issue22790] some class attributes missing from dir(Class)

2014-11-04 Thread eryksun
eryksun added the comment: You won't find the __qualname__ data descriptor in dir(Foo.Bar) because it's defined by the metaclass, `type`. Attributes from the metaclass have always been excluded from the dir() of a class. -- nosy

[issue22781] ctypes: Differing results between Python and C.

2014-11-01 Thread eryksun
eryksun added the comment: ctypes doesn't always handle bitfields correctly. In particular it doesn't adapt the storage unit size when packed. A bitfield based on c_uint is always stored in 4 bytes, even if _pack_ is set to 1. This is MSVC rules, so all is well on Windows. For exa

[issue22732] ctypes tests don't set correct restype for intptr_t functions

2014-10-26 Thread eryksun
eryksun added the comment: > Why not use c_size_t? Or is that incorrect in some cases? Strictly speaking, size_t doesn't have to encompass the entire addressable range, such as for architectures that use segmented addressing (e.g. near and far pointers). Practically speaking, no

[issue22719] os.path.isfile & os.path.exists bug in while loop

2014-10-24 Thread eryksun
eryksun added the comment: > i.e. the object id is the same after appending Actually, that's wrong. bak_path is a compact string. So the whole object is realloc'd, and the base address (i.e. id) could change. Check PyUnicode_AsUnicode even if t

[issue22719] os.path.isfile & os.path.exists bug in while loop

2014-10-24 Thread eryksun
eryksun added the comment: When appending to a singly-referenced string, the interpreter tries to reallocate the string in place. This applies to both `s += 'text'` and `s = s + 'text'`. Storing to a temp variable is adding a 2nd reference, so a new string gets alloc

[issue22719] os.path.isfile & os.path.exists bug in while loop

2014-10-24 Thread eryksun
eryksun added the comment: What do you get for os.stat? bak_path = r"C:\Users\EAARHOS\Desktop\Python Review\baseExcel.py" print(os.stat(bak_path)) bak_path += '.bak' print(os.stat(bak_path)) bak_path += '.bak' print(os.stat(

[issue22673] Incorrect fileno for CONOUT$ / stdout

2014-10-19 Thread eryksun
eryksun added the comment: In Python 2, the closer for sys.stdout is _check_and_flush, which flushes the stream without closing the underlying FILE. https://hg.python.org/cpython/file/ee879c0ffa11/Python/sysmodule.c#l1377 In Python 3, io.FileIO won't close the underlying file descript

[issue22648] Unable to install Python 3.4.2 amd64 on Windows 8.1

2014-10-18 Thread eryksun
eryksun added the comment: > MSI (c) (C4:24) [08:42:21:565]: Note: 1: 2203 2: > C:\Users\pierre\Doocuments\python-3.4.2.amd64.msi 3: > -2147287037 "Doocuments" is probably a typo. Try again using "Documents". -- nosy: +eryksun _

[issue22651] Open file in a+ mode reads from end of file in Python 3.4

2014-10-16 Thread eryksun
Changes by eryksun : -- title: Python 2: Open file in a+ mode doesn't go to the end -> Open file in a+ mode reads from end of file in Python 3.4 versions: +Python 3.4, Python 3.5 -Python 2.7 ___ Python tracker <http://bugs.python.org

[issue22651] Python 2: Open file in a+ mode on Windows doesn't go to the end

2014-10-16 Thread eryksun
eryksun added the comment: FYI, this is implementation defined in C89: ... unless the file is opened with append mode in which case it is **implementation-defined** whether the file position indicator is positioned at the beginning or the end of the file. http://port70.net

[issue18494] PyType_GenericSet/GetDict functions misnamed in docs?

2014-10-05 Thread eryksun
eryksun added the comment: See changeset 78f93eb7dd75. The names in the docs are wrong. -- nosy: +eryksun ___ Python tracker <http://bugs.python.org/issue18

[issue22552] ctypes.CDLL returns singleton objects, resulting in usage conflicts

2014-10-04 Thread eryksun
eryksun added the comment: > Packages do this because it's the natural thing to do I guess the tutorial is channeling projects toward using the cdll/windll LibraryLoader instances on Windows. It even shows using cdll.LoadLibrary('libc.so.6') on Linux. That's equiva

[issue22552] ctypes.CDLL returns singleton objects, resulting in usage conflicts

2014-10-04 Thread eryksun
eryksun added the comment: > How does this relate to issue 14201? That is, is the answer just > "use getitem if you don't want caching"? Unlike CDLL.__getitem__, LibraryLoader.__getitem__ does use the attribute cache. Why use a LibraryLoader if you don't want the

[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread eryksun
eryksun added the comment: >> As mentioned before, many packages can not handle paths with >> spaces. > > This is "common knowledge", yet may not be true anymore. Well, see issue 21699. pip 1.5.6 is still using distlib 0.1.8, so the executable wrappers it creates

[issue22552] ctypes.CDLL returns singleton objects, resulting in usage conflicts

2014-10-03 Thread eryksun
eryksun added the comment: The ctypes global LibraryLoader instances are convenient for Windows scripts and applications. Actually what they cache is the library (a CDLL instance), which in turn caches function pointers. Python packages, on the other hand, shouldn't use these parti

[issue19865] create_unicode_buffer() fails on non-BMP strings on Windows

2014-10-03 Thread eryksun
eryksun added the comment: When sizeof(c_wchar) == 2, it can just count the number of non-BMP ordinals in the string. Another approach would be to use size = pythonapi.PyUnicode_AsWideChar(init, None, 0), but then the whole function may as well be implemented in the _ctypes extension module

[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2014-09-27 Thread eryksun
eryksun added the comment: MSC has __declspec(deprecated). See http://stackoverflow.com/a/21265197, for example. It's a level 3 (/W3) warning. http://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.100%29.aspx -- nosy: +eryksun ___ Python tr

[issue22443] read(1) blocks on unflushed output

2014-09-19 Thread eryksun
eryksun added the comment: unbuffer works for me. It fakes a tty, so apt-get doesn't automatically enter quiet mode. import io import subprocess args = ['unbuffer', 'apt-get', 'download', 'firefox'] p = subprocess.Popen(args,

[issue22443] read(1) blocks on unflushed output

2014-09-19 Thread eryksun
eryksun added the comment: stdbuf is the typical way to apply the LD_PRELOAD trick: https://www.gnu.org/software/coreutils/manual/html_node/stdbuf-invocation.html There's also the "unbuffer" expect script: http://expect.sourceforge.net/example/unbuffer.man.html ------

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-07 Thread eryksun
eryksun added the comment: > If you take "//?/C:/" and join it with e.g. "foo", you get an > absolute path (or, if you remove the drive's trailing slash, you > get something that's invalid AFAIK). FYI, DOS device names such as "C:" are NT sy

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread eryksun
eryksun added the comment: Maybe for an extended path it could try _getfinalpathname without the prefix. If it isn't a valid path or the result isn't the same as _getfinalpathname including the prefix, then skip calling _ext_to_normal. For example: def resolve(self, path):

[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread eryksun
eryksun added the comment: > "//server" is just the same as "/server" or "///server". Repeated slashes aren't collapsed at the start of a Windows path. Here's what I get in Windows 7: >>> os.listdir('/server') [] &

[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread eryksun
eryksun added the comment: Isn't this bug about the "root of a share" case with ntpath.isabs in 3.x and 2.7 (splitdrive was backported)? For example: >>> os.path.isabs("//server/share") False >>> os.path.splitdrive('

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread eryksun
eryksun added the comment: It should only skip _ext_to_normal for an already extended path, i.e. a path that starts with ext_namespace_prefix. Otherwise it needs to call _ext_to_normal. For example: Strip the prefix in this case: >>> os.path._getfinalpathname(&#x

[issue22312] ntpath.splitdrive('//') -> IndexError

2014-08-31 Thread eryksun
eryksun added the comment: Line 116 should use normp[2:3] instead of normp[2]. http://hg.python.org/cpython/file/ee879c0ffa11/Lib/ntpath.py#l92 -- nosy: +eryksun ___ Python tracker <http://bugs.python.org/issue22

[issue22302] Windows os.path.isabs UNC path bug

2014-08-29 Thread eryksun
eryksun added the comment: On second thought, while the parallels between drives and shares are nice, beyond that this makes no sense to me. http://hg.python.org/cpython/file/c0e311e010fc/Lib/ntpath.py#l91 Windows uses hidden environment variables (e.g. "=C:") for the working di

[issue22302] Windows os.path.isabs UNC path bug

2014-08-29 Thread eryksun
eryksun added the comment: It's a relative path if the share name lacks a trailing slash. Consider the hidden share "//server/C$" for the C: drive. "C:" is a relative path, while "C:/" is an absolute path. Similarly "//server/C$" is relative, while

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-08-29 Thread eryksun
eryksun added the comment: The \\?\ extended-path prefix bypasses normal path processing. The path is passed directly to the filesystem driver. For example, to accommodate the POSIX namespace, NTFS allows any character except NUL and slash, so it happily creates a directory named "foo.&q

[issue22098] Behavior of Structure inconsistent with BigEndianStructure when using __slots__

2014-08-22 Thread eryksun
eryksun added the comment: Since BigEndianStructure doesn't explicitly define the instance slots, they get the default slots for __dict__ and __weakref__. It wouldn't make sense to exclude these slots from instances of the Point2 subclass, so there's no mechanism for that. Y

[issue20042] Python Launcher, Windows, fails on scripts w/ non-latin names

2014-08-19 Thread eryksun
eryksun added the comment: The problem is skip_whitespace mistakenly calls isspace instead of iswspace. http://hg.python.org/cpython/file/c0e311e010fc/PC/launcher.c#l48 isspace has undefined behavior when the argument is "not EOF or in the range of 0 through 0xFF": http://msdn.mic

[issue22198] Odd floor-division corner case

2014-08-15 Thread eryksun
eryksun added the comment: decimal.Decimal 'floor division' is integer division that truncates toward 0 (see 9.4.2). >>> Decimal('-0.5').__floor__() -1 >>> Decimal('-0.5').__floordiv__(1) Decimal('-0') Numpy 1.8.1:

[issue11395] print(s) fails on Windows with long strings

2014-08-02 Thread eryksun
eryksun added the comment: The buffer size only needs to be capped if WINVER < 0x602. This issue doesn't apply to Windows 8 since it uses the ConDrv device driver instead of LPC. Prior to Windows 8, WriteFile redirects to WriteConsoleA when passed a console handle. This makes an LPC

[issue16353] add function to os module for getting path to default shell

2014-08-01 Thread eryksun
eryksun added the comment: Defaulting to just "cmd.exe" can execute an arbitrary program named "cmd.exe" in the application directory or current directory. When CreateProcess needs to find the shell to execute a batch file (.bat or .cmd), it doesn't search for "

[issue16353] add function to os module for getting path to default shell

2014-08-01 Thread eryksun
eryksun added the comment: > The path to the default shell shouldn't change during the time > of program execution. On Windows the ComSpec environment variable could change during program execution. ------ nosy: +eryksun ___ Python tra

[issue11429] ctypes is highly eclectic in its raw-memory support

2014-07-31 Thread eryksun
eryksun added the comment: > Interesting that “cast” accepts a byte string. If this is > intended behaviour, it would be good to document that. > Currently it says it takes “an object that can be > interpreted as a pointer”. cast makes an FFI call: _cast = PYFUNCTY

[issue11429] ctypes is highly eclectic in its raw-memory support

2014-07-31 Thread eryksun
eryksun added the comment: Extending byref to support bytes and str objects sounds reasonable. Here's another workaround to pass a bytes object with an offset: from ctypes import * from ctypes.util import find_library class offset: def __init__(self, arg, o

[issue11427] ctypes from_buffer no longer accepts bytes

2014-07-31 Thread eryksun
eryksun added the comment: cast calls ctypes._cast(obj, obj, typ). _cast is a ctypes function pointer defined as follows: _cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr) Since cast makes an FFI call that converts the first arg to c_void_p

[issue22091] __debug__ in compile(optimize=1)

2014-07-27 Thread eryksun
eryksun added the comment: If __debug__ were referenced from the code object's co_consts instead of checking locals, globals and builtins (LOAD_NAME), then optimize=1 would work consistently for a given code object. Currently in 3.4.1: >>> dis.dis(compile("

[issue16892] Windows bug picking up stdin from a pipe

2014-07-17 Thread eryksun
eryksun added the comment: Doskey is a command-line interface for a subset of the Win32 console API. Macros are implemented as console input aliases by calling AddConsoleAlias. http://msdn.microsoft.com/en-us/library/ms681935 You can load macros from a text file that defines aliases for

[issue21927] BOM appears in stdin when using Powershell

2014-07-16 Thread eryksun
eryksun added the comment: > PS C:\Users\jaraco> echo £ | py -3 -c "import sys; > print(repr(sys.stdin.buffer.read()))" > b'?\r\n' > Curiously, it appears as if powershell is actually receiving > a question mark from the pipe. PowerShell calls ReadCon

[issue20117] subprocess on Windows: wrong return code with shell=True

2014-07-14 Thread eryksun
eryksun added the comment: For what it's worth, an explicit "exit" will set the return code to the last error. >>> subprocess.call("nonex & exit", shell=True, stderr=subprocess.DEVNULL) 9009 -- nosy: +eryksun

[issue21983] segfault in ctypes.cast

2014-07-14 Thread eryksun
eryksun added the comment: You need to cast to a pointer type, i.e. POINTER(Struct). Trying to cast to just Struct should raise a TypeError. Instead this revealed a bug in cast_check_pointertype (3.4.1): http://hg.python.org/cpython/file/c0e311e010fc/Modules/_ctypes/_ctypes.c#l5225 dict

[issue20844] coding bug remains in 3.3.5rc2

2014-06-20 Thread eryksun
eryksun added the comment: This fix for issue 20731 doesn't address this bug completely because it's possible for ftell to return -1 without an actual error, as test2.py demonstrates. In text mode, CRLF is translated to LF by the CRT's _read function (Win32 ReadFile). So th

[issue18017] ctypes.PyDLL documentation

2014-06-19 Thread eryksun
eryksun added the comment: 16.17.2.2 already has a warning after it introduces CDLL, OleDLL, and WinDLL: The Python global interpreter lock is released before calling any function exported by these libraries, and reacquired afterwards. It links to the glossary entry: https

[issue16272] C-API documentation clarification for tp_dictoffset

2014-06-19 Thread eryksun
eryksun added the comment: It could also mention the generic getter and setter functions for the PyGetSetDef that were added in 3.3: PyType_GenericGetDict and PyType_GenericSetDict. https://docs.python.org/3/c-api/object.html#c.PyType_GenericGetDict -- nosy: +eryksun

[issue21808] 65001 code page not supported

2014-06-19 Thread eryksun
eryksun added the comment: > sys.stdout.write() doen't use WriteFile. Again, see the > issue #1602 if you are interested to improve the Unicode > support of the Windows console. _write calls WriteFile because Python 3 sets standard I/O to binary mode. The source is distribut

[issue21808] 65001 code page not supported

2014-06-19 Thread eryksun
eryksun added the comment: > Setting the Windows console encoding to cp65001 using the chcp > command doesn't make the Windows console fully Unicode compliant. > It is a little bit better using TTF fonts, but it's not enough. > See the old issue #1602 opened 7 years

[issue21808] 65001 code page not supported

2014-06-19 Thread eryksun
eryksun added the comment: cp65001 was added in Python 3.3, for what it's worth. For me codepage 65001 (CP_UTF8) is broken for most console programs. Windows API WriteFile gets routed to WriteConsoleA for a console buffer handle, but WriteConsoleA has a different spec. It returns the n

[issue21785] __getitem__ and __setitem__ try to be smart when invoked with negative slice indices

2014-06-17 Thread eryksun
eryksun added the comment: Refer to the documentation for deprecated __getslice__ when slicing an instance of a classic class: https://docs.python.org/2/reference/datamodel.html#object.__getslice__ The SLICE+3 implementation (apply_slice) calls PySequence_GetSlice if both index values can be

[issue21699] Windows Python 3.4.1 pyvenv doesn't work in directories with spaces.

2014-06-09 Thread eryksun
eryksun added the comment: The py.exe launcher relies on manual quoting in the shebang line. That's the case for the shebang embedded in this pip executable. The problem is the "simple launcher" used by distlib 0.1.8. It always quotes the executable, even if it's already q

[issue15780] IDLE (windows) with PYTHONPATH and multiple python versions

2014-06-08 Thread eryksun
eryksun added the comment: `idle.pyw -E` passes an invalid argument, and pythonw.exe doesn't inherit the console to print the usage text to stderr. The -E option needs to be passed to the interpreter: C:\Python34>pythonw.exe -E Lib/idlelib/idle.pyw Or run idlelib as a script:

[issue1559298] test_popen fails on Windows if installed to "Program Files"

2014-06-07 Thread eryksun
eryksun added the comment: This is fixed for subprocess.Popen in 2.7, 3.1, and 3.2; see issue 2304. In 2.7, nt.popen still has this problem. As mentioned above, it can be worked around by using subprocess.Popen as described here: https://docs.python.org/2/library/subprocess.html#replacing-os

[issue21687] Py_SetPath: Path components separated by colons

2014-06-07 Thread eryksun
eryksun added the comment: A Windows path uses ":" after the drive letter, e.g. "C:\\Windows", so the delimiter is a semicolon on Windows. Other platforms use a colon. CPython uses DELIM, which is defined in osdefs.h. This header isn't included by Python.h. http://h

[issue21672] Python for Windows 2.7.7: Path Configuration File No Longer Works With UNC Paths

2014-06-05 Thread eryksun
eryksun added the comment: site.addpackage calls site.makepath(sitedir, line): def makepath(*paths): dir = os.path.join(*paths) try: dir = os.path.abspath(dir) except OSError: pass return dir, os.path.normcase(dir) In 2.7.7

[issue21625] help()'s more-mode is frustrating

2014-06-02 Thread eryksun
eryksun added the comment: You can use '-P?e(END) .(q to quit)' to add (END) just on the last line. Or show the line count instead: os.environ['LESS'] = '-Pline %lB?L/%L. (press h for help or q to quit)' -- ___

[issue21611] int() docstring - unclear what number is

2014-06-02 Thread eryksun
eryksun added the comment: The constructor tries __trunc__ (truncate toward 0) if __int__ isn't defined. If __trunc__ doesn't return an instance of int, it calls the intermediate result's __int__ method. In terms of the numbers ABCs, numbers.Real requires __trunc__, which

[issue21625] help()'s more-mode is frustrating

2014-06-01 Thread eryksun
eryksun added the comment: > Why does help() enter a more-mode for even short help? `more` exits if there's less than a page of a text. The default for `less` is to quit when "q" is entered. You may be interested in the option -e (quit-at-eof). > Why doesn'

[issue21546] int('\0') gives wrong error message

2014-05-20 Thread eryksun
eryksun added the comment: See issue 16741. This is fixed in 3.3, but 2.7 intentionally keeps the old behavior. -- nosy: +eryksun ___ Python tracker <http://bugs.python.org/issue21

[issue21518] Expose RegUnloadKey in winreg

2014-05-18 Thread eryksun
eryksun added the comment: ctypes LibraryLoader instances cache CDLL/WinDLL instances, which cache function pointers. Using the global ctypes.cdll and ctypes.windll loaders can lead to conflicting definitions for restype, argtypes, and errcheck. I suggest using a private LibraryLoader in

[issue21516] pathlib.Path(...).is_dir() crashes on some directories (Windows)

2014-05-16 Thread eryksun
eryksun added the comment: > but only for ERROR_SHARING_VIOLATION. Shouldn't this > include ERROR_ACCESS_DENIED? To clarify, I meant that I think it should fall back to using FindFirstFile for either error, not that ERROR_SHARING_VIOLATION somehow includes ERROR_ACCESS_DENIED. (P

[issue21516] pathlib.Path(...).is_dir() crashes on some directories (Windows)

2014-05-16 Thread eryksun
eryksun added the comment: nt._isdir calls GetFileAttributes. CPython's stat implementation calls CreateFile to get a handle to pass to GetFileInformationByHandle. If it can't get a valid handle, it falls back to calling FindFirstFileW to get the file information, bu

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

2014-05-14 Thread eryksun
eryksun added the comment: Using a relative target in the link isn't the problem for me here. (See issue 13702 for another problem with relative links.) I'm in the same boat as commenter weberc2. Same symptom; apparently a different problem. I'm using an absolute path for

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

2014-05-14 Thread eryksun
eryksun added the comment: Here's a related superuser question: http://superuser.com/q/304093 The message box shown in the older answer is what I get: http://i.stack.imgur.com/bqXBs.png The problem is only with Explorer. I can execute a symbolic link to an EXE via

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

2014-05-14 Thread eryksun
eryksun added the comment: How about using hard links (mklink /H) instead? It's a minor issue, but there's a bug in Explorer that breaks opening symbolic links to EXE, COM, CMD, and BAT files (exefile, comfile, cmdfile, batfile). Explorer displays the error message "the spec

[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2014-05-11 Thread eryksun
eryksun added the comment: The shape for the StructWithArrays test should be () in 3.x; it's None in 2.x. -- nosy: +eryksun versions: +Python 3.3 -Python 3.5 ___ Python tracker <http://bugs.python.org/is

[issue21425] Interactive interpreter doesn't flush stderr prompty

2014-05-10 Thread eryksun
eryksun added the comment: The patch fixes `python 2>&1 | cat.exe` for me on Windows, where cat.exe is from GnuWin32. The tests also pass. It looks like failing would entail hanging until a timeout. -- nosy: +eryksun ___ Python tracker

[issue18314] Have os.unlink remove junction points

2014-05-06 Thread eryksun
eryksun added the comment: For some read Sysinternals junction utility doesn't show the raw substitute name. Microsoft's fsutil shows the actual reparse data: C:\>mklink /J Python34 "C:\Program Files\Python34" Junction created for Python34 <<===>&g

[issue13702] relative symlinks in tarfile.extract broken (windows)

2014-05-06 Thread eryksun
eryksun added the comment: This should be fixed in os.symlink. The Windows CreateSymbolicLink function can't be relied on to translate slash to backslash. It only normalizes an absolute link, or a path that's relative to the current working directory on a drive (e.g. "R:..

[issue18314] Have os.unlink remove junction points

2014-05-06 Thread eryksun
eryksun added the comment: Nevermind, strike "seems to work"; it doesn't work without the \?? prefix. I stupidly assumed the DeviceIoControl call would validate the substitute name. Of course it doesn't; it happily creates a broken junction. Opening the junction with C

[issue18314] Have os.unlink remove junction points

2014-05-05 Thread eryksun
eryksun added the comment: For a junction reparse point, Sysinternals junction.exe shows the "Print Name" and "Substitute Name" are the same and it's not an NT \?? path (i.e. \DosDevices, i.e. \Global??). OTOH, the substitute name does use an NT DosDevices path w

[issue21427] installer not working

2014-05-04 Thread eryksun
eryksun added the comment: This is the first time I've used msilib, but it does appear that the component is marked as 64-bit: >>> import msilib >>> msidbComponentAttributes64bit = 256 >>> sql = ("SELECT ComponentId,Attributes FROM Compon

[issue21415] Python __new__ method doc typo (it's a class and not a static method)

2014-05-02 Thread eryksun
eryksun added the comment: > I believe that this explains why you have to use this idiom > inside __new__ when using super(): > > def __new__(cls, x): > super().__new__(cls, x) Yes, if __new__ is defined and is a function, type_new replaces it with a stat

[issue21363] io.TextIOWrapper always closes wrapped files

2014-04-27 Thread eryksun
eryksun added the comment: It works if you detach the buffer beforehand: >>> import io, sys >>> stdin = sys.stdin >>> stdin.flush() >>> correct_stdin = io.TextIOWrapper(stdin.buffer, 'utf-8') >>

[issue20309] Not all method descriptors are callable

2014-04-17 Thread eryksun
eryksun added the comment: classmethod_descriptor instances such as vars(dict)['fromkeys'] are callable. The first argument has to be a subclass of __objclass__: >>> vars(dict)['fromkeys'].__objclass__ Calling the descriptor creates a bound built-in metho

[issue21044] tarfile does not handle file .name being an int

2014-04-05 Thread eryksun
eryksun added the comment: > you can't overwrite a io.FileIO().name attribute A FileIO instance uses a dict for 'name' (msg214670): >>> vars(sys.stdin.buffer.raw) {'name': ''} >>> f = tempfile.TemporaryFile() &g

[issue21151] winreg.SetValueEx causes crash if value = None

2014-04-03 Thread eryksun
eryksun added the comment: In Py2Reg, the REG_BINARY (3) case sets `*retDataSize = 0` when the value is None: http://hg.python.org/cpython/file/04f714765c13/PC/winreg.c#l766 It doesn't modify *retDataBuf. Then in PySetValueEx, PyMem_DEL is called for the uninitialized address in data:

[issue1191964] asynchronous Subprocess

2014-04-02 Thread eryksun
eryksun added the comment: multiprocessing.connection uses the _winapi module for overlapped I/O and named pipes in case you're looking for examples: http://hg.python.org/cpython/file/3.4/Lib/multiprocessing/connection.py -- nosy: +er

[issue21130] equivalent functools.partial instances should compare equal

2014-04-02 Thread eryksun
eryksun added the comment: Function equality is based on identity, as inherited from object. But there's a precedent for this idea in method_richcompare, which compares the method's __func__ and __self__: http://hg.python.org/cpython/file/04f714765c13/Objects/classobj

[issue21104] Read from file aborted

2014-03-30 Thread eryksun
eryksun added the comment: AFAIK, this doesn't affect Python 3 under normal circumstances. A file could be manually set to text mode by calling msvcrt.setmode(f.fileno(), os.O_TEXT), but that's out of the norm. In Python 2, on Windows interpreting ctrl+z (0x1a) as end-of-file

[issue21074] Too aggressive constant folding

2014-03-26 Thread eryksun
eryksun added the comment: The redesigned peephole optimizer in PY3 improves constant folding. Limiting this would be a step back. Plus you can get the same behavior in PY2 if you first expand the power. For example: # using 2**30, for a 32-bit process def uncalled(): x = b&#

[issue21044] tempfile.TemporaryFile() shouldn't have a name attribute

2014-03-23 Thread eryksun
eryksun added the comment: This name attribute is documented here: http://docs.python.org/3/library/io#io.FileIO.name 3.4 Source: http://hg.python.org/cpython/file/04f714765c13/Modules/_io/fileio.c#l432 In PY2, os.fdopen sets the name to ''. See the related issue 13781.

<    1   2   3