[issue22852] urllib.parse wrongly strips empty #fragment

2014-11-13 Thread Stian Soiland-Reyes
Stian Soiland-Reyes added the comment: I tried to make a patch for this, but I found it quite hard as the urllib/parse.py is fairly low-level, e.g. it is constantly encoding/decoding bytes and strings within each URI component. Basically the code assumes there are tuples of strings, with

[issue22431] Change format of test runner output

2014-11-13 Thread Robert Collins
Robert Collins added the comment: Yes, making customising the output easier is a good thing. One way is to use e.g. subunit.run (which can work with all unittest versions since 2.6) and write a custom filter. Or a custom TestResult and TextTestRunner can work too :) --

[issue22858] unittest.__init__:main shadows unittest.main

2014-11-13 Thread Robert Collins
New submission from Robert Collins: This is just an ugly/hygiene thing. Since we've never advertised the submodules as the API, we should be able to fix this by moving main.py to e.g. __main__.py. -- messages: 231101 nosy: rbcollins priority: normal severity: normal status: open title:

[issue22858] unittest.__init__:main shadows unittest.main

2014-11-13 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- components: +Library (Lib) type: - behavior versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22858 ___

[issue22859] unittest.TestProgram.usageExit no longer invoked

2014-11-13 Thread Robert Collins
New submission from Robert Collins: Before the argparse migration usageExit was invoked and could be extended via subclasses, but it no longer is. We could delete it (and document it being no longer accessible) or put some glue in to reinstate it. I think deleting it is fine, as long as we

[issue22859] unittest.TestProgram.usageExit no longer invoked

2014-11-13 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- components: +Library (Lib) type: - behavior versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22859 ___

[issue22860] unittest TestProgram hard to extend

2014-11-13 Thread Robert Collins
New submission from Robert Collins: Some users of TestProgram would like to add options (e.g. testtools.run adds --list and --load-list) but there isn't a clean point to add them without bulk copying the implementation around. We likely need some extra extension points as well - one

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

2014-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which is closer to current code but solves complexity issue and also fixes some bugs in current code. $ ./python -c import textwrap; print(textwrap.wrap('this-is-a-useful-feature', width=1, break_long_words=False)) ['this-', 'is-a',

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

2014-11-13 Thread Georg Brandl
Georg Brandl added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22687 ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't understand: +expect = (this-|is-a-useful-|feature-|for-| + reformatting-|posts-|from-|tim-|peters'ly).split('|') +self.check_wrap(text, 1, expect, break_long_words=False) +self.check_split(text, expect) Why

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

2014-11-13 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: -Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22687 ___ ___

[issue22860] unittest TestProgram hard to extend

2014-11-13 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22860 ___ ___ Python-bugs-list mailing

[issue22860] unittest TestProgram hard to extend

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: For another example use case: https://github.com/numba/numba/blob/master/numba/tests/__init__.py#L22 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22860

[issue22861] [2.7] ssl._dnsname_match() and unicode

