[issue16997] subtests

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: Either way, something isn't right about how it's integrated now. With the patch, this: @unittest.expectedFailure def test(self): with self.subTest(): self.assertEqual(0, 1) gives: FAILED (failures=1, unexpected successes=1) And thi

[issue16997] subtests

2013-01-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le samedi 19 janvier 2013 à 00:33 +, Chris Jerdonek a écrit : > With the way I understand it, it seems like a subtest failure should > register as a failure of the TestCase as a whole, unless the subtests > should be enumerated and considered tests in their o

[issue16997] subtests

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: Nice/elegant idea. A couple comments: (1) What will be the semantics of TestCase/subtest failures? Currently, it looks like each subtest failure registers as an additional failure, meaning that the number of test failures can exceed the number of test cases.

[issue16997] subtests

2013-01-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch make subtests play nice with unittest's failfast flag: http://docs.python.org/dev/library/unittest.html#cmdoption-unittest-f -- Added file: http://bugs.python.org/file28780/subtests2.patch ___ Python tra

[issue16953] select module compile errors with broken poll()

2013-01-18 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: I've attached the patch, and I probably should have done so in the first place. It applies to Python 3.3.0. The resulting code compiles fine on m68k-atari-mint. It shouldn't affect any of the major platforms. -- Added file: http://bugs.python.org

[issue16997] subtests

2013-01-18 Thread Nick Coghlan
Nick Coghlan added the comment: This looks very nice. For cases where you decide you don't want it, some kind of "fail fast" mechanism would be helpful (e.g. when you've seen the full set of failures, and are now just trying to resolve the first one) -- _

[issue9253] argparse: optional subparsers

2013-01-18 Thread W. Trevor King
W. Trevor King added the comment: Since [1] it seems like subparsers *are* optional by default. At least I get “error: too few arguments” for version 70740 of Lib/argparse.py, but no error for version 70741. It looks like this may be an unintentional side effect, since I see no mention of su

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: Yes, as far as I know, ./script works in the same way as dir/script - from the current directory, but not from $PATH. The first test added is for the case I reported - which('script') shouldn't look in the current directory on Unix. The second test would have

[issue16997] subtests

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: I like the idea, and I think this would be a useful addition to unittest. OTOH while this would be applicable to most of the tests (almost every test has a "for" loop to check valid/invalid values, or a few related "subtests" in the same test method), I'm not su

[issue16997] subtests

2013-01-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Since I was asked on IRC, an example of converting an existing test. It's quite trivial really: diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -630,9 +630,10 @@ class UTF16BETest(Rea

[issue16997] subtests

2013-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: +1. I was going to suggest something similar for displaying the I was going to suggest something similar to display the clarification message in case of a fail: for arg, expected in [(...),...]: with self.somegoodname(msg="arg=%s"%arg):

[issue16969] test_urlwithfrag fail

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: OK, I'll close the issue then. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue16997] subtests

2013-01-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue16969] test_urlwithfrag fail

2013-01-18 Thread Ry Erickson
Ry Erickson added the comment: Oops. I just realized that it works, I just had not added python3 to PATH. It installed correctly, and there was never any issue. My mistake. -- ___ Python tracker __

[issue16997] subtests

2013-01-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Attaching patch. -- keywords: +patch Added file: http://bugs.python.org/file28776/subtests.patch ___ Python tracker ___

[issue16997] subtests

2013-01-18 Thread Antoine Pitrou
New submission from Antoine Pitrou: subtests are a light alternative to parametered tests as in issue7897. They don't generate the tests for you, they simply allow to partition a given test case in several logical units. Meaning, when a subtest fails, the other subtests in the test will still

[issue16996] Reuse shutil.which() in webbrowser module

2013-01-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: We can get rid of private webbrowser functions and reuse shutil.which(). -- components: Library (Lib) files: webbrowser_which.patch keywords: patch messages: 180220 nosy: georg.brandl, serhiy.storchaka priority: normal severity: normal stage: patch r

[issue16985] Docs reference a concrete UTC tzinfo, but none exists

2013-01-18 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailin

[issue16985] Docs reference a concrete UTC tzinfo, but none exists

2013-01-18 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue16985] Docs reference a concrete UTC tzinfo, but none exists

2013-01-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 582ecb9a4061 by Jason R. Coombs in branch '2.7': #16985: Remove incorrect phrase indication presence of non-present concrete UTC tzinfo instance. http://hg.python.org/cpython/rev/582ecb9a4061 -- nosy: +python-dev __

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: When choices isn't iterable but supports the "in" operator, e.g. class MyChoices(object): def __contains__(self, item): return True -- ___ Python tracker _

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
Changes by David Coallier : Added file: http://bugs.python.org/file28774/16994.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
David Coallier added the comment: Hi there @serhiy.storchaka, Consider the case where one would calculate the k-combination of set S. When the set has `n` elements, the number of k-combination is equal to its binomial coefficient. e.g. ( n!/( (k!(n-k)! ). One method of statistically optimisi

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-01-18 Thread Jeff Knupp
Jeff Knupp added the comment: The only time this would be an issue is for infinite sequences via range or a generator, which doesn't work anyway. >>> p = argparse.ArgumentParser() >>> a = p.add_argument('a', choices=itertools.count(0), type=int) >>> p.parse_args(['1']) ... hangs Are there

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps the comment in which() is misleading now, if I understand correctly the meaning of the words "short circuit". Native speakers, please correct me if I wrong. -- ___ Python tracker

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
Changes by David Coallier : Removed file: http://bugs.python.org/file28773/collections.Counter.least_common.patch ___ Python tracker ___ ___

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
David Coallier added the comment: Latest patch after code review round #1 -- Added file: http://bugs.python.org/file28773/collections.Counter.least_common.patch ___ Python tracker _

[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2013-01-18 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue16774] Additional recipes for itertools docs

2013-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How are popular the proposed recipes? Not every possible combination of functions is worth to mention in the documentation. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue16994] collections.Counter.least_common

2013-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is use case for this method? Actually, any element which is not in a collection, is a least common for this collection. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue16954] Add docstrings for ElementTree module

2013-01-18 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached)

2013-01-18 Thread Matthäus Wander
Matthäus Wander added the comment: Added single patch as requested. -- keywords: +patch Added file: http://bugs.python.org/file28772/py3_base32hex.patch ___ Python tracker ___ __

[issue16972] Useless function call in site.py

2013-01-18 Thread Brett Cannon
Brett Cannon added the comment: I suspect Kirill is right, although the function that calls addpackage() in site.py always passes in a value, so it won't change anything for Python itself, only third-party code. And addpackage() has been that way since 2004. But, in looking at the function its

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: See issue 16468 for why that won't work in general. -- ___ Python tracker ___ ___ Python-bugs-list m

[issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached)

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: Since this is a new feature it can go on 3.4 only. It would also be better to include both the changes for base64.py and test_base64.py in a single patch and attach that, rather than uploading an archive that contains both. FTR the links to the relevant RFCs are

[issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached)

2013-01-18 Thread Matthäus Wander
New submission from Matthäus Wander: RFC4648 specifies two different alphabets for Base32: 1) the common one already used in RFC3548 and implemented in Python, and 2) an "Extended Hex" alphabet which is used by e.g. DNSSEC NSEC3 but not yet implemented in Python. The attached patches add the "

[issue16972] Useless function call in site.py

2013-01-18 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +brett.cannon stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue16985] Docs reference a concrete UTC tzinfo, but none exists

2013-01-18 Thread Brett Cannon
Brett Cannon added the comment: Nope, no reason. I bet it was a bad merge somewhere in the docs from Python 3 to 2.7 at some point. -- ___ Python tracker ___ ___

[issue16994] collections.Counter.least_common

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: I left a review on Rietveld. Since this is a new feature it can't go on 2.7, and it should target 3.4 instead. -- nosy: +ezio.melotti stage: -> patch review versions: +Python 3.4 -Python 2.7 ___ Python tracker

[issue16989] allow distutils debug mode to be enabled more easily

2013-01-18 Thread Jeff Knupp
Jeff Knupp added the comment: Patch uploaded. Note that updating the test_distutils.core test revealed that the test was importing DEBUG from the wrong module (which only existed because distutils.core use the 'from ... import DEBUG' form). I've corrected the import and updated the test case

[issue16991] Add OrderedDict written in C

2013-01-18 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue16991] Add OrderedDict written in C

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: The tests should probably be updated to use the PEP 399 idiom in order to test both the implementations. -- nosy: +ezio.melotti ___ Python tracker __

[issue16985] Docs reference a concrete UTC tzinfo, but none exists

2013-01-18 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +belopolsky, brett.cannon, rafe ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue16978] fix grammar in 'threading' documentation

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report and the patch! -- assignee: docs@python -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 3.2, Python 3.3, Python 3.4 _

[issue16978] fix grammar in 'threading' documentation

2013-01-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8886d7ca159b by Ezio Melotti in branch '2.7': #16978: rephrase sentence and fix typo. Initial patch by Tshepang Lekhonkhobe. http://hg.python.org/cpython/rev/8886d7ca159b New changeset 4a1a88d25fec by Ezio Melotti in branch '3.2': #16978: rephrase

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Éric Araujo
Éric Araujo added the comment: I assume that ./script is working just like dir/script (what the tests exercize is not crystal clear to me). -- ___ Python tracker ___ ___

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo stage: -> patch review versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-li

[issue16953] select module compile errors with broken poll()

2013-01-18 Thread Charles-François Natali
Charles-François Natali added the comment: Could you provide the patch? It's trivial, but at least we'll make sure the patch fixes the problem on your platform. -- nosy: +neologix ___ Python tracker __

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-01-18 Thread Jeff Knupp
Jeff Knupp added the comment: Attached a patch. Rather than altering choices or making a special check for string instances, I just changed the if statement to if action.choices is not None and value not in list(action.choices): from if action.choices is not None and value not in action.choi

[issue16774] Additional recipes for itertools docs

2013-01-18 Thread Alexey Kachayev
Alexey Kachayev added the comment: Updated patch with: * fix error in islice function name * made n=None default second argument for consume(iterator, n=None) cause it provides specific behavior when n is None which can be assumed as default for function -- Added file: http://bugs.pyth

