[issue15273] Remove unnecessarily random behavior from test_unparse.py

2013-01-28 Thread Daniel Cioata
Daniel Cioata added the comment: a solution for this issue -- nosy: +Daniel.Cioata Added file: http://bugs.python.org/file28877/submitted_patch_Issue15273 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15273

[issue16997] subtests

2013-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: Right, if you want independently addressable/runnable, then you're back to parameterised tests as discussed in issue7897. What I like about Antoine's subtest idea is that I think it can be used to split the execution/reporting part of parameterised testing from

[issue17054] cStringIO.StringIO aborted when more then INT_MAX bytes written

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Indeed. -- resolution: - duplicate stage: needs patch - committed/rejected status: open - closed superseder: - cStringIO not 64-bit safe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17054

[issue13555] cPickle MemoryError when loading large file (while pickle works)

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +cStringIO not 64-bit safe -cStringIO.StringIO aborted when more then INT_MAX bytes written ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13555

[issue7358] cStringIO not 64-bit safe

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka components: +Extension Modules, IO -Library (Lib) nosy: +serhiy.storchaka stage: - needs patch versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org

[issue17060] IDLE -- jump to home should not go past the PS1 and PS2 prompts

2013-01-28 Thread Raymond Hettinger
New submission from Raymond Hettinger: In IDLE's shell, pressing home or control-a currently jumps to the beginning of a line. Instead it should stop *after* theprompt. -- components: IDLE messages: 180841 nosy: rhettinger priority: normal severity: normal status: open title:

[issue17059] tarfile.is_tarfile without read permissions raises AttributeError

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for the report, Damian. This was fixed in issue11513. -- assignee: - serhiy.storchaka components: +Library (Lib) -None nosy: +serhiy.storchaka resolution: - out of date stage: - committed/rejected status: open - closed

