[issue22687] horrible performance of textwrap.wrap() with a long word

2014-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Current regex produces insane result. $ ./python -c import textwrap; print(textwrap.wrap('this-is-a-useful-feature', width=1, break_long_words=False)) ['this-', 'is-a', '-useful-', 'feature'] Antoine's regex produces more correct result for this case:

[issue22687] horrible performance of textwrap.wrap() with a long word

2014-11-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: But this is not totally correct, one-letter word should not be separated. Why not? I guess it depends on English's rules for word splitting, which I don't know. In any case, this issue is not about improving correctness, only performance. --

[issue22687] horrible performance of textwrap.wrap() with a long word

2014-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why not? I guess it depends on English's rules for word splitting, which I don't know. I suppose this is common rule in many languages. And current code supports it (there is a special code in the regex to ensure this rule). In any case, this issue is

[issue22687] horrible performance of textwrap.wrap() with a long word

2014-11-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: I suppose this is common rule in many languages. I frankly don't know about this rule. And the tests don't check for it, so for me it's not broken. -- ___ Python tracker rep...@bugs.python.org

[issue22851] core crashes

2014-11-12 Thread Matthias Klose
New submission from Matthias Klose: seen with the current 2.7 branch: $ cat x.py def foo(): yield gen = foo() print gen.gi_frame.f_restricted for i in gen: pass print gen.gi_frame gen = foo() print gen.next() print gen.gi_frame.f_restricted $ python x.py False None None Segmentation fault

[issue22852] urllib.parse wrongly strips empty #fragment

2014-11-12 Thread Stian Soiland-Reyes
New submission from Stian Soiland-Reyes: urllib.parse can't handle URIs with empty #fragments. The fragment is removed and not reconsituted. http://tools.ietf.org/html/rfc3986#section-3.5 permits empty fragment strings: URI-reference = [ absoluteURI | relativeURI ] [ # fragment ]

[issue22851] core crashes

2014-11-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22851 ___ ___ Python-bugs-list

[issue22852] urllib.parse wrongly strips empty #fragment

2014-11-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22852 ___ ___ Python-bugs-list mailing

[issue22687] horrible performance of textwrap.wrap() with a long word

2014-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tests are not perfect. But this is intentional design. The part of initial regex: r'\w{2,}-(?=\w{2,})|' # hyphenated words Now it is more complicated. Note '(?=\w{2,})'. -- ___ Python tracker

[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) -- nosy: +eryksun

[issue22853] Multiprocessing.Queue._feed deadlocks on import

2014-11-12 Thread Florian Finkernagel
New submission from Florian Finkernagel: If you import a module that creates a multiprocessing.Queue, puts a value, and then waits for to be received again from the queue, you run into a deadlock. The issue is that Queue._feed does 'from .util import is_existing' - which needs the import

[issue22850] Backport ensurepip Windows installer changes to 2.7

2014-11-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'm not working on Python 2.7 anymore, so I can't offer help. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22850 ___

[issue22851] core crashes

2014-11-12 Thread STINNER Victor
STINNER Victor added the comment: Related change: New changeset aa324af42c0e by Victor Stinner in branch '2.7': Issue #14432: Generator now clears the borrowed reference to the thread state http://hg.python.org/cpython/rev/aa324af42c0e -- ___ Python

[issue19494] Add urllib2.HTTPBasicPriorAuthHandler for use with APIs that don't return 401 errors

2014-11-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb3061ba6fd2 by Nick Coghlan in branch 'default': Close #19494: add urrlib.request.HTTPBasicPriorAuthHandler https://hg.python.org/cpython/rev/fb3061ba6fd2 -- nosy: +python-dev resolution: - fixed stage: commit review - resolved status:

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-12 Thread Nick Coghlan
Nick Coghlan added the comment: The Windows installer integration backport is in issue 22850. Reviewing that made me release that the parallel version section in https://docs.python.org/3/installing/#work-with-multiple-versions-of-python-installed-in-parallel may need tweaking to account for

[issue22850] Backport ensurepip Windows installer changes to 2.7

2014-11-12 Thread Nick Coghlan
Nick Coghlan added the comment: After digging a little further, I see Brian backported the PATH modification support from issue #3561 in https://hg.python.org/cpython/rev/a9d34685ec47 This should probably be noted in the What's New document - while it's not technically part of PEP 477, that's

[issue22854] Documentation/implementation out of sync for IO

2014-11-12 Thread Stanislaw Pitucha
New submission from Stanislaw Pitucha: The docstring on for fileno() method says: An IOError is raised if the IO object does not use a file descriptor. In reality, UnsupportedOperation is raised instead: ``` : io.StringIO().fileno() UnsupportedOperation: fileno ``` -- components: IO

[issue22854] Documentation/implementation out of sync for IO

2014-11-12 Thread Stanislaw Pitucha
Stanislaw Pitucha added the comment: Just in case: yes, UnsupportedOperation is an IOError - but shouldn't docstring here be more specific? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22854

[issue22849] Double DECREF in TextIOWrapper

2014-11-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset ec1948191461 by Benjamin Peterson in branch '3.4': fix possible double free in TextIOWrapper.__init__ (closes #22849) https://hg.python.org/cpython/rev/ec1948191461 New changeset a664b150b6c2 by Benjamin Peterson in branch 'default': merge 3.4

[issue22849] Double DECREF in TextIOWrapper

2014-11-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thanks for the excellent bug report! -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22849 ___

[issue22855] csv writer with blank lineterminator breaks quoting

2014-11-12 Thread Eric Haszlakiewicz
New submission from Eric Haszlakiewicz: I'm trying to emit a single line of csv without any line terminators, but specifying lineterminator=None results in a lineterminator must be set error, and setting lineterminator='' results in lack of quotes around certain fields. with open(foo.csv,

[issue22856] Function Summons

2014-11-12 Thread shayan
New submission from shayan: Hi Everybody... I'm SH4Y4N From Ashiyane Digital Security Team I found the Bug Function Summons From Python 2.7... When You Try To Summons some Function It's Regular... But What Happend When You're Calling two Function Simultaneous? Your 2 Functions Run But the

[issue22855] csv writer with blank lineterminator breaks quoting

2014-11-12 Thread R. David Murray
R. David Murray added the comment: If the line terminator is not \n, there is no reason to quote values with \n in them. (Try your code with lineterminator set to 'd' to see what I mean.) -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed

[issue22857] strftime should support %f to print milliseconds

2014-11-12 Thread Артём Скорецкий
New submission from Артём Скорецкий: Now you cannot get milli (micro) seconds using strftime. It should be fixed. AFAIK %f should be the right pattern for this -- messages: 231085 nosy: tonn81 priority: normal severity: normal status: open title: strftime should support %f to print

[issue16991] Add OrderedDict written in C

2014-11-12 Thread Артём Скорецкий
Артём Скорецкий added the comment: Any progress? It was planned for 3.5 release -- nosy: +tonn81 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16991 ___

[issue22855] csv writer with blank lineterminator breaks quoting

2014-11-12 Thread R. David Murray
R. David Murray added the comment: Also, it is hard to see how to make this clearer: csv.QUOTE_MINIMAL Instructs writer objects to only quote those fields which contain special characters such as delimiter, quotechar or any of the characters in lineterminator. Hmm. Perhaps it would be a bit

[issue22855] csv writer with blank lineterminator breaks quoting

2014-11-12 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22855 ___ ___

[issue22856] Function Summons

2014-11-12 Thread R. David Murray
R. David Murray added the comment: I have to tell you, I almost closed this as spam due to the spamish prose styling of the text. Please read the python tutorial, or email the python-tutors list if you want to learn more about why your code produced the results it did. -- nosy:

[issue22843] doc error: 6.2.4. Match Objects

2014-11-12 Thread Ben Finney
Ben Finney added the comment: The current wording of the passage “Match objects always have a boolean value of True” implies that the value compares equal to the ‘True’ constant. That implication is incorrect. I disagree with R. David Murray; if we want to say that a value is considered true

[issue22857] strftime should support %f to print milliseconds

2014-11-12 Thread R. David Murray
R. David Murray added the comment: You are talking about time.strftime, I presume. datetime supports %f. time.strftime does not, because it wraps the system strftime, and that does not support %f (at least not on my linux system). -- nosy: +r.david.murray resolution: - not a bug

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread Brett Hannigan
Changes by Brett Hannigan bhanni...@dnanexus.com: -- keywords: +patch Added file: http://bugs.python.org/file37187/argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848 ___

[issue22853] Multiprocessing.Queue._feed deadlocks on import

2014-11-12 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22853 ___ ___ Python-bugs-list mailing list

[issue12499] textwrap.wrap: add control for fonts with different character widths

2014-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Both approaches can be combined. It could be a regular overridable method, and it could be overridded for an instance if corresponding argument is specified. See the default method and parameter of JSON encoder. I slightly hesitate about the name. Is

[issue21090] File read silently stops after EIO I/O error

2014-11-12 Thread STINNER Victor
STINNER Victor added the comment: On IRC, buck1 asked why the following code behaves differently on Python 3.4 and Python = 3.4. It is related to this issue in fact. Code: --- from __future__ import print_function from os import openpty read, write = openpty() from subprocess import Popen

[issue22850] Backport ensurepip Windows installer changes to 2.7

2014-11-12 Thread Steve Dower
Steve Dower added the comment: Yes, I'll add Scripts into the PATH when that option is enabled too. I ignored that from the changeset I merged from, forgetting that that's where pip.exe will end up. I'd rather not bundle the launcher with Python 2 right now (if ever). With the 3.5 installer

[issue22852] urllib.parse wrongly strips empty #fragment

2014-11-12 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22852 ___ ___ Python-bugs-list

[issue22854] Documentation/implementation out of sync for IO

2014-11-12 Thread Martin Panter
Martin Panter added the comment: Similarly for the readable(), seekable() and writable() documentation -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22854 ___

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848 ___ ___ Python-bugs-list

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-12 Thread Nick Coghlan
Nick Coghlan added the comment: Ned pointed out the wording regarding the Makefile changes in PEP 477 was ambiguous. My intent was for the changes to be backported, just with ENSUREPIP defaulting to no rather than upgrade. So that part of the backport is still on the todo list (Ned's offered

[issue22850] Backport ensurepip Windows installer changes to 2.7

2014-11-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset c248a6bdc1d7 by Steve Dower in branch '2.7': Issue #22850: Backport ensurepip Windows installer changes to 2.7 https://hg.python.org/cpython/rev/c248a6bdc1d7 -- nosy: +python-dev ___ Python tracker

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread paul j3
paul j3 added the comment: A notational point - you are adding a subparser, not an argument, to the subparsers action. Why would a user want to use `help=argparse.SUPPRESS`, as opposed to simply omitting the `help` parameter? The effect would be the same as your patch. Another