[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset cb632988bc09 by Victor Stinner in branch 'default': Issue #21118: PyLong_AS_LONG() result type is long http://hg.python.org/cpython/rev/cb632988bc09 -- ___ Python tracker

[issue21175] Refcounting error in str.translate fastpath

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: > New changeset fa6debebfe8b by Benjamin Peterson in branch 'default': > fix reference leaks in the translate fast path (closes #21175) > http://hg.python.org/cpython/rev/fa6debebfe8b Thanks Benjamin for the quick fix! -- __

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-04-08 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-08 Thread Konstantin Zemlyak
New submission from Konstantin Zemlyak: Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> bytearray([256]) Traceback (most recent call last): File "", line 1, in ValueError:

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: 256 is not part of the range(0, 256): 0..255. $ python >>> print(list(range(0,256))) [0, 1, 2, 3, ..., 253, 254, 255] It doesn't make sense to store the number 256 in a byte string. -- nosy: +haypo ___ Python tracke

[issue21041] pathlib.PurePath.parents rejects negative indexes

2014-04-08 Thread akira
akira added the comment: >From https://docs.python.org/3/glossary.html#term-sequence > An iterable which supports efficient element access using integer indices via > the __getitem__() special method and defines a __len__() method that returns > the length of the sequence. .parents *is* a seq

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-08 Thread Stefan Krah
Stefan Krah added the comment: I think it's possible to misunderstand this error message if the reader does not realize that range(0, 256) is to be taken literally. Perhaps we should just use closed intervals of the form [0, 255] everywhere. -- nosy: +skrah

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: "Perhaps we should just use closed intervals of the form [0, 255] everywhere." I only saw range(0, 256) in Python. At school, I used [0, 255]. I prefer [0, 255] syntax, it's more explicit :-) -- ___ Python tracker

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-08 Thread Peter Otten
Peter Otten added the comment: As every beginner will learn about (and probably overuse) range() pretty soon I think it's OK to use that form. The math-inspired notation [0, 255] may be misinterpreted as a list. You also lose the consistency of preferring half-open intervals everywhere. The

[issue21178] doctest cause warnings in tests using generators

2014-04-08 Thread Ontje Lünsdorf
New submission from Ontje Lünsdorf: The attached doctest raises a warning since Python 3.4: $ python -m doctest doctest.txt Exception ignored in: Traceback (most recent call last): File "", line 4, in foo NameError: name 'socket' is not defined My guess is that doctest cleans up globals() of

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: > The math-inspired notation [0, 255] may be misinterpreted as a list. You also > lose the consistency of preferring half-open intervals everywhere. Not if you write "x must in the range [0; 255]". -- ___ Python tra

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-08 Thread Vinay Sajip
Vinay Sajip added the comment: I wouldn't say it is a bug, as it is working as documented - though you might say it is a request for enhancement. The documentation for string formatting at https://docs.python.org/2/library/stdtypes.html#string-formatting-operations says that the argument shoul

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-08 Thread Vinay Sajip
Changes by Vinay Sajip : -- type: behavior -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue21179] Rounding half to even

2014-04-08 Thread Clinton Curry
New submission from Clinton Curry: In the current Python 2.7 documentation, Section 5.4 https://docs.python.org/2.7/library/stdtypes.html the result of the round function is described as "x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0." However, my observed b

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-08 Thread Vinay Sajip
Vinay Sajip added the comment: Looking into it further, I see no incidence in logging code of the string "format requires a mapping" or of raising a TypeError with such a message. Can you provide more information? Otherwise I will have to close this issue as invalid. -- resolution: -

[issue21178] doctest cause warnings in tests using generators

2014-04-08 Thread Ontje Lünsdorf
Ontje Lünsdorf added the comment: Sorry, the test does not really expose the problem with Python 3.4. Here is an updated example. Python 2.7 and 3.3 succeed without warnings, while Python 3.4 warns about an ignored exception. -- Added file: http://bugs.python.org/file34761/doctest.txt

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-08 Thread Alan Briolat
Alan Briolat added the comment: Because the object in question is not actually a dict, LogRecord is attempting, in this example, "%(bar)s" % (f,) instead of "%(bar)s" % f. In unicodeobject.c this causes the PyMapping_Check in PyUnicode_Format to fail because it's a tuple (note that PyMapping_C

[issue17145] memoryview(array.array)

2014-04-08 Thread Paul Sokolovsky
Changes by Paul Sokolovsky : -- nosy: +pfalcon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21180] Cannot efficiently create empty array.array of given size, inconsistency with bytearray

2014-04-08 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: With bytearray, you can do: >>> bytearray(3) bytearray(b'\x00\x00\x00') However, with arrays: >>> array.array('i', 3) Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not iterable Given that int passed as seconf argument

[issue9066] Standard type codes for array.array, same as struct

2014-04-08 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > It's not clear to me that importing specifier prefixes from the struct module > is the best way to go about this, though. What are other alternatives then? Using struct's syntax has obvious benefit of being consistent and not confusing people any further.

[issue9066] Standard type codes for array.array, same as struct

2014-04-08 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: See also http://bugs.python.org/issue17345 -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue17345] Portable and extended type specifiers for array module

2014-04-08 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: See also http://bugs.python.org/issue9066 -- nosy: +pfalcon ___ Python tracker ___ ___ Python-bugs-

[issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

2014-04-08 Thread Larry Hastings
Larry Hastings added the comment: I have no objections to someone backporting this. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's what I consider a complete patch. -- assignee: belopolsky -> benjamin.peterson Added file: http://bugs.python.org/file34762/mat-mult5.patch ___ Python tracker ___

[issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset b2187b82a658 by Benjamin Peterson in branch '3.4': PySequence_Fast generally returns a list not a tuple (closes #16395) http://hg.python.org/cpython/rev/b2187b82a658 New changeset b235db467cd5 by Benjamin Peterson in branch '2.7': PySequence_Fast ge

[issue16305] possible segfault in math.factorial

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3016a9e8061a by Benjamin Peterson in branch '2.7': PySequence_Fast generally returns a list (#16305) http://hg.python.org/cpython/rev/3016a9e8061a -- ___ Python tracker

[issue16305] possible segfault in math.factorial

2014-04-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: (Obviously that last message should have gone to #16395 instead.) -- nosy: +benjamin.peterson ___ Python tracker ___

[issue20924] openssl init 100% CPU utilization

2014-04-08 Thread Roman O. Vlasov
Roman O. Vlasov added the comment: Antoine, Martin, thank you for your replies. You was right: NT socket was not in blocking mode (in 1st case). I didn't knew how to determine socket mode in NT, so I explicitly set socket mode to blocking in _ssl.c before calling SSL_do_handshake() for test:

[issue21117] inspect.signature: inaccuracies for partial functions

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset acbdbf2b06e0 by Yury Selivanov in branch '3.4': inspect.signautre: Fix functools.partial support. Issue #21117 http://hg.python.org/cpython/rev/acbdbf2b06e0 New changeset 21709cb4a8f5 by Yury Selivanov in branch 'default': inspect.signautre: Fix fun

[issue21117] inspect.signature: inaccuracies for partial functions

2014-04-08 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue20334] make inspect Signature hashable

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 932d69ef0c63 by Yury Selivanov in branch 'default': inspect: Make Signature and Parameter hashable. Issue #20334. http://hg.python.org/cpython/rev/932d69ef0c63 -- nosy: +python-dev ___ Python tracker

[issue20334] make inspect Signature hashable

2014-04-08 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue19281] add __objclass__ to the docs

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0973d45197cc by Yury Selivanov in branch '3.4': docs: Document __objclass__. Closes #19281. http://hg.python.org/cpython/rev/0973d45197cc New changeset 2a953cb5642d by Yury Selivanov in branch 'default': docs: Document __objclass__. Closes #19281. h

[issue21144] ensurepip "AssertionError: Multiple .dist-info directories"

2014-04-08 Thread Nikolaus Demmel
Nikolaus Demmel added the comment: I could resolve this by removing /usr/local/lib/python3.4/site-packages and then retrying. Now I cannot reproduce this issue any more. Maybe we can close this issue. -- ___ Python tracker

[issue21139] Idle: change default reformat width from 70 to 72

2014-04-08 Thread Saimadhav Heblikar
Changes by Saimadhav Heblikar : Added file: http://bugs.python.org/file34764/issue21139-34.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue21139] Idle: change default reformat width from 70 to 72

2014-04-08 Thread Saimadhav Heblikar
Saimadhav Heblikar added the comment: Attaching a patch for 2.7 and 3.4 The comment strings are modified to reflect 70->72 in the tests. -- keywords: +patch Added file: http://bugs.python.org/file34763/issue21139-27.patch ___ Python tracker

[issue21181] Inconsistent Definition of collections.namedtuple.__dict__ in _source

2014-04-08 Thread Jim Peterson
New submission from Jim Peterson: The result returned by somenamedtuple._source seem inconsistent, in that it defines __dict__ as: __dict__ = property(_asdict) even though it imports property as: from builtins import property as _property and the namedtuple fields are defined using _prop

[issue21146] update gzip usage examples in docs

2014-04-08 Thread Wolfgang Maier
Wolfgang Maier added the comment: ok, I've prepared the patch using the elegant shutil solution. -- keywords: +patch Added file: http://bugs.python.org/file34765/gzip_example_usage_patch.diff ___ Python tracker ___

[issue21180] Cannot efficiently create empty array.array of given size, inconsistency with bytearray

2014-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> array.array('i', [0]) * 3 array('i', [0, 0, 0]) -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue19281] add __objclass__ to the docs

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 372b19005011 by Yury Selivanov in branch '3.4': docs: Better wording for __objclass__ docs. Issue #19281 http://hg.python.org/cpython/rev/372b19005011 New changeset febd63a7e927 by Yury Selivanov in branch 'default': docs: Better wording for __objcl

[issue21144] ensurepip "AssertionError: Multiple .dist-info directories"

2014-04-08 Thread Ned Deily
Ned Deily added the comment: That error appears to be coming from wheel.py inside of pip. So, if you do want to pursue it, you should probably be asking on the pip tracker: https://github.com/pypa/pip/issues -- nosy: +ned.deily resolution: -> 3rd party stage: -> committed/rejected s

[issue11588] Add "necessarily inclusive" groups to argparse

2014-04-08 Thread paul j3
paul j3 added the comment: http://stackoverflow.com/questions/22929087 A question that could be addressed with this patch(es) In a subparser: I have 4 arguments: -g, -wid, -w1, and -w2. -w1 and -w2 always appear together -wid and (-w1 -w2) are mutually exclusive, but one or the ot

[issue9066] Standard type codes for array.array, same as struct

2014-04-08 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.rosenberg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue21181] Inconsistent Definition of collections.namedtuple.__dict__ in _source

2014-04-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue21181] Inconsistent Definition of collections.namedtuple.__dict__ in _source

