[issue13386] Document documentation conventions for optional args

2011-11-13 Thread Eli Bendersky
Eli Bendersky added the comment: What you say makes sense, now I just have to dig up where I saw instances of [, opt1, opt2] If anything, this is another proof that such conventions must be agreed upon and meticulously documented. -- ___ Python tr

[issue13386] Document documentation conventions for optional args

2011-11-13 Thread Ezio Melotti
Ezio Melotti added the comment: > You should also explicitly specify what happens in several optional but > not keyword args are needed. AFAIU the convention is: > func(arg1, arg2[, opt1, opt2]) IIUC that would mean that either you pass only arg1 and arg2, or you also pass both opt1 and opt

[issue12875] backport re.compile flags default value documentation

2011-11-13 Thread Ezio Melotti
Changes by Ezio Melotti : -- resolution: -> fixed stage: commit review -> committed/rejected ___ Python tracker ___ ___ Python-bugs-l

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: The differential cost of generating n random bytes is negligible compared to actually doing anything with the bytes once their generated. This optimization is close to being a total waste (saving 15 milliseconds for the abnormal case of generating 1 mill

[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-13 Thread STINNER Victor
STINNER Victor added the comment: > I notice that the patch changes rename() and link() to use > win32_decode_filename() to coerce the filename to unicode before using > the "wide" win32 api. Well, I did that to simplify the source code. > (Previously, rename() first tried the wide api, > fall

[issue11836] multiprocessing.queues.SimpleQueue is undocumented

2011-11-13 Thread Eli Bendersky
Eli Bendersky added the comment: However, sentinels *are* mentioned in the multiprocessing doc, below multiprocessing.Process: " sentinel A numeric handle of a system object which will become “ready” when the process ends. On Windows, this is an OS handle usable with the WaitForSing

[issue13229] Improve tools for iterating over filesystem directories

2011-11-13 Thread Nick Coghlan
Nick Coghlan added the comment: And walkdir is now a published package: http://walkdir.readthedocs.org My plan for this issue now is to maintain walkdir as a standalone package for 2.7 and 3.2, but still add the functionality to shutil for 3.3+. However, I'll gather feedback on the PyPI modul

[issue11836] multiprocessing.queues.SimpleQueue is undocumented

2011-11-13 Thread Eli Bendersky
Eli Bendersky added the comment: Sandro - yep, the sentinels arg is also undocumented in multiprocessing.PipeConnection.recv() and further down the road... -- ___ Python tracker __

[issue13398] _cursesmodule does not build, doesn't find Python.h on Solaris

2011-11-13 Thread Maciej Bliziński
Changes by Maciej Bliziński : -- title: _cursesmodule missing Python.h on Solaris -> _cursesmodule does not build, doesn't find Python.h on Solaris ___ Python tracker ___ __

[issue13398] _cursesmodule missing Python.h on Solaris

2011-11-13 Thread Maciej Bliziński
New submission from Maciej Bliziński : Compilation of Python 3.2.2 fails on Solaris 9 as follows: /opt/SUNWspro/bin/cc -xcode=pic32 -xO3 -m32 -xarch=v8 -I/opt/csw/include -c ./Modules/_cursesmodule.c -o Modules/_cursesmodule.o "./Modules/_cursesmodule.c", line 105: cannot find include file: "

[issue13386] Document documentation conventions for optional args

2011-11-13 Thread Eli Bendersky
Eli Bendersky added the comment: Ezio, regarding your latest message: "The problem is when the default placeholder is some unique object() or some _internal value (we had something similar with a socket timeout once)." I hope this should be rare enough not to present a significant problem w

[issue13239] Remove <> operator from Grammar/Grammar

2011-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset a259511351d9 by Eli Bendersky in branch '3.2': Clarify the existence of the <> operator in Grammar/Grammar with a comment, for issue 13239 http://hg.python.org/cpython/rev/a259511351d9 New changeset 410115400838 by Eli Bendersky in branch 'default

[issue13388] document hg commit hooks in the devguide

2011-11-13 Thread Eli Bendersky
Eli Bendersky added the comment: An updated patch attached, explaining that several issues can be mentioned in a single commit message -- Added file: http://bugs.python.org/file23683/issue13388.2.patch ___ Python tracker

[issue12875] backport re.compile flags default value documentation

2011-11-13 Thread Eli Bendersky
Changes by Eli Bendersky : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue12875] backport re.compile flags default value documentation

2011-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 87ecfd5cd5d1 by Eli Bendersky in branch '2.7': Normalize the keyword arguments documentation notation in re.rst. Closes issue #12875 http://hg.python.org/cpython/rev/87ecfd5cd5d1 -- ___ Python tracker

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : Removed file: http://bugs.python.org/file23679/getrandbytes.patch ___ Python tracker ___ ___ Python-bugs-lis

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: ./python -m timeit -s "from random import getrandbits" "getrandbits(800).to_bytes(100, 'little')" 10 loops, best of 3: 25 msec per loop ./python -m timeit -s "from random import getrandbytes" "getrandbytes(100)" 100 loops, best of 3: 9.66 mse

[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +flox, loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- components: +Library (Lib) priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list maili

[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Raymond Hettinger
New submission from Raymond Hettinger : Currently, an XMLRPC client communicating with a server running Python can make Python style calls but exceptions get collapsed into a standard FaultException making it difficult to program in a Pythonic style: proxy = xmlrpc.client.ServerProxy("http://l

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The problem is that we need an API that will accommodate other random > number generators and not be specific to the MersenneTwister. Right > now, the starting point for everything in the random module is an > underlying generator supplying a random() method

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > genrand_int32 is an internal function, > only available in C for the Mersenne Twister generator. Yes, I know. I'm the one added that code ;-) > I don't know other generators. The problem is that we need an API that will accommodate other random number

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > How would this work for other random number generators that don't > supply genrand_int32()? genrand_int32 is an internal function, only available in C for the Mersenne Twister generator. random.SystemRandom() should provide getrandbytes as well, it wou

[issue13388] document hg commit hooks in the devguide

2011-11-13 Thread Eli Bendersky
Eli Bendersky added the comment: Nice, I didn't know about issue #2771 ;-) Will update the patch! -- ___ Python tracker ___ ___ Pyth

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: How would this work for other random number generators that don't supply genrand_int32()? The API for random is supposed to be easily subclassable and reusable for other random number generators. The requirements for those generators is intentionally kep

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue13217] Missing header dependencies in Makefile

2011-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you for the patch. I only applied it to 3.3, since 3.2 doesn't have the additional header files. -- resolution: -> invalid stage: patch review -> committed/rejected status: open -> closed versions: -Python 3.2 _

[issue13217] Missing header dependencies in Makefile

2011-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 36375075d6aa by Antoine Pitrou in branch 'default': Issue #13217: add missing header dependencies in the Makefile for unicodeobject.o. http://hg.python.org/cpython/rev/36375075d6aa -- nosy: +python-dev

[issue13355] random.triangular error when low = high=mode

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've got this one. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue13204] sys.flags.__new__ crashes

2011-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the patch. You should add the same tests for sys.version_info and sys.getwindowsversion. -- nosy: +pitrou stage: -> patch review ___ Python tracker __

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Good idea, IMO. +cum = set() +for i in range(100): +val = getbytes(span) +cum |= set(i for i in range(span) if val[i]) +self.assertEqual(len(cum), span) I find this test a bit strange. Also, p

[issue13390] Hunt memory allocations in addition to reference leaks

2011-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: And the latest patch (debugblocks3.patch) adds said heuristic. -- ___ Python tracker ___ ___ Python

[issue13390] Hunt memory allocations in addition to reference leaks

2011-11-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : Added file: http://bugs.python.org/file23681/debugblocks3.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue13390] Hunt memory allocations in addition to reference leaks

2011-11-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : Added file: http://bugs.python.org/file23680/debugblocks2.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue13388] document hg commit hooks in the devguide

2011-11-13 Thread Ezio Melotti
Ezio Melotti added the comment: ...because the hook now supports multiple issue id in the same commit message. -- ___ Python tracker ___

[issue13388] document hg commit hooks in the devguide

2011-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4fcac92a80a by Ezio Melotti in branch 'default': Closes #2771. #13388 now needs to be updated. http://hg.python.org/test/rev/e4fcac92a80a -- nosy: +python-dev ___ Python tracker

[issue2771] Test issue

2011-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4fcac92a80a by Ezio Melotti in branch 'default': Closes #2771. #13388 now needs to be updated. http://hg.python.org/test/rev/e4fcac92a80a -- nosy: +python-dev resolution: -> fixed stage: test needed -> committed/rejected status: open -> c

[issue2771] Test issue

2011-11-13 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: -python-dev resolution: fixed -> stage: committed/rejected -> test needed status: closed -> open ___ Python tracker ___ __

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc : I noticed that several usages of random.getrandbits() actually need bytes. A few examples: - Lib/test/test_zlib.py calls "random.getrandbits(8 * _1M).to_bytes()" - Twisted uses the %x format and then call .decode('hex') Another examples found with Code

[issue2771] Test issue

2011-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e94d9bef251 by Ezio Melotti in branch 'default': Closes #2771. #13388 now needs to be updated. http://hg.python.org/test/rev/0e94d9bef251 -- nosy: +python-dev resolution: -> fixed stage: test needed -> committed/rejected status: open -> c

[issue2771] Test issue

2011-11-13 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: -python-dev resolution: fixed -> stage: committed/rejected -> test needed status: closed -> open ___ Python tracker ___ __

[issue13390] Hunt memory allocations in addition to reference leaks

2011-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the comments, here is a new patch addressing them. I've kept the C API available in all builds (since it's private), but sys.getallocatedblocks() is only available in debug builds. As for the memory leak run results, I think we may have to devise a

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-11-13 Thread Paul Moore
Changes by Paul Moore : -- nosy: +pmoore ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue13395] Python ISO-8859-1 encoding problem

2011-11-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: Apparently, you are using the interactive shell on Microsoft Windows. This will use the "OEM code page"; which one that is depends on the exact Windows regional version you are using. You shouldn't decode the string with 'latin-1', but with sys.stdin.encodin

[issue13395] Python ISO-8859-1 encoding problem

2011-11-13 Thread Ezio Melotti
Ezio Melotti added the comment: This doesn't seem a bug to me, so you should ask for help somewhere else. You can try to pass a unicode arg to listdir to get unicode back, and double check what the input actually is. -- resolution: -> invalid stage: -> committed/rejected status: open

[issue13395] Python ISO-8859-1 encoding problem

2011-11-13 Thread Hugo Silva
New submission from Hugo Silva : Hi all, I'm facing a huge encoding problem in Python when dealing with ISO-8859-1 / Latin-1 character set. When using os.listdir to get the contents of a folder I'm getting the strings encoded in ISO-8859-1 (ex: ''Ol\xe1 Mundo''), however in the Python interpr

[issue13394] Patch to increase aifc lib test coverage with couple of minor fixes

2011-11-13 Thread Oleg Plakhotnyuk
Oleg Plakhotnyuk added the comment: Thanks for your review, Ezio! Here goes new patch with all issues you've mentioned been fixed. -- Added file: http://bugs.python.org/file23678/test_aifc2.patch ___ Python tracker