[issue9625] argparse: Problem with defaults for variable nargs when using choices

2013-06-27 Thread paul j3
paul j3 added the comment: I've added 2 more tests, one with default='c', which worked before. one with default=['a','b'], which only works with this change. http://bugs.python.org/issue16878 is useful reference, since it documents the differences between nargs=? and nargs=*, and their

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18313 ___ ___ Python-bugs-list mailing list

[issue18312] make distclean deletes files under .hg directory

2013-06-27 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- versions: +Python 3.3 -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18312 ___

[issue18312] make distclean deletes files under .hg directory

2013-06-27 Thread STINNER Victor
STINNER Victor added the comment: Extract of GNU standards: # make distclean # Delete all files from the current directory that are created by # configuring or building the program. If you have unpacked the # source and built the program without creating any other files, #

[issue18312] make distclean deletes files under .hg directory

2013-06-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 27.06.2013 09:36, STINNER Victor wrote: STINNER Victor added the comment: Extract of GNU standards: # make distclean # Delete all files from the current directory that are created by # configuring or building the program. If you have

[issue18309] Make python slightly more relocatable

2013-06-27 Thread Mathias Fröhlich
Mathias Fröhlich added the comment: Hi Eric, Thanks for looking at that ticket so fast! Reassigning this to 3.4 is great. In general, yes I can already do what I need more or less. This is the reason why I can be fine with about every python version. The point I bring up this change that I

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Thanks for your comments Christian. You don't check ERR_GET_LIB() in some places. Do you have a particular place in mind? About DER. As I understand, currently _ssl only supports PEM. If that is the case, then supporting DER should, IMHO, be a

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Christian Heimes
Christian Heimes added the comment: I found two places: if (ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE) { if (ERR_GET_REASON(err) == PEM_R_BAD_BASE64_DECODE) AFAIK the _ssl module only supports PEM certs for loading. On the other hands cert data can only be retrieved as dict

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: It feels a bit strange to treat PEM certs as binary data, especially since the SSL module treats PEM as ASCII unicode. For example DER_cert_to_PEM_cert() accepts bytes and returns str, PEM_cert_to_DER_cert() converts str to bytes. I agree that PEM is

[issue13483] Use VirtualAlloc to allocate memory arenas

2013-06-27 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13483 ___

[issue13483] Use VirtualAlloc to allocate memory arenas

2013-06-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 44f455e6163d by Martin v. Löwis in branch 'default': Issue #13483: Use VirtualAlloc in obmalloc on Windows. http://hg.python.org/cpython/rev/44f455e6163d -- nosy: +python-dev ___ Python tracker

[issue16113] Add SHA-3 (Keccak) support

2013-06-27 Thread Christian Heimes
Christian Heimes added the comment: Hi Aaron, it's a tempting idea but I have to decline. The API is deliberately limited to the NIST interface. Once OpenSSL gains SHA-3 support we are going to use it in favor for the reference implementation. I don't expect OpenSSL to provide the full

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Ok, thanks. The consistency argument is strong, also Antoine's suggestion to use the return type of read() as a discriminant. also please excuse me because I am not a habitual user of Python 3 and haven't become used to the str/binary dichotomy yet.

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Christian Heimes
Christian Heimes added the comment: EVE Online is still using Python 2.7? You gotta hurry up or Guido will beat you with Dropbox's 3.x port. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16487

[issue18312] make distclean deletes files under .hg directory

2013-06-27 Thread Eric V. Smith
Eric V. Smith added the comment: My plan is to just fix this issue, right now, by changing the find command to be: find $(srcdir)/[a-zA-Z]* ... That fixes this bug and keeps the current functionality. If someone wants to open another issue about changing what distclean does, I think

[issue18309] Make python slightly more relocatable

2013-06-27 Thread Nick Coghlan
Nick Coghlan added the comment: The way we figure out where to find the standard library is crazy, and creating the infrastructure to start making it less crazy is actually one of the prime motivations for PEP 432 :) -- ___ Python tracker

[issue18314] Have os.unlink remove junction points

2013-06-27 Thread Kim Gräsman
New submission from Kim Gräsman: os.unlink currently raises a WindowsError (Access Denied) if I attempt to unlink an NTFS junction point. It looks trivial to allow Py_DeleteFileW [1] to remove junction points as well as proper symbolic links, as far as I can tell. For example, the

[issue18314] Have os.unlink remove junction points

