[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []

2017-03-18 Thread Glenn Linderman
Glenn Linderman added the comment: It is certainly true that getallmatchingheaders is broken... because the data it is looking at has changed format. Here is a replacement that is as compatible as can be, based on the changed format. name = name.lower() n = len(name)

[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-18 Thread Paul "TBBle" Hampson
Paul "TBBle" Hampson added the comment: If this is just a documentation fix, then there's two places that need it: * https://github.com/python/cpython/blob/master/Tools/msi/README.txt contains the text I quoted in the original report. * Some kind of release note

[issue29850] file access, other drives

2017-03-18 Thread Eryk Sun
Eryk Sun added the comment: When you say "to be precise...C:/Windows/...System32", do you mean that this is the only directory that you've tested? If so, what you're seeing may be WOW64 file-system redirection, if your 2.7 installation is 64-bit and 3.6 installation is 32-bit, or vice versa.

[issue29849] fix memory leak in import_from

2017-03-18 Thread Xiang Zhang
Changes by Xiang Zhang : -- title: fix memory in import_from -> fix memory leak in import_from ___ Python tracker ___

[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-18 Thread Martin Panter
Martin Panter added the comment: Marien’s pull request is for 2.7 and adds two new paths when raw_input is called: * On Linux (actually glibc), use “poll” rather than “select” * In other cases, if sys.stdin cannot be used with “select”, raise ValueError Marien admits that even in the best

[issue29833] Avoid raising OverflowError if possible

2017-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I don't expect that any code rely on OverflowError. > ... > As MemoryError, it's not common to catch these exceptions. So why bother making any changes here at all? It seems like an invented problem resulting in unnecessary churn, creating more work for

[issue29851] importlib.reload references None object

2017-03-18 Thread Richard Cooper
New submission from Richard Cooper: importlib.reload doesn't work; gives an error about NoneType having no name attribute. See attached a simple repo testcase When run it yields the following [disappointing] result. I'm running Python3.0.6.1 (installed from brew) on OSX 10.12.3 ```

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-18 Thread Oren Milman
Oren Milman added the comment: Here is a patch including only changes related to formats using the 'c' specifier. (I ran the test module, and on my Windows 10, the same tests failed with and without my patches. However, on my Ubuntu 16.04 VM, none of the tests failed.) -- Added file:

[issue29850] file access, other drives

2017-03-18 Thread Paul Moore
Paul Moore added the comment: Please provide a script reproducing this issue, and precise details of your Python version. It's extremely unlikely that the problem is as broad as you describe, as otherwise we'd have lots of reports of issues. But we'll need a more specific description to

[issue29850] file access, other drives

2017-03-18 Thread Gabriel POTTER
New submission from Gabriel POTTER: If python 3 is installed on another drive (for instance D:/), then it cannot access any C:/ files, but can access D:/ files. I use: open("C:/path/") The same function did work under python 2.7 but now doesn't anymore. That means that os.path.isfile,

[issue29850] file access, other drives

2017-03-18 Thread Gabriel POTTER
Gabriel POTTER added the comment: To be precise, i cannot detect (only know if the file exist) any file located in C:/Windows/... (in particulary System32) contrary to Python 2.7 where it was possible. -- ___ Python tracker

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
Oren Milman added the comment: here is the patch updated according to your suggestions, Serhiy. however, I wonder about the case of a too large _length_. shouldn't we raise a MemoryError in such a case, in accordance with #29833? BTW, while inspecting code related to a too large _length_, I

[issue29848] Cannot use Decorators of the same class that requires an instance of itself to change variables in that class.

2017-03-18 Thread R. David Murray
R. David Murray added the comment: Decorators are called with the decorated *function* objection when the class is compiled. There can be no instance involved by their very nature, since the instance doesn't exist yet. So no, you can't have a decorator that affects instance attributes at

[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-18 Thread Adam Stewart
Adam Stewart added the comment: > I'm certainly not going to try to deeply analyze a build that inserts *that* > many separate -I and -L options into the compiler calls I believe those were necessary to get the build working. Spack doesn't install anything into /usr/, and without those flags,

[issue29833] Avoid raising OverflowError if possible

2017-03-18 Thread STINNER Victor
STINNER Victor added the comment: I don't expect that any code rely on OverflowError. I don't remember any code catching explicitly this exception. As MemoryError, it's not common to catch these exceptions. I expect that Python abstract the hardware if the cost on performance is acceptable.

[issue29546] A more helpful ImportError message

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -615 ___ Python tracker ___ ___

[issue29849] fix memory in import_from

2017-03-18 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +632 ___ Python tracker ___ ___ Python-bugs-list

[issue29849] fix memory in import_from

2017-03-18 Thread Xiang Zhang
New submission from Xiang Zhang: import_from suffer from memory leak since #29546. Propose a PR to fix it. :-) -- messages: 289825 nosy: barry, brett.cannon, mbussonn, xiang.zhang priority: normal severity: normal stage: patch review status: open title: fix memory in import_from

[issue29830] pyexpat.errors doesn't have __spec__ and __loader__ set

2017-03-18 Thread Brett Cannon
Brett Cannon added the comment: ExtensionFileLoader.is_package() is accurate because it's not typical for an extension module to inject its own submodules like pyexpat is. Usually people who use an extension module in a package use it just for a submodule and not even as an __init__. IOW

[issue29822] inspect.isabstract does not work on abstract base classes during __init_subclass__

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM, but would be nice if Yury and Nick take a look. -- ___ Python tracker ___

[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-18 Thread Ned Deily
Changes by Ned Deily : -- title: ImportError: No module named _io -> ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS ___ Python tracker

[issue29846] ImportError: No module named _io

2017-03-18 Thread Ned Deily
Ned Deily added the comment: I'm not familiar with Spack and I'm certainly not going to try to deeply analyze a build that inserts *that* many separate -I and -L options into the compiler calls :) But there have been a number of reports of problems with this symptom in the past (try

[issue29833] Avoid raising OverflowError if possible

2017-03-18 Thread Guido van Rossum
Guido van Rossum added the comment: If I had to do it over again I would have used OverflowError only for some very narrowly defined conditions and ValueError for "logical" range limitations. In particular OverflowError suggests that the abstraction is slightly broken (since we usually don't

[issue29694] race condition in pathlib mkdir with flags parents=True

2017-03-18 Thread Berker Peksag
Changes by Berker Peksag : -- components: +Library (Lib) nosy: +berker.peksag stage: -> patch review ___ Python tracker ___

[issue29848] Cannot use Decorators of the same class that requires an instance of itself to change variables in that class.

2017-03-18 Thread Decorater
Decorater added the comment: hmm, I see. Well I was looking for an way to actually be able to use decorators made in the same class to be able to somehow pass in the same instance as well. Currently the only way to use class decorators is for them to be static (which would not allow using or

[issue29848] Cannot use Decorators of the same class that requires an instance of itself to change variables in that class.

2017-03-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Its not clear what you are asking for here. Do you think the current behaviour is a bug? Are you asking for a new feature? What do you want? When the decorator is called, "self" doesn't exist, so of course @self.decorator *must* fail. What else could it do?

[issue29848] Cannot use Decorators of the same class that requires an instance of itself to change variables in that class.

2017-03-18 Thread Decorater
New submission from Decorater: So, many people rely on Decorators in class that accepts an instance of itself like so: class ExampleClass: """Example class with an example decorator that cannot be used.""" def __init__(self): self.list_of_items = [] def add_item(self,

[issue29847] Path takes and ignores **kwargs

2017-03-18 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: pathlib.Path.__new__ takes **kwargs, but doesn't do anything with them (https://github.com/python/cpython/blob/master/Lib/pathlib.py#L979). This doesn't appear to be documented. This feature should presumably be either documented or removed (probably

[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-18 Thread Steve Dower
Steve Dower added the comment: I don't even think there's documentation to fix, the install page should say where things are installed. The system directory is for the system to install files - the Python installer is not a system component, it's a developer kit. For most cases, the install

[issue29846] ImportError: No module named _io

2017-03-18 Thread Adam Stewart
New submission from Adam Stewart: I'm trying to build Python 2.7.13 with clang on macOS 10.12.3 with the Spack package manager, but it fails to build the _io module. The exact error message from the build log can be seen here: https://github.com/LLNL/spack/issues/3478#issuecomment-287548431

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-18 Thread Oren Milman
Oren Milman added the comment: Here is a patch including only changes related to PyLong_As* and PyArg_Parse* functions. (I ran the test module, and on my Windows 10, the same tests failed with and without my patches. However, on my Ubuntu 16.04 VM, none of the tests failed.) -- Added

[issue29822] inspect.isabstract does not work on abstract base classes during __init_subclass__

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +ncoghlan ___ Python tracker ___ ___

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Opened issue29845 for _testcapi issues. -- ___ Python tracker ___ ___

[issue29845] Mark tests that use _testcapi as CPython-only

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +631 ___ Python tracker ___ ___

[issue29845] Mark tests that use _testcapi as CPython-only

2017-03-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Most tests that use _testcapi are optional or marked as CPython-only. But there are few tests that aren't. Proposed patch fixes this. -- components: Tests messages: 289812 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review

[issue24796] Deleting names referencing from enclosed and enclosing scopes

2017-03-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It looks like it is safe to just remove this line from docs. This code >>> x = 1 >>> def f(): ... global x ... del x ... >>> f() >>> x Works as expected, i.e. raises NameError. (The same happens for nonlocal but with UnboundLocalError.) --

[issue21253] unittest assertSequenceEqual can lead to Difflib.compare() crashing on mostly different sequences

2017-03-18 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

[issue28980] ResourceWarning when imorting antigravity in 3.6

2017-03-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It looks like this is fixed on master, but the problem still appears on 3.6 -- ___ Python tracker ___

[issue29734] nt._getfinalpathname handle leak

2017-03-18 Thread Mark Becwar
Changes by Mark Becwar : -- pull_requests: -628 ___ Python tracker ___ ___

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm working on this. Right now I'm searching other tests that use _testcapi without guards. -- ___ Python tracker

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
Oren Milman added the comment: yes, you are right, of course. but regardless of this issue, shouldn't test_structures.py be changed (in a seperate issue)? ISTM it has a cpython-specific test not decorated in @cpython_only. -- ___ Python tracker

[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-18 Thread Eryk Sun
Eryk Sun added the comment: 3.5+ doesn't install files to system directories -- except the py launcher in %SystemRoot%. This was an intentional change, so I'm flagging this as a documentation issue. -- assignee: -> docs@python components: +Documentation, Windows keywords: +easy nosy:

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I suggest just remove the test with LONG_MAX. -- ___ Python tracker ___

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
Oren Milman added the comment: "If use _testcapi the tests should be decorated with cpython_only." at first, I thought so too, but then I searched for 'cpython_only' in Lib/ctypes/test, and found nothing. then I searched for '_testcapi' there, and found a top level 'import _testcapi' in

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM, but I prefer `overflow > 0` over `overflow == 1`. If use _testcapi the tests should be decorated with cpython_only. But I think that it is better to not use it. Limiting _length_ to C long (rather than size_t) is an implementation detail. The test

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 709 fixes the order of types for concatenating bytes and and bytearray. b''+0 will raise "can't concat str to bytes" rather than "can't concat bytes to str". PR 710 makes error message for str concatenation more informative and similar to error messages

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +630 ___ Python tracker ___ ___

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +629 ___ Python tracker ___ ___

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
Oren Milman added the comment: A patch draft (which doesn't change anything about the case of _length_ == 0) is attached. (I am not opening a PR, because I am not sure the behavior change would be accepted.) I ran the test module on my Windows 10, and it seems the patch doesn't break anything.

[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-18 Thread Paul "TBBle" Hampson
Changes by Paul "TBBle" Hampson : -- components: +Installation type: -> behavior ___ Python tracker ___

[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-18 Thread Paul "TBBle" Hampson
New submission from Paul "TBBle" Hampson: As noted in https://github.com/python/cpython/tree/master/Tools/msi === When installed for all users, the following files are installed to either "%SystemRoot%\System32" or "%SystemRoot%\SysWOW64" as appropriate. For the current user, they are installed

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
New submission from Oren Milman: With regard to ctypes.Array: currently: >>> from ctypes import * >>> class T(Array): ... _type_ = c_int ... _length_ = -1 ... Traceback (most recent call last): File "", line 1, in OverflowError: array too large >>> class T(Array): ... _type_ =

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: it is hard to discuss such large patch on GitHub since diffs and comments to all files are shown on one page. Rietveld is more appropriate since it shows only one file at the time. I suggest you Oren to provide the next version of your patch as a patch for

[issue29834] Raise ValueError rather of OverflowError in PyLong_AsUnsignedLong()

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: _Py_Uid_Converter() in Modules/posixmodule.c is not an example because it calls PyLong_AsUnsignedLong() only for positive integers > LONG_MAX. PyLong_AsUnsignedLong() is used not much. The motivation of this issue was that if use PyLong_AsUnsignedLong() for

[issue29834] Raise ValueError rather of OverflowError in PyLong_AsUnsignedLong()

2017-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Looking back in time, this API isn't as old as I thought. The other concerns about breaking a published API still stand. -- nosy: -gvanrossum ___ Python tracker

[issue29834] Raise ValueError rather of OverflowError in PyLong_AsUnsignedLong()

2017-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Strong -1 on this. For zero benefit, this breaks everything (within Python and third-party code) that ever relied on the documented behavior , https://docs.python.org/3/c-api/long.html#c.PyLong_AsUnsignedLong . The cause perfectly fits the definition of

[issue29833] Avoid raising OverflowError if possible

2017-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: IIRC, there have been previous discussions about little inconsistencies between when objects raise an OverflowError versus MemoryError and IndexError, and ValueError. I believe that Guido had opined that the choices were made somewhat arbitrarily (by

[issue29822] inspect.isabstract does not work on abstract base classes during __init_subclass__

2017-03-18 Thread Nate Soares
Nate Soares added the comment: I didn't know about issue29638, and I'm not sure whether my PR fixes it. Looking at that bug, I don't think that my PR would fix it, because I still trust TPFLAGS_IS_ABSTRACT when __abstractmethods__ exists. That said, I'm not clear on how the cache works, so

[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -602 ___ Python tracker ___ ___

[issue29572] Upgrade installers to OpenSSL 1.0.2k

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -579 ___ Python tracker ___ ___

[issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -599 ___ Python tracker ___ ___

[issue28692] gettext: deprecate selecting plural form by fractional numbers

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -605 ___ Python tracker ___ ___

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -590 ___ Python tracker ___ ___