2014-11-13 Thread STINNER Victor
New submission from STINNER Victor: Hi, I just modified the Trollius project ( http://trollius.readthedocs.org/ ) to support Python 2.7 with the newly backported ssl module. I ran the test suite of the Trollius and some tests are failing because of the exact exception message. It looks like

[issue22861] [2.7] ssl._dnsname_match() and unicode

2014-11-13 Thread STINNER Victor
STINNER Victor added the comment: I worked around this issue by expecting a different error message on Python 2 and Python 3: https://bitbucket.org/enovance/trollius/commits/be404685d3fd8ba008e1a577438dc6f23b01c63a?at=trollius +if compat.PY3: +err_msg = hostname '127.0.0.1'

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread Florian Höch
New submission from Florian Höch: If 'top' is an unicode directory name, os.listdir can still return non-unicode filenames if they can't be decoded. This case is not handled in the Python 2.x standard library version of os.walk and will cause join(top, name) to fail on such filenames with an

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread STINNER Victor
STINNER Victor added the comment: What is your OS? -- components: +Unicode nosy: +ezio.melotti, haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22862 ___

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread Florian Höch
Florian Höch added the comment: This problem only affects Linux as far as I know (in my case I'm using Fedora 21 Beta). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22862 ___

[issue22863] https://docs.python.org/ should make a true 2.7.8 version available

2014-11-13 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg: The documentation shown for Python 2.7.8 currently includes 2.7.9 parts, e.g. for the ssl modules (https://docs.python.org/2.7/library/ssl.html). Since there were so many changes to the ssl module for 2.7.9 which are not available in 2.7.8, I think it

[issue22863] https://docs.python.org/ should make a true 2.7.8 version available

2014-11-13 Thread Benjamin Peterson
Benjamin Peterson added the comment: There's https://docs.python.org/release/2.7.8/ -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22863 ___

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread STINNER Victor
STINNER Victor added the comment: Your problem has two solutions. 1) Upgrade to Python 3 which handles correctly your use case (thanks to the PEP 383, surrogateescape error handler) 2) Only process filenames as bytes, and encode/decode manually (so you can decide how to handle undecodable

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

2014-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is old rule. \w{2,}-(?=\w{2,} -- single letter shouldn't be separated. But there was a bug in such simple regex, it splits a word after non-word character (in particular apostrophe or hyphen) if it followed by word characters and hyphen. There were

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread Florian Höch
Florian Höch added the comment: 1) Is not yet possible for me unfortunately, some libraries I require are not yet available for Python 3 (but in the long run, this would be my preferred solution) 2) Would necessitate too many changes in a carefully crafted, unicode-only application. I think

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread STINNER Victor
STINNER Victor added the comment: 1) Is not yet possible for me unfortunately, some libraries I require are not yet available for Python 3 (but in the long run, this would be my preferred solution) I'm curious, which libraries? Oh, I forgot to say that it's not possible to fix this issue

[issue22858] unittest.__init__:main shadows unittest.main

2014-11-13 Thread R. David Murray
R. David Murray added the comment: I'm afraid that just because we don't advertise it doesn't mean it isn't used. On the other hand, the split into submodules is relatively recent, so maybe we could get away with it without a deprecation cycle. I'd like other developers opinions on that.

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - wont fix stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22862 ___

[issue22862] os.walk fails on undecodable filenames

2014-11-13 Thread Florian Höch
Florian Höch added the comment: I'm curious, which libraries? wxPython and wexpect (wexpect I could probably port myself, so the problem is mainly with wx) Oh, I forgot to say that it's not possible to fix this issue in Python 2. Backporting the PEP 383 in Python 2 requires deep changes

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

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is old rule. \w{2,}-(?=\w{2,} -- single letter shouldn't be separated. I don't agree. This was an implementation detail. There was no test, and it wasn't specified anywhere. If you think single letter shouldn't be separated, there should be some

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

2014-11-13 Thread R. David Murray
R. David Murray added the comment: https://owl.english.purdue.edu/owl/resource/576/01/ Rule 8. So, no, in the middle of the word single letters aren't a problem, only at the beginning or the end of the word. -- nosy: +r.david.murray ___ Python

[issue22600] In Multiprocessing Queue() doesn't work with list : __.put(list) != __.get()

2014-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: solution.put(c) takes a *reference* to the list c. And then the test() function continues running! By the time the list is serialized and sent back to the main process (in another thread), the test() function has already changed it... As you noticed,

[issue22864] Add filter to multiprocessing.Pool

2014-11-13 Thread Mike Drob
New submission from Mike Drob: Being able to use a pool to easily run 'map' over an iterable is very powerful, but it would also be nice to run 'filter' (or potentially 'ifilter' or 'filter_async', in keeping with the patterns already present). -- components: Library (Lib) messages:

[issue22462] Modules/pyexpat.c violates PEP 384

2014-11-13 Thread Matthias Klose
Matthias Klose added the comment: according to https://jenkins.qa.ubuntu.com/job/vivid-adt-python3.4/7/ test.test_pyexpat.HandlerExceptionTest now fails, but only when running in the installed location, not when running the tests from the builddir. any idea why? -- nosy: +doko

[issue22865] Allow pty.spawn to ignore data to copy

2014-11-13 Thread Geoff Shannon
New submission from Geoff Shannon: While using the pty.py module I had cause to want to be able to silently eat characters from the input stream. I discovered that because of the check for end of file being if not data that there was no way to do this. Since the default function used by

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

2014-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you David. If splitting single letter surrounded with hyphens is desirable, here is more complicated patch which does this. It deviates from original code more, but it doesn't look break any reasonable example. The textwrap behaviour is

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

2014-11-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file37190/wordsplit_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22687 ___

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

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: To clarify, I would be fine with the previous patch if it didn't add the tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22687 ___

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

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Aren't ['this-', 'is-a', '-useful-', 'feature'] and ['what-d', 'you-, 'call-', 'it.'] obvious bugs? Obvious according to which rules? If we want to improve the behaviour of textwrap, IMHO it should be in a separate issue. And someone would have to study the

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

2014-11-13 Thread R. David Murray
R. David Murray added the comment: What I usually do in cases like this is to add the tests but mark them with comments saying that the tests test current behavior but are not testing parts of the (currently defined) API. That way you know if a change changes behavior and then can decide if

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

2014-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: To clarify, I would be fine with the previous patch if it didn't add the tests. The absent of tests could cause introducing new non-detected bugs and reappearing old bugs. Obvious according to which rules? If you think a word should be splitted before

[issue14099] ZipFile.open() should not reopen the underlying file

2014-11-13 Thread David Wilson
David Wilson added the comment: Per my comment on issue16569, the overhead of performing one seek before each (raw file data) read is quite minimal. I have attached a new (but incomplete) patch, on which the following microbenchmarks are based. The patch is essentially identical to Stepan's

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg: With the backport of the Python 3 ssl module, the default context options of the ssl module were changed. While this provides better security in many cases, it also causes breakage with servers or clients which do not support TLSv1 and later. The ssl

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread R. David Murray
R. David Murray added the comment: As I recall it, this was discussed extensively on the python-dev mailing list. Ideally someone should summarize that discussion here. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue22867] document behavior of calling atexit.register() while atexit._run_exitfuncs is running

2014-11-13 Thread Skip Montanaro
New submission from Skip Montanaro: A discussion on comp.lang.python about prettying up the if __name__ == 'main__' idiom led to a suggestion that a decorator could simple register the main function using atexit.register. That looks like it will work, but leaves open the possibility that

[issue22867] document behavior of calling atexit.register() while atexit._run_exitfuncs is running

2014-11-13 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22867 ___ ___ Python-bugs-list

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread Benjamin Peterson
Benjamin Peterson added the comment: Per http://legacy.python.org/dev/peps/pep-0476/#opting-out the only way to do these things is horrednously ugly because it's hardly (if ever) a good idea. -- nosy: +alex, benjamin.peterson ___ Python tracker

[issue2636] Adding a new regex module (compatible with re)

2014-11-13 Thread Mateon1
Mateon1 added the comment: Well, I found a bug with this module, on Python 2.7(.5), on Windows 7 64-bit when you try to compile a regex with the flags V1|DEBUG, the module crashes as if it wanted to call a builtin called ascii. The bug happened to me several times, but this is the regexp when

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 13.11.2014 22:03, Benjamin Peterson wrote: Benjamin Peterson added the comment: Per http://legacy.python.org/dev/peps/pep-0476/#opting-out the only way to do these things is horrednously ugly because it's hardly (if ever) a good idea. The point

[issue22858] unittest.__init__:main shadows unittest.main

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Numba subclasses unittest.main in order to add custom CLI options. I agree the current unittest scheme is horrible, just we should find a way that's backwards-compatible. -- nosy: +pitrou ___ Python tracker