[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2013-01-28 Thread Ned Deily
Ned Deily added the comment: Attached are the back ports to 2.7.x and 3.2.x of the Xcode 4 support changes as released in 3.3.0. I've built and tested both with various configurations on a variety of systems, both Intel and PPC, and various OS X versions (10.4, 10.5, 10.6, 10.7, and 10.8),

[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2013-01-28 Thread Ned Deily
Changes by Ned Deily n...@acm.org: Added file: http://bugs.python.org/file28879/issue13590_backport_32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13590 ___

[issue12691] tokenize.untokenize is broken

2013-01-28 Thread Thomas Kluyver
Thomas Kluyver added the comment: Is there anything I can do to push this forwards? I'm trying to use tokenize and untokenize in IPython, and for now I'm going to have to maintain our own copies of it (for Python 2 and 3), because I keep running into problems with the standard library module.

[issue7358] cStringIO not 64-bit safe

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file28880/cStringIO64.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7358

[issue17061] tokenize unconditionally emits NL after comment lines blank lines

2013-01-28 Thread Thomas Kluyver
New submission from Thomas Kluyver: The docs describe the NL token as Token value used to indicate a non-terminating newline. The NEWLINE token indicates the end of a logical line of Python code; NL tokens are generated when a logical line of code is continued over multiple physical lines.

[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

2013-01-28 Thread Nick Coghlan
New submission from Nick Coghlan: I recently had occasion to use pkgutil.walk_packages, and my immediate thought was that it would have been a lot easier for me to use if it worked more like os.walk with topdown=True, producing tuples of (pkg, subpackages, modules) pkg would be the package

[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

2013-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: Oops, forgot the proposed call signature: def walk_path(path=None, *, pkg=None): Walk a package hierarchy, starting with the given path Iterator producing (package, subpackages, submodules) triples. The first entry is the package

[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

2013-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: Regarding the PEP comment - the piece that would be missing is the iter_modules functionality. Currently pkgutil provides the support for standard filesystem imports and zipimports directly - the generic function based extension mechanism is undocumented.

[issue14302] Rename Scripts directory to bin and move python.exe to bin

2013-01-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14302 ___ ___

[issue17052] unittest discovery should use self.testLoader

2013-01-28 Thread Michael Foord
Michael Foord added the comment: I think you're correct - although I wonder if *anyone*, *ever* will be helped by the change. :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17052 ___

[issue12520] spurious output in test_warnings

2013-01-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12520 ___

[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17062 ___ ___

[issue17052] unittest discovery should use self.testLoader

2013-01-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: I will at least! :) I noticed the issue after trying to use unittest test discovery with a custom loader. Fortunately, there is at least this work-around (though it relies on an implementation detail): class MyTestProgram(unittest.TestProgram):

[issue5289] ctypes.util.find_library does not work under Solaris

2013-01-28 Thread Trent Nelson
Changes by Trent Nelson tr...@snakebite.org: -- nosy: +trent ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5289 ___ ___ Python-bugs-list mailing

[issue15933] flaky test in test_datetime

2013-01-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15933 ___ ___

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Antoine Pitrou
New submission from Antoine Pitrou: assert_called_with currently compares every argument for equality, which is not very practical when one of the arguments is a complex object, of which you only want to check certain properties. It could be very nice if you could write e.g.: from mock

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Michael Foord
Michael Foord added the comment: You mean like mock.ANY ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17063 ___ ___ Python-bugs-list mailing

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Michael Foord
Michael Foord added the comment: Oh, you want the assert_called_with call to *return* the objects compared with the placeholder? Well, mock.ANY already exists and you can pull the arguments out for individual assertions using some_mock.call_args. args, kwargs = some_mock.call_args

[issue16335] Integer overflow in unicode-escape decoder

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16335 ___ ___

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm noticing that with multiple ANY keyword arguments, the order in the result tuple is undefined. So perhaps ANY could be instantiable in those cases where disambiguation is required: foo, bar = my_mock.assert_called_with(1, foo=ANY(0), bar=ANY(1))

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, well... I agree mock.ANY sounds cool :-) Perhaps it could be mentioned in the docs for assert_etc.? Otherwise you only learn about it if you are masochistic enough to read the doc till the end :-) you can pull the arguments out for individual assertions

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ezio, is it a good factorization? def check(self, coder): def checker(input, expect): self.assertEqual(coder(input), (expect, len(input))) return checker def test_escape_decode(self): decode =

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2013-01-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: Does this still need to block 2.7.4? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___ ___

[issue17037] Use a test.support helper to wrap the PEP 399 boilerplate

2013-01-28 Thread Brett Cannon
Brett Cannon added the comment: True, the current idiom needs to still be used in those cases, although we could introduce another method to help with this situation as well: # Could also be named use_accelerator to be less hostile-sounding. def requires_accelerator(self, cls): if

[issue16968] Fix test discovery for test_concurrent_futures.py

2013-01-28 Thread Zachary Ware
Zachary Ware added the comment: Thank you, Chris. I'm rather ashamed of how long I've spent beating my head on this issue and missed the spare tests reference in runtest_inner. Simply removing the tests name entirely clears things up, if this isn't too ugly: diff -r 5f655369ef06

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2013-01-28 Thread Éric Araujo
Éric Araujo added the comment: 2.7.3 broke some setup scripts, it wouldn’t be bad to fix this in 2.7.4. I’ll make time before RC. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994 ___

[issue13539] Return value missing in calendar.TimeEncoding.__enter__

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - duplicate stage: test needed - committed/rejected status: open - closed superseder: - calendar throws UnicodeEncodeError when locale is specified ___ Python tracker

[issue17049] calendar throws UnicodeEncodeError when locale is specified

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +JJeffries, Retro, christian.heimes, eric.araujo, georg.brandl, haypo, ixokai, psam, r.david.murray, tim.golden, twouters ___ Python tracker rep...@bugs.python.org

[issue17064] Fix sporadic buildbot failures for test_mailbox

2013-01-28 Thread Jeremy Kloth
New submission from Jeremy Kloth: Attached is an attempt at fixing the sporadic failures of test_mailbox on the AMD64 Windows buildbot. It fails due to access errors on some directories which leads me to believe the helper functions in test.support should fix the problem. --

[issue17065] Fix sporadic buildbot failures for test_winreg

2013-01-28 Thread Jeremy Kloth
New submission from Jeremy Kloth: test_winreg fails sporadically on the AMD64 Windows buildbot. Looking at the test, it appears that concurrent runs of the test would fail if different processes attempted to modify the test key at the same time. The attached patch resolves this by using a

[issue17064] Fix sporadic buildbot failures for test_mailbox

2013-01-28 Thread R. David Murray
R. David Murray added the comment: I think the support functions just ignore errors. Isn't this going to continue to leave garbage on the buildbot filesystem without fixing the underlying problem? I wonder if this is a variation on the usual Windows access errors, in which case perhaps that

[issue17049] calendar throws UnicodeEncodeError when locale is specified

2013-01-28 Thread Georg Brandl
Georg Brandl added the comment: Serhiy: not sure why all those people belong in the nosy list. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17049 ___

[issue17049] calendar throws UnicodeEncodeError when locale is specified

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: They moved from issue13539 which I have closed as a duplicate. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17049 ___

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Michael Foord
Michael Foord added the comment: Yes there are definitely room for documentation improvements. And, yes - pulling the args out from some_mock.call_args boils down to doing the matching by hand. You only do it when you *want* to do the matching by hand. Your use case I would write: from mock

[issue17064] Fix sporadic buildbot failures for test_mailbox

2013-01-28 Thread Jeremy Kloth
Jeremy Kloth added the comment: Actually, the support functions (as of 3.3) attempt to work around the access errors. They attempt to wait (to a point) for a successful operation before returning to the caller. See issue15496 for details. It is usually the case that the previous operation

[issue17051] Memory leak in os.path.isdir under Windows

2013-01-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4deb294ff567 by Serhiy Storchaka in branch '2.7': Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by Robert Xiao. http://hg.python.org/cpython/rev/4deb294ff567 -- nosy: +python-dev

[issue17051] Memory leak in os.path.isdir under Windows

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed. Thank you for patch. -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17051

[issue16624] subprocess.check_output should allow specifying stdin as a string

2013-01-28 Thread Zack Weinberg
Zack Weinberg added the comment: Contributor agreement resent by email. Sorry for the delay. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16624 ___

[issue17051] Memory leak in os.path.isdir under Windows

2013-01-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 51173aba06eb by Serhiy Storchaka in branch '2.7': Add Robert Xiao to Misc/ACKS for issue17051. http://hg.python.org/cpython/rev/51173aba06eb -- ___ Python tracker rep...@bugs.python.org

[issue4590] 2to3 strips trailing L for long iterals in two fixers

2013-01-28 Thread Fábio M . Costa
Fábio M. Costa added the comment: I believe that since this change the 2to3 documentation is outdated. http://docs.python.org/2/library/2to3.html#2to3fixer-long http://docs.python.org/2/library/2to3.html#2to3fixer-numliterals http://docs.python.org/3/library/2to3.html#2to3fixer-long

[issue17065] Fix sporadic buildbot failures for test_winreg

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Windows nosy: +brian.curtin, stutzbach stage: - patch review type: - behavior versions: -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17065

[issue17065] Fix sporadic buildbot failures for test_winreg

2013-01-28 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- assignee: - brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17065 ___ ___

[issue16971] Refleaks in charmap decoder

2013-01-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971 ___ ___

[issue17051] Memory leak in os.path.isdir under Windows

2013-01-28 Thread Brian Curtin
Brian Curtin added the comment: Robert, thanks a lot for this fix and your contributor agreement. We're currently working on making it easier to submit the contributor agreement so you won't have to print it out and mail/fax/scan it...even though you already did it and you're now covered :)

[issue17064] Fix sporadic buildbot failures for test_mailbox

2013-01-28 Thread R. David Murray
R. David Murray added the comment: Ah, excellent. I had missed that change. This looks good then. Hopefully it will work :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17064 ___

[issue16968] Fix test discovery for test_concurrent_futures.py

2013-01-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: Whichever solution you pick for the test issue, I would at least add a code comment explaining that the test return value needs to be garbage collected and why, etc. and probably reference this issue. If anyone thinks the 'ReapedSuite' class (or a better

[issue16935] unittest should understand SkipTest at import time during test discovery

2013-01-28 Thread Zachary Ware
Zachary Ware added the comment: Here's a patch that I believe nicely handles the raising of unittest.SkipTest at module level while doing test discovery. It adds a _make_skipped_test function to unittest.loader, and an ``except case.SkipTest`` clause to TestLoader._find_tests. For our own

[issue17066] Fix test discovery for test_robotparser.py

2013-01-28 Thread Zachary Ware
New submission from Zachary Ware: Here's a fix for test_robotparser.py. With this patch, the command 'python -m unittest discover Lib/test/ test_*.py' can actually be run--before the patch, test_robotparser's unique TestCase subclass causes unexpected errors for discovery. --

[issue17037] Use a test.support helper to wrap the PEP 399 boilerplate

2013-01-28 Thread Eric Snow
Eric Snow added the comment: +1 to where Brett's taking this. I really like having the PEP399Tests class encapsulating the various boilerplate parts, with some of them as methods, rather than trying to pack them all into one all-powerful decorator. It would be worth raising an exception in

[issue17037] Use a test.support helper to wrap the PEP 399 boilerplate

2013-01-28 Thread Eric Snow
Eric Snow added the comment: FWIW, here's a little more explanation on my original thoughts, none of which I'm married to. Most of the magic in my patch came messing with the globals (swap out the module and module attrs; add in the two new classes; ditch the original class). That was a

[issue17037] Use a test.support helper to wrap the PEP 399 boilerplate

2013-01-28 Thread Eric Snow
Eric Snow added the comment: +1 on requires_accelerator(). It could also be used for individual test methods. Similar decorators-as-methods could be added later, where appropriate, for other special cases, like handling the pickle situation described in #16817. --

[issue17067] Examples in documentation for 3.x in 23.1.3.4. Deferred translations are rather weak

2013-01-28 Thread Carsten Klein
New submission from Carsten Klein: The examples for the topic presented are rather weak. In fact, they merely present do nothing replacements for an actually working, deferred localization mechanism or some sort of prototypical implementation thereof. As such I propose that they be replaced

[issue17063] assert_called_with could be more powerful if it allowed placeholders

2013-01-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17063 ___ ___

[issue17067] Examples in documentation for 3.x in 23.1.3.4. Deferred translations are rather weak

2013-01-28 Thread R. David Murray
R. David Murray added the comment: Thanks for your suggestion, but... The example currently in the docs is exactly how we do deferred translation in the project I am currently working on. Your example is much more complex, and I don't see the benefit of it. Specifically, using the example

[issue17067] Examples in documentation for 3.x in 23.1.3.4. Deferred translations are rather weak

2013-01-28 Thread R. David Murray
R. David Murray added the comment: Sorry, I didn't mean computed at runtime, I meant defined in code where the _ call is *executed* at runtime, rather than at import time. -- ___ Python tracker rep...@bugs.python.org

[issue17068] peephole optimization for constant strings

2013-01-28 Thread Neal Norwitz
New submission from Neal Norwitz: I was looking through code like this: foo = '%s%s%s' % ('https://', host, uri) and realized this could be rewritten by the interpreter as: foo = 'https://%s%s' % (host, uri) I tried to determine how much code this might affect, but it was pretty hard

[issue17015] mock could be smarter and inspect the spec's signature

2013-01-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Proof-of-concept patch. mock is ugly! -- keywords: +patch Added file: http://bugs.python.org/file28886/issue17015.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17015

[issue17068] peephole optimization for constant strings

2013-01-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17068 ___ ___ Python-bugs-list mailing

[issue16754] Incorrect shared library extension on linux

2013-01-28 Thread Sandro Mani
Sandro Mani added the comment: So, from what I can see, historically the SO extension was taken from sysconfig.py, see [1] lines 24 and 60. Then, the CCompiler class got overhauled, and the value was hardcoded to .so, see [2], but the compiler.shared_lib_extension = SO statement remained,

[issue4590] 2to3 strips trailing L for long iterals in two fixers

2013-01-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset d5ee6d13af18 by Benjamin Peterson in branch '3.3': fix long fixer docs (#4590) http://hg.python.org/cpython/rev/d5ee6d13af18 New changeset 8b9910d8d27f by Benjamin Peterson in branch 'default': merge 3.3 (#4590)

[issue16509] sqlite3 docs do not explain check_same_thread

2013-01-28 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16509 ___ ___ Python-bugs-list

[issue17068] peephole optimization for constant strings

2013-01-28 Thread STINNER Victor
STINNER Victor added the comment: and realized this could be rewritten by the interpreter as: Yeah, it could but it's tricky to implement it. The current peephole is implemented in C. You may first try to implement it using my astoptimizer project which is implemented in Python. At least to

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-28 Thread Ezio Melotti
Ezio Melotti added the comment: LGTM. If you want to push it even further you could make a list of (input, expected) and call the check() in a loop. That way it will also be easier to refactor if/when we add subtests (#16997). -- ___ Python

[issue16997] subtests

2013-01-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: 1. Easily append data to failure messages coming from a block of asserts 2. Continue running a test case after a failure from a block of asserts Both of these seem independently useful and more generally applicable, I don't understand what you mean. 1 is

[issue14468] Update cloning guidelines in devguide

2013-01-28 Thread Ezio Melotti
Ezio Melotti added the comment: I now divided and regrouped the FAQs in two sections, one for everyone and one for core developers. I'm not sure what to do with the long-term development of features section. One one hand I would prefer to move it away from committing.rst, but on the other

[issue16997] subtests

2013-01-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: If the API is more like self.assert*()'s msg parameter which appends data to the usual exception, then it will be the same as what people are already used to. It might be a good idea to allow both this and the arbitrary parameter kwargs, then. I'm not