[issue17890] argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors

2013-05-02 Thread paul j3
paul j3 added the comment: Looks like the text = text.strip() at the end of the set of regex (in _format_actions_usage) needs to be replaced with something that removes all excess spaces, e.g. text = _re.sub( '\s+', ' ', text ).strip() -- nosy: +paul.j3

[issue5845] rlcompleter should be enabled automatically

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

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-02 Thread Ben Hoyt
Ben Hoyt added the comment: Ah, this is great. I definitely like the idea of a generator version of os.listdir(). And I like the name iterdir() -- it fits with iteritems() etc. They've gone in 3.x, of course, but listdir didn't change to an iterator, so... See also Betterwalk, my work-in-progr

[issue17891] Wrong MD5 calculation on really long strings and the Hashlib

2013-05-02 Thread Alonso Vidales
New submission from Alonso Vidales: Taking part on a contest I found a bug working with a string of 6227020800 characters, all the characters are the 'a' char. When I execute: hashlib.md5(string).hexdigest() On Python, is takes a pair of seconds (need more to calculate this md5, I think that

[issue17891] Wrong MD5 calculation on really long strings and the Hashlib

2013-05-02 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-02 Thread Ben Hoyt
Ben Hoyt added the comment: Some folks have asked about benchmarks. I don't know about iterdir() vs listdir() -- I kind of suspect the speed gains there wouldn't be big. However, the reason I'm keen on iterdir_stat() is that I'm seeing it speed up os.walk() by a factor of 10 in my recent test

[issue17892] Fix the name of _PyObject_CallMethodObjIdArgs

2013-05-02 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti: The changeset 2dd046be2c88 introduced _PyObject_CallMethodObjIdArgs. This API should have been named _PyObject_CallMethodIdObjArgs since it is the variant of _PyObject_CallMethodId which takes object arguments instead of building arguments from a forma

[issue17892] Fix the name of _PyObject_CallMethodObjIdArgs

2013-05-02 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue17891] Wrong MD5 calculation on really long strings and the Hashlib

2013-05-02 Thread Charles-François Natali
Charles-François Natali added the comment: I'm getting the same hash as CPython with md5sum and openssl, on Linux: $ wc -c data 6227020800 data $ md5sum data 8adbd18519be193db41dd5341a260963 data $ openssl md5 data MD5(data)= 8adbd18519be193db41dd5341a260963 So it's correct, and your system's

[issue17891] Wrong MD5 calculation on really long strings and the Hashlib

2013-05-02 Thread Alonso Vidales
Alonso Vidales added the comment: Seems a problem with the system libs (I use MacOS 10.7.5), I just create a file with 6227020800 'a' chars on a Linux env, and the result is: 8adbd18519be193db41dd5341a260963 I'll try to confirm this. root@tras2:/var/tmp# pypy create_input.py root@tras2:/var/

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-02 Thread Nick Coghlan
Nick Coghlan added the comment: I've had the local Red Hat release engineering team express their displeasure at having to stat every file in a network mounted directory tree for info that is present in the dirent structure, so a definite +1 to os.scandir from me, so long as it makes that info

[issue17893] Refactor reduce protocol implementation

2013-05-02 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti: I have tried to clean up a bit of the implementation of the reduce protocol in typeobject.c in preparation for PEP 3154's support of classes with __new__ using keyword-only arguments. I am not quite done yet with the refactorings, but I would appreciat

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Refactor reduce protocol implementation ___ Python tracker ___ ___ Python-bugs-lis

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-02 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue17851] Grammar errors in threading.Lock documentation

2013-05-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue17871] Wrong signature of TextTestRunner's init function

2013-05-02 Thread Yogesh Chaudhari
Yogesh Chaudhari added the comment: The changes in Docs/library/unittest.rst have been made to reflect proper arguments from Lib/unittest/runner.py -- keywords: +patch nosy: +Yogesh.Chaudhari Added file: http://bugs.python.org/file30106/mywork.patch

[issue1722] Undocumented urllib functions

2013-05-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset c3656dca65e7 by Senthil Kumaran in branch '2.7': # 1722 - Add a note on urllib helper functions like splittype, splithost etc. http://hg.python.org/cpython/rev/c3656dca65e7 -- nosy: +python-dev ___ Python

[issue1722] Undocumented urllib functions

2013-05-02 Thread Senthil Kumaran
Senthil Kumaran added the comment: I had added a note in the documentation c3656dca65e7 conveying that splittype, splithost should not be relied upon, and urlparse should be used for parsing. Also, Python3 does not include these in __all__ - It is in Python2 for backwards compatibility purpos