2014-04-08 Thread Eric Snow
Changes by Eric Snow : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-08 Thread Kushal Das
Kushal Das added the comment: Here is a patch which stops the breakage in getpass for python3. -- keywords: +patch nosy: +kushaldas Added file: http://bugs.python.org/file34766/issue21169.patch ___ Python tracker _

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-08 Thread Kushal Das
Kushal Das added the comment: Version 2 of the patch with a test update. -- Added file: http://bugs.python.org/file34767/issue21169_v2.patch ___ Python tracker ___ __

[issue21182] json.loads errors out on valid JSON

2014-04-08 Thread Yakov Keselman
New submission from Yakov Keselman: Run the following Python JSON parsing script on valid JSON: import json json.loads( '["[\"Residential | Furniture | Cabinets\",\"119.99\"]"]' ) Result: Traceback (most recent call last): File "", line 1, in File "C:\Python33\lib\json\__init__.py", line

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-08 Thread Vinay Sajip
Vinay Sajip added the comment: Thanks for pinpointing what the issue is. > checking for isinstance(..., dict) is still wrong - it should at least > be collections.Mapping to give users a chance to emulate the correct > interface. That seems reasonable. -- resolution: invalid -> _

[issue21166] Bus error on "AMD64 FreeBSD 9.x 3.4" buildbot

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: I still don't understand the issue but... it's now fixed (I don't understand why), so I'm closing it. -- resolution: -> fixed status: open -> closed ___ Python tracker __

[issue21168] unicodeobject.c: likely type-punning may break strict-aliasing rules

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: This issue was a follow up of issue #21166, but in fact the two issues are unrelated, and this issue is a false alarm. I don't see how to make the GCC warning quiet, and GCC 4.2 is now old, so I'm closing the issue. -- resolution: -> wont fix status:

[issue5845] rlcompleter should be enabled automatically

2014-04-08 Thread David Beazley
David Beazley added the comment: Funny thing, this feature breaks the interactive interpreter in the most basic way on OS X systems. For example, the tab key won't even work to indent. You can't even type the most basic programs into the interactive interpreter. For example: >>> for i in r

[issue21147] sqlite3 doesn't complain if the request contains a null character

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: Here is a first patch. I only tested the execute() method. -- keywords: +patch nosy: +ghaering Added file: http://bugs.python.org/file34768/sqlite_null.patch ___ Python tracker ___

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: "However, I'd still like to discuss the idea of backporting this to 3.4.1." THe idea of doing this change in Python 3.5 is that I have no idea of the risk of regression. To backport such change in a minor version (3.4.1), I would feel more confident with user

[issue20644] OS X installer build broken by changes to documentation build

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 01f1e14cad23 by Ned Deily in branch '3.4': Issue #20644: OS X installer build support for documentation build changes http://hg.python.org/cpython/rev/01f1e14cad23 New changeset 7d004ad09bf5 by Ned Deily in branch 'default': Issue #20644: merge from

[issue21181] Inconsistent Definition of collections.namedtuple.__dict__ in _source

2014-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: > whatever compelled the developer to declare the named fields > using _property seems to be ignored in the definition of __dict__. What compelled the _property alias is that the user could name an attribute "property" which would cause a conflict if _prope

[issue20644] OS X installer build broken by changes to documentation build

2014-04-08 Thread Ned Deily
Ned Deily added the comment: build-installer.py now assumes that sphinx-build and the previously required hg have been installed somewhere on the restricted PATH that the installer uses. Behind the scenes, the installer build process has been substantially revised to make use of a bootstrappe

[issue21119] asyncio create_connection resource warning

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: Updated patch (close-3.patch) combining create_connection_close.patch and close2.patch and adding unit tests. I also improved the create_connection() test to raise the TimeoutError on connect() (loop.sock_connect), not on sock.set_blocking(). -- Adde

[issue21088] curses addch() argument position reverses in Python3.4.0

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: Here is a patch. I don't see how to write a unit test. -- keywords: +patch Added file: http://bugs.python.org/file34770/addch.patch ___ Python tracker _

[issue21088] curses addch() argument position reverses in Python3.4.0

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: > Redirecting the test to a file fails because curses complains stdio isn't a > tty. You may create a the pty module for that. https://docs.python.org/dev/library/pty.html#pty.openpty -- ___ Python tracker

[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-08 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. -- type: behavior -> enhancement versions: -Python 2.7, Python 3.4 ___ Python tracker ___ _

[issue21179] Rounding half to even

2014-04-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Python 3.2-3.4 (probably all of 3.x) use round half even, but testing 2.7.3 on Ubuntu confirms what you say. In terms of the decimal constants, Py2.7 round() appears to use decimal.ROUND_HALF_UP behavior while 3.x uses decimal.ROUND_HALF_EVEN behavior. Looks

[issue21097] Move test_namespace_pkgs into test_importlib.

2014-04-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 99265d30fa38 by Ned Deily in branch '3.4': Issue #21097: Update Makefile with changed install locations of test directories. http://hg.python.org/cpython/rev/99265d30fa38 New changeset 7aae2b9fcfad by Ned Deily in branch 'default': Issue #21097: me

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Osvaldo Santana Neto
New submission from Osvaldo Santana Neto: The following doctest should pass, but it fails: >>> def spam(): print("eggs") ... >>> assert spam() eggs Traceback (most recent call last): AssertionError But if we remove the print output from printed results the test pass:

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Tim Peters
Tim Peters added the comment: The first footnote in the docs explain this: Examples containing both expected output and an exception are not supported. Trying to guess where one ends and the other begins is too error-prone, and that also makes for a confusing test. So, sorry, bu

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Osvaldo Santana Neto
Osvaldo Santana Neto added the comment: Hi Tim, I tried to find more information in documentation before opening this bug but I need to confess that I didn't read the footnote. Thanks and sorry for the invalid report. -- resolution: -> invalid status: open -> closed

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Personally, I think that the second reason given in the footnote, that it makes for confusing tests, is bogus, or at least it's a matter of opinion. I for one don't think they are confusing, and would like to see mixed output/tracebacks supported. Tim, would

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Tim Peters
Tim Peters added the comment: Steven, no objection here. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue21170] Incorrect signature for unittest.TestResult.startTestRun(), .stopTestRun()

2014-04-08 Thread Kushal Das
Kushal Das added the comment: Here is a patch which fixes the documentation for unittest. -- keywords: +patch nosy: +kushaldas Added file: http://bugs.python.org/file34772/issue21170.patch ___ Python tracker __

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-08 Thread Steven D'Aprano
New submission from Steven D'Aprano: If you know the population mean mu, you should calculate the sample variance by passing mu as an explicit argument to statistics.pvariance. Unfortunately, it doesn't work as designed: py> data = [1, 2, 2, 2, 3, 4] # sample from a population with mu=2.5 py>

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- resolution: invalid -> stage: -> needs patch status: closed -> open type: behavior -> enhancement versions: +Python 3.5 -Python 2.7, Python 3.4 ___ Python tracker _

[issue21182] json.loads errors out on valid JSON

2014-04-08 Thread Kushal Das
Kushal Das added the comment: It is not a valid JSON. You may want to validate it against http://jsonlint.com/ What you have inside the string (single quotes) is the JSON representation but not the string representation which json.loads is supposed to parse. -- nosy: +kushaldas __

[issue21088] curses addch() argument position reverses in Python3.4.0

2014-04-08 Thread Larry Hastings
Larry Hastings added the comment: How about examining the inspect.Signature? -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue21170] Incorrect signature for unittest.TestResult.startTestRun(), .stopTestRun()

2014-04-08 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +ezio.melotti, michael.foord stage: -> patch review versions: +Python 3.5 ___ Python tracker ___