2013-06-27 Thread Kim Gräsman
Kim Gräsman added the comment: Also, I believe the reason os.unlink raises access denied is because a junction point does not currently qualify as a directory link, so its path is passed directly to DeleteFileW, which in turn refuses to delete a directory. --

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-27 Thread Łukasz Langa
Łukasz Langa added the comment: The reason why I think it's wrong to special-case ABCs that are explicitly in the MRO is that it's only one of four methods of virtual subclassing: 1. Explicit MRO; 2. Abstract functionality implicitly implemented without any form of registration; 3.

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure what you're saying. Given the function definition, the way you're calling it is incorrect, and the error messages explain why. Are you saying that these ways to call repeatfunc() are documented somewhere that needs fixing? I couldn't find that on

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18313 ___ ___

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread py.user
Changes by py.user bugzilla-mail-...@yandex.ru: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18313 ___ ___

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread py.user
py.user added the comment: it should be: def repeatfunc(func, times, *args): and None for times described in the docstring -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18313

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread Eric V. Smith
Eric V. Smith added the comment: I see. You can't call repeatfunc() and specify times with a named argument because of *args. Interesting. I'll let Raymond weigh in. -- status: pending - open ___ Python tracker rep...@bugs.python.org

[issue16251] pickle special methods are looked up on the instance rather than the type

2013-06-27 Thread Eric Snow
Eric Snow added the comment: A backward compatible solution would be to do lookup on the class after trying the instance (and that came back None or isn't callable). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16251

[issue18315] bufsize parameter not documented in 2.7.5

2013-06-27 Thread Terrel Shumway
New submission from Terrel Shumway: for line in fileinput.input(files,inplace,backup,rU): File /usr/lib/python2.7/fileinput.py, line 253, in next line = self.readline() File /usr/lib/python2.7/fileinput.py, line 346, in readline self._buffer = self._file.readlines(self._bufsize)

[issue18315] bufsize parameter not documented in 2.7.5

2013-06-27 Thread Terrel Shumway
Terrel Shumway added the comment: http://hg.python.org/cpython/file/4dbbf322a9df/Lib/fileinput.py In the process, I added an optional bufsize argument to the input() function and the FileInput class. -- ___ Python tracker rep...@bugs.python.org

[issue18315] bufsize parameter not documented in 2.7.5

2013-06-27 Thread R. David Murray
R. David Murray added the comment: A quick look at the VCS history indicates bufsize has been in there for a long time. The sphinx docs are wrong as well. This is correctly documented in python3, apparently as part of the conversion from [] notation to keyword notation in d143eb624cf5.

[issue18315] bufsize parameter not documented in 2.7.5

2013-06-27 Thread Terrel Shumway
Terrel Shumway added the comment: http://hg.python.org/cpython/file/68c776ba5ea5/Lib/fileinput.py This is where the incorrect docstrings get added. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18315

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-27 Thread Guido van Rossum
Guido van Rossum added the comment: Hm. I interpret explicit is better than implicit very differently. I see a strict priority ordering from better to worse, in cases that would otherwise be ambiguous: 1. explicit base class (ABC or otherwise) 2. ABC explicitly registered 3. ABC implicitly

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: 2.7 is the pinnacle of pythonic achievement. Particularly our branch of it :) One day we'll move, I'm sure, when there is an opportune moment. For example, if we were to start supporting a new game, a new platform. But for now, if it ain't broke, we

[issue18315] bufsize parameter not documented in 2.7.5

2013-06-27 Thread Terrel Shumway
Terrel Shumway added the comment: Here is a patch against the 2.7 branch. It will probably also apply to 2.6 if anyone cares. -- keywords: +patch Added file: http://bugs.python.org/file30712/fileinput-document-bufsize.patch ___ Python tracker

[issue18315] bufsize parameter not documented in 2.7.5

2013-06-27 Thread Terrel Shumway
Terrel Shumway added the comment: Oops. I messed up, even on such a tiny fix. #:( -- Added file: http://bugs.python.org/file30713/fileinput-document-bufsize.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18315

[issue18242] IDLE should not be replacing warnings.formatwarning

2013-06-27 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- Removed message: http://bugs.python.org/msg191926 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18242 ___

[issue18242] IDLE should not be replacing warnings.formatwarning

2013-06-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: See #18101 for patch that will fix this also. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18242 ___ ___