[issue17805] No such class: multiprocessing.pool.AsyncResult

2013-05-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: It might be simplest to make the implementation match the docs by making AsyncResult an alias for ApplyResult. -- ___ Python tracker ___ _

[issue17892] Fix the name of _PyObject_CallMethodObjIdArgs

2013-05-02 Thread Brett Cannon
Brett Cannon added the comment: It has a leading underscore for a reason; there is no backwards-compatibility guarantee as it's private to CPython internals. Refactor to your heart's content. -- ___ Python tracker

[issue17892] Fix the name of _PyObject_CallMethodObjIdArgs

2013-05-02 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: brett.cannon -> alexandre.vassalotti ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Dmi Baranov
Dmi Baranov added the comment: I think the "function" is a bit misleading. I suggest something like CodecsSearcher, please look at attached implementation (dirty code, just for start discussion about interfaces, lazy caches, etc). -- Added file: http://bugs.python.org/file30107/codecs_

[issue17890] argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors

2013-05-02 Thread Yogesh Chaudhari
Changes by Yogesh Chaudhari : -- keywords: +patch Added file: http://bugs.python.org/file30108/7691d1d4b955.diff ___ Python tracker ___ __

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Nick Coghlan
Nick Coghlan added the comment: This is actually similar to the problem with getting the list of modules an importer provides (that is, we don't currently have an officially defined method in the importer protocol for that, although pkgutil.iter_importer_modules implicitly looks for an "iter_m

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: The point of using a function is to allow the function special hanling of the encoding name, which goes beyond a simple map lookup, i.e. you could do the following: import codecs def search_function(encoding): if not encoding.startswith("append-")

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 02.05.2013 16:41, Nick Coghlan wrote: > > Nick Coghlan added the comment: > > This is actually similar to the problem with getting the list of modules an > importer provides (that is, we don't currently have an officially defined > method in the import

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Paul Moore
Paul Moore added the comment: @doerwalter In that case, I'd take the view that such a codec should simply not return anything. The discovery mechanism can be limited to returning only statically discoverable codec names (and it can be documented as such). The original use case was to support f

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 02.05.2013 16:45, Walter Dörwald wrote: > ... > The search function can't return a list of codec names in this case, as the > list is infinite. True. The search object will have to be allowed to raise a NotImplementedError or some other error/return val

[issue17846] Building Python on Windows - Supplementary info

2013-05-02 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Dmi Baranov
Dmi Baranov added the comment: My +1 for __iter__ with default `raise StopIteration`, it is more elegant solution than declaration and guarantee of the interfaces (based at collections.abc.Callable and collections.abc.Iterator). Paul, result as iterable of CodecInfo objects is gives much more

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 02.05.2013 16:53, Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: > > On 02.05.2013 16:45, Walter Dörwald wrote: >> ... >> The search function can't return a list of codec names in this case, as the >> list is infinite. > > True. >

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Paul Moore
Paul Moore added the comment: On 2 May 2013 16:35, Dmi Baranov wrote: > Paul, result as iterable of CodecInfo objects is gives much more > flexibility than the names of codecs (whats if you will have a few codecs > with the same name in different SearchObjects?) Works for me. My usage would be

[issue13831] get method of multiprocessing.pool.Async should return full traceback

2013-05-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: Attached is a patch for 3.4 which uses the __cause__ hack to embed the remote traceback in the local traceback. It will not work for 2.x though. >>> import multiprocessing, subprocess >>> with multiprocessing.Pool() as p: p.apply(subprocess.Popen, (1,)) ... m

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Dmi Baranov
Dmi Baranov added the comment: Sorry for additional nose - currently there is no way to change the codecs_search_path. Similarly with sys.patch_hooks is a great way to increase the level of customization (maybe I have a faster codec?). -- ___ Python

[issue17890] argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors

2013-05-02 Thread Yogesh Chaudhari
Yogesh Chaudhari added the comment: Made similar required changes for version 2.7 -- nosy: +Yogesh.Chaudhari Added file: http://bugs.python.org/file30110/Issue17890-27.patch ___ Python tracker _

[issue17890] argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors

2013-05-02 Thread Yogesh Chaudhari
Changes by Yogesh Chaudhari : Removed file: http://bugs.python.org/file30108/7691d1d4b955.diff ___ Python tracker ___ ___ Python-bugs-list mai

[issue17892] Fix the name of _PyObject_CallMethodObjIdArgs

2013-05-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8a364deb0225 by Alexandre Vassalotti in branch 'default': Closes #17892: Fix the name of _PyObject_CallMethodObjIdArgs http://hg.python.org/cpython/rev/8a364deb0225 -- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: The latest framing patch looks pretty nice overall. One concern is we need to make sure the C implementation call _Pickler_OpcodeBoundary often enough to keep the frames around the sizes. For example, batch_save_list and batch_save_dict can currently cre

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > One concern is we need to make sure the C implementation call > _Pickler_OpcodeBoundary often enough to keep the frames around the > sizes. For example, batch_save_list and batch_save_dict can currently > create a frame much larger than expected. I don't under

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2013-05-02 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: > I don't understand how that can happen. batch_list() and batch_dict() > both call save() for each item, and save() calls > _Pickler_OpcodeBoundary() at the end. Have I missed something? Ah, you're right. I was thinking in terms of my fast dispatch patch

[issue4727] pickle/copyreg doesn't support keyword only arguments in __new__

2013-05-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Implement PEP 3154 (pickle protocol 4) ___ Python tracker ___ ___ Python-bugs-list

[issue17819] removes need for CONFIG_SITE external configuration

2013-05-02 Thread Matthias Klose
Matthias Klose added the comment: An external config.site is not the only option, you can pass these values in the environment or on the configure command line too. These would not be the only two options, there are more where features of the running kernel are tested, or where a test uses AC_

[issue11872] cPickle gives strange error for large objects.

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: It is an integer overflow issue. It is easy to reproduce without numpy: $ python2.7 -c "import cPickle; cPickle.dumps('\x00' * 2**31)" Traceback (most recent call last): File "", line 1, in SystemError: error return without exception set We fixed this

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2013-05-02 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue9276] pickle should support methods

2013-05-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Implement PEP 3154 (pickle protocol 4) ___ Python tracker ___ ___ Python-bugs-list

[issue17565] segfaults during serialization

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: If you are pickling large objects, you're likely hitting issue #11872. We fixed most 64-bit issues in Python 3, so upgrading might be solution if possible. Since the particular bug you are hitting cannot be reproduced with your test case, I am closing th

[issue14290] Importing script as module causes ImportError with pickle.load

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Without a test case, we cannot tell if this is a bug in pickle or not. Anyhow, Floris's explanation is pretty much on the dot as why you might see this error. -- nosy: +alexandre.vassalotti resolution: -> works for me stage: -> committed/rejecte

[issue12596] cPickle - stored data differ for same dictionary

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: There is no guarantee the binary representation of pickled data will be same between different runs. We try to make it mostly consistent when we can, but there are cases, like this one, where we cannot ensure consistency without hurting performance signi

[issue892902] problem with pickling newstyle class instances

2013-05-02 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I fixed this while working on PEP 3154 [http://hg.python.org/features/pep-3154-alexandre/rev/eed9142d664f]. The relevant piece is @@ -420,7 +424,13 @@ class _Pickler: write(REDUCE) if obj is not None: -self.memoize(obj

[issue17546] Document the circumstances where the locals() dict get updated

2013-05-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ncoghlan stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue17894] Edits to descriptor howto

2013-05-02 Thread Ned Batchelder
New submission from Ned Batchelder: I find the explanations in the Descriptor howto to be difficult to understand. I took a stab at changing the first few sections to introduce the concepts in an easier-to-grasp style. Issue 12077 also covers a little bit of this. -- assignee: docs@p

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-05-02 Thread Adam Brenecki
Changes by Adam Brenecki : -- nosy: +adambrenecki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-02 Thread Roger Serwy
Roger Serwy added the comment: Keeping the sys.stdin reference alive and then reassigning sys.stdin prevents exit() and quit() from actually closing IDLE since site.py's code closes sys.stdin which then does not trigger PyShell's close() method. I updated Terry's patch to explicitly call the c

[issue17890] argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors

2013-05-02 Thread paul j3
paul j3 added the comment: In the test case: class TestMutuallyExclusiveManySuppressed even with a short 'eggs' argument, there is a difference Old usage would be: usage: PROG [-h] [--eggs EGGS] new usage: PROG [-h] [--eggs EGGS] i.e. 2 v 1 space. But extra spaces are not as dramatic a fai

[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-05-02 Thread Georg Brandl
Georg Brandl added the comment: Is this applicable to 3.2? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h