[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-11 Thread Claudiu.Popa
Claudiu.Popa added the comment: How about the following: Each instance of the TestCase will only be used to run a single test method from it, so a new instance is created for each test method. It replaces `fixture` with `instance` and it emphasizes that the called method belongs to that

[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch with Windows support. I notice there is difference regarding resolving symbolic link with parent dir (linkA/..) between Posix and Windows. On Windows, if linkY points to dirB, 'dirA\linkY\..' resolves to 'dirA' without resolving linkY first.

[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: Removed file: http://bugs.python.org/file33089/add_non_strict_resolve_pathlib_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19717 ___

[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: Added file: http://bugs.python.org/file33090/add_non_strict_resolve_pathlib_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19717 ___

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the main module

2013-12-11 Thread Olivier Grisel
Olivier Grisel added the comment: I agree that a failure to lookup the module should raise an explicit exception. Second, there is no way that 'nosetests' will ever succeed as an import since, as Oliver pointed out, it doesn't end in '.py' or any other identifiable way for a finder to know

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the main module

2013-12-11 Thread Olivier Grisel
Olivier Grisel added the comment: what is sys.modules['__main__'] and sys.modules['__main__'].__file__ if you run under nose? $ cat check_stuff.py import sys def test_main(): print(sys.modules['__main__']=%r % sys.modules['__main__'])

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the main module

2013-12-11 Thread Olivier Grisel
Olivier Grisel added the comment: Note however that the problem is not specific to nose. If I rename my initial 'check_forserver.py' script to 'check_forserver', add the '#!/usr/bin/env python' header and make it 'chmod +x' I get the same crash. So the problem is related to the fact that

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyLong_AsUnsignedLong() and PyLong_AsLong() can return different values for same object. Why __int__ and __index__ should be used for int subclasses at all? I'm not sure this is right solution. -- ___ Python

[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think a patch in issue19887 first should be committed. It totally rewrites resolve(). -- dependencies: +Path.resolve() fails on complex symlinks ___ Python tracker rep...@bugs.python.org

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the main module

2013-12-11 Thread Olivier Grisel
Olivier Grisel added the comment: Here is a patch that uses `imp.load_source` when the first importlib name-based lookup fails. Apparently it fixes the issue on my box but I am not sure whether this is the correct way to do it. -- keywords: +patch Added file:

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu
Stéphane Glondu added the comment: What platform is this on? I'm on Linux (Debian testing). Looking quickly through posix.execve (which is what I think gets called), it looks like it just calls C's execve(). Yes, but I'm talking about os.execvp, here. With the search in PATH. Also,

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu
Stéphane Glondu added the comment: What is the bad idea? Keep looking in subsequent directories in PATH when you find a candidate for which execve() fails? Sorry, but I beg to differ, and POSIX is on my side. Sorry, I meant Stop looking in subsequent [..]. --

[issue19942] UTF-8 encoding not enforced

2013-12-11 Thread Jakub Wilk
Jakub Wilk added the comment: With a slightly adapted test case, I see the same behavior in Python 3.3.3. Perhaps it would be worth fixing the bug in Python 3.4? -- Added file: http://bugs.python.org/file33092/test3.py ___ Python tracker

[issue19100] Use backslashreplace in pprint

2013-12-11 Thread Walter Dörwald
Walter Dörwald added the comment: This is not the fault of pprint. IMHO it doesn't make sense to fix anything here, at least not for pprint specifically. print() has the same problem: $ LANG= ./python -c print('\u20ac')

[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Nick Coghlan
Nick Coghlan added the comment: One function (the current one) promises not to import anything. The other (the new one) may have side effects, even if it fails to find the module (any successfully imported parent modules will remain imported). IIRC, that no side effects guarantee was the

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the main module

2013-12-11 Thread Nick Coghlan
Nick Coghlan added the comment: Rerunning main in the subprocess has always been a slightly dubious feature of multiprocessing, but IIRC it's a necessary hack to ensure pickle compatibility for things defined in __main__. Using runpy.run_path would be a better solution, but we'll need to add the

[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2013-12-11 Thread Filip Zyzniewski
Filip Zyzniewski added the comment: It seems like there is also an issue with property classes defined in a different module. In the example below Foo.x uses standard property, and Foo.y uses prop imported from the prop module. This results in docstring for Foo.y to be missed:

[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2013-12-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4037 ___ ___

[issue19942] UTF-8 encoding not enforced

2013-12-11 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: wont fix - status: closed - open versions: +Python 3.4 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19942 ___

[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Brett Cannon
Brett Cannon added the comment: I'm not saying get rid of the ability to guarantee no side-effects. All I'm saying is that the point of the function is to find a spec, whether that includes importing or implicitly using a parent package from sys.modules is just technical detail (and thus

[issue19100] Use backslashreplace in pprint

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: pprint is not print. print('\u20ac') € import pprint; pprint.pprint('\u20ac') '€' Default sys.displayhook doesn't fail on unencodable output. $ LANG=C ./python Python 3.4.0b1 (default:e961a166dc70+, Dec 11 2013, 13:57:17) [GCC 4.6.3] on linux Type help,

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Eric V. Smith
Eric V. Smith added the comment: os.execvp calls os._execvpe which calls posix.execv which calls execv. At least that's how I think it works. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19948

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu
Stéphane Glondu added the comment: os.execvp calls os._execvpe which calls posix.execv which calls execv. At least that's how I think it works. I am not contesting that. This bug is about the search the command in PATH part. More precisely, the fact that os.execvp continues the search after

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Eric V. Smith
Eric V. Smith added the comment: I know that. This is mostly just a note to myself so I can remember what I've looked at the next time I have a few moments to look at the bug. Or, anyone else who wants to track it down. -- ___ Python tracker

[issue19100] Use backslashreplace in pprint

2013-12-11 Thread Fred L. Drake, Jr.
Changes by Fred L. Drake, Jr. fdr...@gmail.com: -- assignee: - fdrake ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19100 ___ ___

[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-12-11 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- dependencies: -Implement _imp.exec_builtin and exec_dynamic ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18864 ___

[issue19714] Add tests for importlib.machinery.WindowsRegistryFinder

2013-12-11 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19714 ___ ___ Python-bugs-list

[issue19951] parse_qsl fails on empty query argument without =

2013-12-11 Thread David Pizzuto
New submission from David Pizzuto: Using an empty query argument with no = fails in urlparse.parse_qsl. Chrome and Firefox accept it without the =, so a navigation to google.com/search?q=foobar appears in the address bar as google.com/search?q=foobar=. Neither RFC 1738 nor RFC 3986 define the

[issue15027] Faster UTF-32 encoding

2013-12-11 Thread Mark Lawrence
Mark Lawrence added the comment: From http://kmike.ru/python-data-structures/ under heading DATrie Python wrapper uses utf_32_le codec internally; this codec is currently slow and it is the bottleneck for datrie. There is a ticket with a patch in the CPython bug tracker

[issue19951] parse_qsl fails on empty query argument without =

2013-12-11 Thread R. David Murray
R. David Murray added the comment: I did some research on this for a previous issue, and every description of query strings I could find agreed that the format was 'name=value'. That is, that the '=' is not optional, even though some servers (note, *not* browsers, they just transmit or

[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Julian Gindi
Julian Gindi added the comment: Re-uploaded the patch to remove duplication. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18983 ___ ___

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 618cca51a27e by Serhiy Storchaka in branch '3.3': Issue #17576: Deprecation warning emitted now when __int__() or __index__() http://hg.python.org/cpython/rev/618cca51a27e New changeset 59fb79d0411e by Serhiy Storchaka in branch 'default': Issue

[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Stefan Krah
Stefan Krah added the comment: Antoine, could you add --with-system-libmpdec to my FreeBSD and Fedora bots? Sorry for bothering you with all these obscure options. :) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-12-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: anyways, i went with just the simple fix and no specific test for this issue as the tests were painful and questionable reliability. i appreciate the other refactoring suggestion within the code but for 2.7 and 3.3 bugfixes where no significant changes are

[issue19952] asyncio: test_wait_for_handle failure

2013-12-11 Thread Stefan Krah
New submission from Stefan Krah: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/3601/steps/test/logs/stdio == FAIL: test_wait_for_handle (test.test_asyncio.test_windows_events.ProactorTests)

[issue19952] asyncio: test_wait_for_handle failure

2013-12-11 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- keywords: +buildbot ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19952 ___ ___

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I first committed safe part of patch, which doesn't change behavior, only adds warnings and tests. Here is other part (very simple), which change behavior (in sum they are equal to issue17576_v3.patch with minor changes). * PyNumber_Index() now calls

[issue19953] __iadd__() doc not strictly correct

2013-12-11 Thread ferno
New submission from ferno: Document in question is: http://docs.python.org/3.3/reference/datamodel.html#object.__iadd__ The documentation states, to execute the statement x += y, where x is an instance of a class that has an __iadd__() method, x.__iadd__(y) is called. However, this

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even with last patch int() can return non-int: class A(int): ... def __int__(self): return True ... def __repr__(self): return 'A' ... class B: ... def __int__(self): return A() ... class C: ... def __trunc__(self): return A() ...

[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Besides too long line with sys.stderr.write last patch LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18983 ___

[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, I forgot. This feature should be documented in Doc/library/timeit.rst. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18983 ___

[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Antoine, could you add --with-system-libmpdec to my FreeBSD and Fedora bots? Sorry for bothering you with all these obscure options. :) Should be done now. Can you check they work fine? -- ___ Python tracker

[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-11 Thread R. David Murray
New submission from R. David Murray: A while ago I started getting a floating point exception from test_tk in the tip in all active versions, but I'm only now getting around to reporting it. I've tracked this down to the tests introduced in issue 19085, which it looks like revealed some

[issue19828] test_site fails with -S flag

2013-12-11 Thread Zachary Ware
Zachary Ware added the comment: Looking more closely, there's not much that looks like it really should be tested if explicitly called with -S, so perhaps the toplevel skip is still best after all. Any other thoughts? Attached patch fixes `python -S Lib/test` and cleans up an unused import.

[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Nick Coghlan
Nick Coghlan added the comment: Look at it from a conceptual point of view, though, there are two quite different operations: - find a spec at the current level, using the specified path (which may be empty, implying a top level import) - find a spec according to the full import cycle,

[issue19828] test_site fails with -S flag

2013-12-11 Thread R. David Murray
R. David Murray added the comment: I would just change the comment to it is not useful to run the tests if we were called with -S. Otherwise it looks fine. If someone adds tests that are meaningful with -S is specified, we can put them in a different class, and move the skip to the class

[issue19934] collections.Counter.most_common does not document `None` as acceptable input.

2013-12-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19934 ___

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-12-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset d842bc07d30b by R David Murray in branch '3.3': #19063: partially fix set_payload handling of non-ASCII string input. http://hg.python.org/cpython/rev/d842bc07d30b New changeset 02cb48459b58 by R David Murray in branch 'default': Null merge for

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-12-11 Thread R. David Murray
R. David Murray added the comment: Well, it's a fair while after tomorrow, but now it is committed. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Julian Gindi
Julian Gindi added the comment: Updated documentation and fixed a few lines that were too long. -- Added file: http://bugs.python.org/file33095/issue18983_v6.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18983

[issue16669] Docstrings for namedtuple

2013-12-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16669 ___

[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Stefan Krah
Stefan Krah added the comment: Antoine Pitrou rep...@bugs.python.org wrote: Should be done now. Can you check they work fine? Thank you! Works OK. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19732

[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Stefan Krah
Stefan Krah added the comment: Matthias, my target is to release mpdecimal-2.4 on January 9th 2014. I saw that you started to package mpdecimal-2.3: http://packages.debian.org/pt/source/sid/misc/mpdecimal I hope that it can be changed to 2.4: Packaging 2.3 would create some confusion,

[issue15027] Faster UTF-32 encoding

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is updated patch, synchronized with trunk. UTF-32 encoder now checks surrogates and therefore speedup is less (only up to 5 times). But this compensates regression in 3.4. On 32-bit Linux, Intel Atom N570 @ 1.66GHz: Py3.3Py3.4patched

[issue19928] Implement cell repr test

2013-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Zachary. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19928 ___ ___ Python-bugs-list mailing

[issue19887] Path.resolve() fails on complex symlinks

2013-12-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___

[issue19918] PureWindowsPath.relative_to() is not case insensitive

2013-12-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19918 ___ ___

[issue19921] Path.mkdir(0, True) always fails

2013-12-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19921 ___ ___

[issue19570] distutils' Command.ensure_dirname fails on Unicode

2013-12-11 Thread Doug Hellmann
Changes by Doug Hellmann doug.hellm...@gmail.com: -- nosy: +doughellmann ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19570 ___ ___

[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

2013-12-11 Thread anon
anon added the comment: Thank you! I will try to help in ways that I can such as testing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19915 ___

[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Eric Snow
Eric Snow added the comment: It looks like there are two concepts at play though: 1. side-effect-free vs. may-have-side-effects 2. just-find-the-spec-dangit vs. find-the-spec-relative-to-submodule-search-locations-I-already-know In the case of #1, providing the path is just a means to an end.

[issue19828] test_site fails with -S flag

2013-12-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 40884256f8dd by Zachary Ware in branch '3.3': Issue #19828: Fixed test_site when the whole suite is run with -S. http://hg.python.org/cpython/rev/40884256f8dd New changeset 90834ad91d56 by Zachary Ware in branch 'default': Issue #19828: Merge with

[issue19828] test_site fails with -S flag

2013-12-11 Thread Zachary Ware
Zachary Ware added the comment: Fixed. Thank you Vajrasky for raising the issue, and David for the much better wording. -- assignee: - zach.ware resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.3 ___

[issue15027] Faster UTF-32 encoding

2013-12-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: one comment to address on the review, otherwise after addressing that I believe this is ready to go in for 3.4. -- nosy: +gregory.p.smith priority: low - normal ___ Python tracker rep...@bugs.python.org

[issue19955] When adding .PY and .PYW to PATHEXT, it replaced string instead of appending

2013-12-11 Thread nickhil rokkam
New submission from nickhil rokkam: Following installer overwrote the PATHEXT string after selecting the add to path installation option. http://www.python.org/ftp/python/3.3.3/python-3.3.3.amd64.msi -- components: Installation files: python-3.3.3.amd64.msi messages: 205941 nosy:

[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2013-12-11 Thread Muhammad Tauqir Ahmad
New submission from Muhammad Tauqir Ahmad: If a method `foo` of object instance `obj` is injected into it using a method from a different object instance, `inspect.getsource(obj.foo)` fails with the error message: TypeError: bound method Foo.say of __main__.Foo object at 0x7fd348662cd0 is

[issue19955] When adding .PY and .PYW to PATHEXT, it replaced string instead of appending

2013-12-11 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- components: +Windows nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19955 ___ ___

[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Nick Coghlan
Nick Coghlan added the comment: Actually, I think you make a good point. importlib.find_spec should use the *import_module* signature (no path parameter, but with support for relative imports). If it is exposed at all, the one level only single step version should appear in importlib.machinery,

[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-11 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/email/encoders.py: def encode_7or8bit(msg): Set the Content-Transfer-Encoding header to 7bit or 8bit. orig = msg.get_payload(decode=True) if orig is None: # There's no payload. For backwards compatibility we use 7bit