[issue22864] Add filter to multiprocessing.Pool

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

[issue22417] PEP 476: verify HTTPS certificates by default

2014-11-13 Thread koobs
koobs added the comment: Builds failing on koobs-freebsd9 buildbot for: 3.x: since revision b2c17681404f80edae2ee4846db701104d942cc4 3.4: since revision 246c9570a75798a4757001620cf92cc8d2eba684 Attaching both initial build failure test logs. -- nosy: +koobs Added file:

[issue2636] Adding a new regex module (compatible with re)

2014-11-13 Thread Matthew Barnett
Matthew Barnett added the comment: @Mateon1: I hope it's fixed? Did you report it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2636 ___ ___

[issue22823] Use set literals instead of creating a set from a list

2014-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, go ahead and apply the clinic.py patch. Can you also make a separate mock patch and assign it to Michael Foord for review? -- assignee: larry - serhiy.storchaka ___ Python tracker rep...@bugs.python.org

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread Benjamin Peterson
Benjamin Peterson added the comment: But you can reenable SSLv3 by alerting the context and monkeypatching as described in the PEP. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22866

[issue19777] Provide a home() classmethod on Path objects

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

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

2014-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: What I usually do in cases like this is to add the tests but mark them with comments saying that the tests test current behavior but are not testing parts of the (currently defined) API. That way you know if a change changes behavior and then can decide if

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 14.11.2014 01:29, Benjamin Peterson wrote: But you can reenable SSLv3 by alerting the context and monkeypatching as described in the PEP. Well, I can monkeypatch the ssl module of course, but that's not really the point here. I'm not talking about

[issue22866] ssl module in 2.7.9 should provide a way to configure default context options

2014-11-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hmm, since neither create_default_context() nor _create_stdlib_context() are used by any other stdlib modules, I guess the removal of SSLv3 doesn't really make much difference for existing Python 2.7 applications. I was irritated by the function names

[issue992389] attribute error due to circular import

2014-11-13 Thread Nick Coghlan
Nick Coghlan added the comment: Belatedly agreeing with PJE on this one. If concerns around circular imports continue to be raised in a post Python 3.5 world (with the issue 17636 change), then we can look at revisiting this again, but in the meantime, lets just go with the sys.modules

[issue992389] attribute error due to circular import

2014-11-13 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- superseder: - Modify IMPORT_FROM to fallback on sys.modules ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue992389 ___

[issue17293] uuid.getnode() MAC address on AIX

2014-11-13 Thread koobs
koobs added the comment: koobs-freebsd10 buildbot broken on all branches since: 2.7: e80cb046e7641fb8a71dda8254d2e619cdd64480 3.4: ba4b31ed2952b65ca447f57fbd6d540ebc4b749c 3.x: 3e4f3cc4f1f9dbee8e0ed5df47f77baae2ad310c Full (2.7) log attached.

[issue22834] Unexpected FileNotFoundError when current directory is removed

2014-11-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22834 ___

[issue22836] Broken Exception ignored in: message on exceptions in __repr__

2014-11-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___

[issue21724] resetwarnings doesn't reset warnings registry

2014-11-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21724 ___

[issue22831] Use with to avoid possible fd leaks

2014-11-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22831 ___

[issue22868] Minor error in the example of filter()

2014-11-13 Thread Yi Bai
New submission from Yi Bai: Hi, I suppose there is a minor error in the example of the filter() function in 5.1.3 part of the document. -- filter(function, sequence) returns a sequence consisting of those items from the sequence

[issue22868] Minor error in the example of filter()

2014-11-13 Thread Georg Brandl
Georg Brandl added the comment: For me the text is correct. However, it depends on parsing the English sentence in the right way, which can be confusing. The prose means not (divisible by 2 or 3) which is equivalent to not divisible by 2 and not divisible by 3, therefore the Python code has