[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2013-06-27 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17580 ___ ___

[issue18316] Idle 2.7: update to simply cross-version patches

2013-06-27 Thread Terry J. Reedy
New submission from Terry J. Reedy: In a commiters-list discussion of heuristics for what patches can go into non-Idle 2.7, Nick Coghlan offered simplifying cross-version maintenance. (He also mentioned addressing issues that arise due to changes in the underlying platforms, which is another

[issue18316] Idle 2.7: update to simply cross-version patches

2013-06-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: I wrote a short script (already uploded) to differ 2.7 and 3.3 versions of an idlelib file. Applied to PyShell, I see unnecessary differences, like 'a,b' changed to 'a, b', or 'not a in b' changed to 'a not in b' only in 3.3 (probably for 3.0 when the

[issue18316] Idle 2.7: update to simplify cross-version patches

2013-06-27 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- title: Idle 2.7: update to simply cross-version patches - Idle 2.7: update to simplify cross-version patches ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18316

[issue11016] Re-implementation of the stat module in C

2013-06-27 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/issue11016 ___

[issue18217] Deprecate and remove gettext.install

2013-06-27 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18217 ___ ___ Python-bugs-list mailing list

[issue10529] Write argparse i18n howto

2013-06-27 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10529 ___ ___ Python-bugs-list mailing list

[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-27 Thread Jakub Wilk
New submission from Jakub Wilk: It is possible to craft a MO file with Plural-Forms taking arbitrary amounts of CPU and memory to evaluate. A test case is attached. I realize that opening unstrusted MO files is a rather unusual use case, but the module already contains some code to protect

[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-27 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: Added file: http://bugs.python.org/file30716/testcase.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18317 ___

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2013-06-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1d5856849e64 by R David Murray in branch '3.3': #14360: make encoders.encode_quopri work. http://hg.python.org/cpython/rev/1d5856849e64 New changeset 9046ef201591 by R David Murray in branch 'default': Merge #14360: make encoders.encode_quopri

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2013-06-27 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14360 ___ ___

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2013-06-27 Thread R. David Murray
R. David Murray added the comment: This should now be fixed. Calling MIMEApplication with a binary payload and passing it encode_quopri as the encoder will now actually work. -- resolution: - fixed stage: needs patch - committed/rejected versions: +Python 3.4 -Python 3.2

[issue18318] Idle: stop depending on console output

2013-06-27 Thread Terry J. Reedy
New submission from Terry J. Reedy: It appears that Idle was originally written to run on *nix after being launched from a command-line console. Messages related to Idle code (warnings and exceptions) are sent back to the console, while messages related to user code go to the shell window.

[issue18319] gettext() cannot find translations with plural forms

2013-06-27 Thread Jakub Wilk
New submission from Jakub Wilk: gettext() cannot find translations for messages that have plural forms. I would expect that gettext(s) is equivalent to ngettext(s, s, 1) for such messages, as it is implemented in GNU gettext. import gettext with open('test.mo', 'rb') as mo: trans =

[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-27 Thread Christian Heimes
Christian Heimes added the comment: Thanks, can you please provide the PO file, too? Or did you construct the MO file manually? -- nosy: +christian.heimes stage: - test needed versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python

[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-27 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- nosy: +loewis, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18317 ___ ___

[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-27 Thread Christian Heimes
Christian Heimes added the comment: Ah, I see what you are doing. Nice catch! Plural-Forms: nplurals=0; plural=42**42**42; The plural form gets parsed by gettext.c2py() and eventually turned into a lambda that executes int(42**42**42). Perhaps a custom AST visitor could be used to filter out

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2013-06-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Okay, I have updated the patch as suggested. string mode means PEM encoding, binary mode DER encoding. Note that DER encoding is more limited, there is no way to concatentate private keys and certificates into one file (the PEM decoder searches the file

[issue16113] Add SHA-3 (Keccak) support

2013-06-27 Thread Aaron Gallagher
Aaron Gallagher added the comment: https://pypi.python.org/pypi/cykeccak/ is what I've written to do this, for reference. Honestly I hope that the Keccak sponge is directly exposed in openssl (or any other SHA-3 implementation) because of its utility beyond SHA-3. If the source of some

[issue16468] argparse only supports iterable choices

2013-06-27 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list

[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: Why do we have support for untrusted MO files? -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18317 ___

[issue9938] Documentation for argparse interactive use

2013-06-27 Thread Andrew Berg
Andrew Berg added the comment: What is the status of this? If the patch looks good, then will it be pushed into 3.4? -- nosy: +aberg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9938 ___

[issue9938] Documentation for argparse interactive use

2013-06-27 Thread R. David Murray
R. David Murray added the comment: It's great that this patch was provided. Xuanji, can you submit a contributor agreement, please? The patch is missing an update to the documentation. (Really the patch should have been in a separate issue, as requested, since this one is about improving

[issue9938] Documentation for argparse interactive use

2013-06-27 Thread Andrew Berg
Andrew Berg added the comment: The patch doesn't work for 3.3 (I think it's just because the line numbers are different), but looking over what the patch does, it looks like parse_known_args will return a value for args if there is an unrecognized argument, which will cause parse_args to call

[issue18081] test_logging failure in WarningsTest on buildbots

2013-06-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Improved 3.3 patch with tests incorporates Vinay's capture_warnings function to uncapture at end of import and main exit. I plan to apply after checking other versions and close this issue. -- Added file: