[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-06 Thread Raúl Núñez de Arenas
Raúl Núñez de Arenas added the comment: Thanks for the information, Eryk, I've read the blog. -- ___ Python tracker ___

[issue26496] Exhausted deque iterator should free a reference to a deque

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This should be not very hard. It is just reminder to me, I'll write a patch after closing related issue26494 and issue26492. -- dependencies: +Double deallocation on iterator exhausting ___ Python tracker

[issue26496] Exhausted deque iterator should free a reference to a deque

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think this is even slightly important but will take a look to see if there is an easy way to incorporate it that doesn't mess-up previous efforts to fine-tune the iterator. -- assignee: -> rhettinger priority: normal -> low

[issue11477] Incorrect operand precedence when implementing sequences in C

2016-03-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue13298] Result type depends on order of operands for bytes and bytearray

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: An issue with bytes.join() is already fixed (issue15958). -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue25246] Alternative algorithm for deque_remove()

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is more optimal approach. Find not just an index in a deque, but a block and an index in a block. After that move left or right part of a deque one position right or left. __delitem__() could be 2 times faster, remove() could be faster too. Helpers

[issue26496] Exhausted deque iterator should free a reference to a deque

2016-03-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: Exhausted dequeue iterator should free a reference to a deque -> Exhausted deque iterator should free a reference to a deque ___ Python tracker

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK ‘general category “Nd” ’ is the same as ‘the property value Numeric_Type=Decimal’. Yet one related predicate is str.isnumeric(). https://docs.python.org/3/library/stdtypes.html?#str.isnumeric Return true if all characters in the string are numeric

[issue26498] _io.so flat namespace

2016-03-06 Thread Larry
New submission from Larry: On OSX El Capitan, Python v2.7.10 and 2.7.11 (standard installer)... When importing urllib2 it crashes with a flat namespace error then loading _io.so. Shortest test case: "python -c 'import urllib2'" Traceback (most recent call last): File "", line 1, in File

[issue24852] Python 3.5.0rc1 "HOWTO Use Python in the web" needs fix

2016-03-06 Thread Berker Peksag
Berker Peksag added the comment: See issue 26497 for another report about this. I will remove Doc/howto/webservers.rst. -- versions: -Python 3.4 ___ Python tracker

[issue26497] Documentation - HOWTO Use Python in the web paragraph on TurboGears still mentions it's based on Pylons

2016-03-06 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. Actually, the whole document is outdated. I think we can mark this as a duplicate of issue 24852. -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python 3.5.0rc1 "HOWTO

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-06 Thread Martin Panter
Martin Panter added the comment: The documentation could certainly be clarified to say that all decimals, as determined by isdecimal(), are also digits as determined by isdigit(). IMO the current documentation is confusing or wrong to stay that decimals ‘include digit characters’; it is

[issue26497] Documentation - HOWTO Use Python in the web paragraph on TurboGears still mentions it's based on Pylons

2016-03-06 Thread Alessandro Molina
New submission from Alessandro Molina: https://docs.python.org/3.6/howto/webservers.html#turbogears still mentions "TurboGears 2 is based on the WSGI stack of another popular component-based web framework, Pylons." which is not true anymore since TurboGears 2.3.0. TurboGears switched to its

[issue25652] collections.UserString.__rmod__() raises NameError

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about such example? >>> class F: ... def __init__(self, value): ... self.value = value ... def __mod__(self, other): ... if isinstance(other, str): ... return self.value % other ... return NotImplemented ...

[issue25652] collections.UserString.__rmod__() raises NameError

2016-03-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I admit I don't understand what __rmod__ is meant to achieve here, and following str's behaviour sounds like a reasonable decision. -- ___ Python tracker

[issue25652] collections.UserString.__rmod__() raises NameError

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Antoine, do you have any thoughts on this one? I'm inclined to remove __rmod__ entirely. That would match what str does and it avoids having to guess what the user meant when writing "A(s) % UserString(t)" when A does not have a __mod__ formatting