[issue16988] argparse: PARSER option for nargs not documented

2013-01-18 Thread Jeff Knupp
Jeff Knupp added the comment: This is not a bug. The 'PARSER' nargs choice is an implementation detail as a way to handle subparsers. The parser needs to know that the first value should be handled, but everything that follows will be handled by the subparser. By using a subparser, you're eff

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Robert Leenders
Changes by Robert Leenders : Added file: http://bugs.python.org/file28767/argparse-v2.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Robert Leenders
Changes by Robert Leenders : Removed file: http://bugs.python.org/file28766/argparse-v2.patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Robert Leenders
Robert Leenders added the comment: Chris, you said (in the review) "Hmm, since this is for maintenance releases ... This change could cause "working" code to no longer work." I understood from our original message that you wanted it to change since it is inconsistent. I vote for changing it (s

[issue16969] test_urlwithfrag fail

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: This has been fixed already in 652286ee23f8, but apparently the fix is not included in 3.3.0. I think it's safe to ignore the failure. In the first message you said that this "prevents correct installation". What did you mean exactly? -- type: behavio

[issue10115] Support accept4() for atomic setting of flags at socket creation

2013-01-18 Thread STINNER Victor
STINNER Victor added the comment: My implementation of the PEP 433 uses accept4() for socket.accept() if the (new) cloexec parameter is True: http://hg.python.org/features/pep-433/file/46b7a077ae87/Modules/socketmodule.c#l1961 The code fallbacks to accept() if accept4() fails with ENOSYS. It ha

[issue16468] argparse only supports iterable choices

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: Here is a patch for discussion that allows non-iterable choices with or without metavar. It refactors as suggested. However, the patch does not yet have tests. > Does the test suite already have a testcase already for non-iterable choices > + metavar? No,

[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2013-01-18 Thread Takayuki SHIMIZUKAWA
Takayuki SHIMIZUKAWA added the comment: > I think that moving to 'normpath' instead of 'normcase' Official manual says 'abspath' include 'normpath' functionality. I think it is need JUST remove '_os.path.normcase' calling. But, I do not understand the circumstances which use 'normcase'. --

[issue16994] collections.Counter.least_common

2013-01-18 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
New submission from David Coallier: The `collections.Counter` library contains very useful methods for playing with dicts and sets (mainly the most_common()) function. Even though it is fairly trivial to retrieve the least common elements in a Counter() by doing Counter(...).most_common(n)[:-n

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: That makes sense - foo/setup.py can be run from the working directory, but you can't refer to subdirectories on $PATH like that. I've added a revised version of the patch. -- Added file: http://bugs.python.org/file28763/shutil_which_cwd2.patch ___

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: There are also test cases with a string being passed for choices. -- ___ Python tracker ___ ___ Pyth

[issue16468] argparse only supports iterable choices

2013-01-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: If you can somewhat solve the problem by better using the existing api, good. I am not 'stuck' on reusing str/repr*. If metavar is non-optional for non-iterable choices, the doc should say so in the entry for choices. (Does the test suite already have a testca

[issue7563] yield in except clause causes exception context to be lost

2013-01-18 Thread Adam Bielański
Changes by Adam Bielański : -- nosy: +Adam.Bielański ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue11729] libffi assembler relocation check is not robust, fails with clang

2013-01-18 Thread koobs
koobs added the comment: Thanks for the quick response. I'd be happy for it to be FreeBSD conditional/specific if that's more suitable, safer? Having said that, our buildbot OS coverage is pretty good, no? -- ___ Python tracker

[issue11729] libffi assembler relocation check is not robust, fails with clang

2013-01-18 Thread Stefan Krah
Stefan Krah added the comment: koobs wrote: > Stefan, can we merge this to the 2.7 branch as well please? If Benjamin is okay with it, yes. The problem with these configure fixes is that they might break other systems in unexpected ways. I already hesitated to put it into 3.3, but the buildbot

[issue16939] Broken link in 14. Cryptographic Service

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: This was fixed a year and a half ago by issue 12351. For example, see: http://docs.python.org/3/library/crypto.html -- nosy: +chris.jerdonek resolution: -> out of date stage: -> committed/rejected status: open -> closed superseder: -> Update URL for

[issue11729] libffi assembler relocation check is not robust, fails with clang

2013-01-18 Thread koobs
koobs added the comment: Stefan, can we merge this to the 2.7 branch as well please? http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%2Bclang%202.7/builds/308/steps/compile/logs/stdio -- nosy: +koobs ___ Python tracker

[issue16993] shutil.which() should preserve path case

2013-01-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Library (Lib), Windows stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue16993] shutil.which() should preserve path case

2013-01-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Now which lowercase found directory name and extension on Windows. >>> shutil.which("python") 'c:\\python33\\python.exe' Proposed patch preserve case. >>> shutil.which("python") 'C:\\Python33\\python.exe' Please test this on Windows. -- messages:

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: I added some Rietveld comments. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue16991] Add OrderedDict written in C

2013-01-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/