[issue26494] Double deallocation on iterator exhausting

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch fixes also set, dict and os.scandir() iterator. May be sqlite3 cursor needs a fix, but it is too complicated. -- Added file: http://bugs.python.org/file42081/free_after_iterating_2.patch ___ Python

[issue16113] Add SHA-3 (Keccak) support

2016-03-06 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue16113] Add SHA-3 (Keccak) support

2016-03-06 Thread Dror Levin
Changes by Dror Levin : -- nosy: +spatz ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset eb120f50df4a by Alexander Belopolsky in branch 'default': Closes #19475: Added timespec to the datetime.isoformat() method. https://hg.python.org/cpython/rev/eb120f50df4a -- nosy: +python-dev resolution: -> fixed stage: commit review ->

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-06 Thread Eryk Sun
Eryk Sun added the comment: When Python creates an exception generically from a Windows error code, it calls WinAPI FormatMessage with the flag FORMAT_MESSAGE_IGNORE_INSERTS. The reason for this is explained in a blog post written by Raymond Chen[1]: "when you are not in control of the

[issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions

2016-03-06 Thread Antti Haapala
Antti Haapala added the comment: super() without arguments gives proper "super() without arguments" in functions, generator functions nested in methods, if *those* do not have arguments. But if you use super() in a nested function that takes an argument, or in a generator expression or a

[issue26496] Exhausted dequeue iterator should free a reference to a deque

2016-03-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: It is common that exhausted iterator frees a reference to iterating sequence. All builtin sequences (list, tuple, str, bytes, bytearray), set and dict support this. It would be nice if dequeue will support this too. -- components: Extension

[issue26495] super() does not work nested

2016-03-06 Thread Antti Haapala
New submission from Antti Haapala: super() without arguments is -- messages: 261264 nosy: ztane priority: normal severity: normal status: open title: super() does not work nested ___ Python tracker

[issue26494] Double deallocation on iterator exhausting

2016-03-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Following example causes double deallocation of a sequence and crashing. class A(list): def __del__(self): next(it) it = iter(A()) next(it) The same is for subclass of tuple, str, bytes and bytearray. Proposed patch fixes this issue.

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-06 Thread Raúl Núñez de Arenas
New submission from Raúl Núñez de Arenas: Python 3.5.1 x64 @ Windows 10 x64 The error message in the traceback for OSError/WinError 193 has bad formatting and the offending file name is not printed. For example, this code: import subprocess testfile = open('testfile.notexecutable',

[issue15948] Unchecked return value of I/O functions

2016-03-06 Thread Berker Peksag
Changes by Berker Peksag : -- dependencies: +Missing sanity checks for various C library function calls... ___ Python tracker

[issue19142] Cross-compile fails trying to execute foreign pgen on build host

2016-03-06 Thread Marc Duponcheel
Marc Duponcheel added the comment: one workaround is to build native in separate directory and to use the native build Parser/pgen and Programs/_freeze_importlib for cross compilation host build. -- nosy: +Marc Duponcheel ___ Python tracker

[issue26492] Exhausted array iterator should left exhausted

2016-03-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There is general rule that after raising StopIteration the iterator should always raise StopIteration even if new data is added to iterating sequence. Array iterators don't obey this rule. Proposed patch makes array iterator to left in exhausted state

[issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools

2016-03-06 Thread Berker Peksag
Berker Peksag added the comment: I think it would be better to just remove the following part from the documentation: "Of course, you need to install them into the venv first: this could be done by running ez_setup.py with the venv activated, followed by running easy_install pip.

[issue25776] More compact pickle of iterators etc

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch is synchronized with current sources. Added mandatory braces. -- Added file: http://bugs.python.org/file42077/iterators_pickle_3.patch ___ Python tracker

[issue25776] More compact pickle of iterators etc

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is the extra special case code for bytes and bytearray iterators and reversed list iterator. The patch just extends the optimizations to other builtin iterators. In the example with itertools.islice() the overhead of pickling redundant data is 20%.

[issue26489] dictionary unpacking operator in dict expression

2016-03-06 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch! Could you please sign the contributor's agreement at https://www.python.org/psf/contrib/contrib-form/ ? -- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed

[issue26489] dictionary unpacking operator in dict expression

2016-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset a34428aff42d by Berker Peksag in branch '3.5': Issue #26489: Add dictionary unpacking support to Tools/parser/unparse.py https://hg.python.org/cpython/rev/a34428aff42d New changeset 1b212e366b66 by Berker Peksag in branch 'default': Issue #26489:

[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-03-06 Thread Berker Peksag
Berker Peksag added the comment: Thanks, Mathieu! I went with a simpler approach to test the code. -- keywords: -needs review nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> behavior

[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset d135799e952b by Berker Peksag in branch '2.7': Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls https://hg.python.org/cpython/rev/d135799e952b -- ___ Python tracker

[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 22eab50cb585 by Berker Peksag in branch '3.5': Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls https://hg.python.org/cpython/rev/22eab50cb585 New changeset 046c75c9cd33 by Berker Peksag in branch 'default':

[issue25652] collections.UserString.__rmod__() raises NameError

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In normal case there is no infinite recursion in collections.UserString1, since UserString.__rmod__(S) falls back to S.__mod__(str) or str.__rmod__(S). >>> S('say %s') % UserString('hello') Traceback (most recent call last): File "", line 1, in File

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2016-03-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.4 ___ Python tracker

[issue26015] Add new tests for pickling iterators of mutable sequences

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 2.7 iterators are not pickleable. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 ___ Python tracker

[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2016-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset f3c54cbac3de by Serhiy Storchaka in branch '3.5': Issue #25718: Fixed pickling and copying the accumulate() iterator with total is None. https://hg.python.org/cpython/rev/f3c54cbac3de New changeset 49c035b30e18 by Serhiy Storchaka in branch

[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2016-03-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: I don't see possible bug here. The first item of the tuple is always int or None. It's decrefing don't trigger executing user code. The second item of the tuple is decrefed when the refcount of the tuple is 2 and we own all references. The code triggered

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Then go ahead with the patch as is. -- ___ Python tracker ___ ___

[issue26015] Add new tests for pickling iterators of mutable sequences

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: These tests look fine. I won't miss "orgit" ;-) In test_reversed_pickle, please add the blank line before each section like you did for the other tests. I agree that exhausted array iterator should change to match the others. Once an iterator is

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > This looks nicer and should run faster by taking advantage of the LIST_APPEND > opcode. The difference is insignificantly (less than 1%) for large lists (list(range(1))), but it is 3-4% slower for small lists (list(range(10))) and 20-25% slower for

[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- assignee: rhettinger -> serhiy.storchaka ___ Python tracker ___

[issue26490] Leading “0” allowed, only for decimal zero

2016-03-06 Thread Berker Peksag
Changes by Berker Peksag : -- superseder: -> Deprecate 0 as a synonym for 0 ___ Python tracker ___

[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2016-03-06 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: serhiy.storchaka components: Interpreter Core files: enumerate_defer_decref.diff keywords: patch nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Defer

[issue25776] More compact pickle of iterators etc

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: My first impression is that this isn't worth the extra special case code. The savings is very small (only a few bytes) and it isn't common to pickle these iterators. -- ___ Python tracker

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: One suggestion: def _deepcopy_list(x, memo, deepcopy=deepcopy): y = [] memo[id(x)] = y y[:] = [deepcopy(a, memo) for a in x] return y This looks nicer and should run faster by taking advantage of the LIST_APPEND opcode.

[issue25652] collections.UserString.__rmod__() raises NameError

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: The UserString1 patch is incorrect as it leads to infinite recursion because the __rmod__ operation only gets called when the other argument doesn't have __mod__. One possible fix is to coerce the template to a regular str: def __rmod__(self,