[issue14370] enumerate() lead to system crashes

2012-03-19 Thread aaron315
aaron315 added the comment: Have not been able to respond in a lower performance on the computer running, I restart the computer; On another computer, indeed MemoryError。 -- ___ Python tracker ___

[issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2

2012-03-19 Thread Dave Burton
Dave Burton added the comment: "expect?" Did I type that?? Should be "try/except," of course. -- ___ Python tracker ___ ___ Python-

[issue14370] enumerate() lead to system crashes

2012-03-19 Thread Brian Curtin
Brian Curtin added the comment: I just get a MemoryError. Do you actually receive a crash? -- nosy: +brian.curtin ___ Python tracker ___

[issue14370] enumerate() lead to system crashes

2012-03-19 Thread aaron315
New submission from aaron315 : alist=list(range(5)) alist.extend(enumerate(alist)) the computer will down !!! -- messages: 156379 nosy: aaron315 priority: normal severity: normal status: open title: enumerate() lead to system crashes type: performance versions: Python 3.2 __

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-19 Thread telmich
telmich added the comment: Dear Charles-François, for everybody who is not *programming* python (imagine there is a *real* user) the tracebacks are useless. Even worse, because the error messages are *changing*, because of different library parts not catching the exception. Thus someone who

[issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords

2012-03-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fine with me now. 2012/3/19 Larry Hastings : > > Larry Hastings added the comment: > > Whoops!  Actually, I did.  But then I promptly forgot about them.  They're > now all incorporated; please see attached patch. > > -- > Added file: http://bugs.py

[issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords

2012-03-19 Thread Larry Hastings
Larry Hastings added the comment: Whoops! Actually, I did. But then I promptly forgot about them. They're now all incorporated; please see attached patch. -- Added file: http://bugs.python.org/file24955/larry.parsekwonly.diff.7.txt ___ Python tra

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-19 Thread Larry Hastings
Larry Hastings added the comment: > The patch looks good to me. I was going to commit it > but then I realized that Larry is a core developer. Indeed; please permit me the pleasure of checking it in myself. That is, assuming I actually get the go-ahead someday. (Probably in the far-flung fu

[issue9408] curses: Link against libncursesw instead of libncurses

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > I should maybe open a *Debian* bug Done: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602720 I don't think that we should drop support of libncurses because it is still the only option on some OSes. I'm closing the issue because it is now fixed in Debi

[issue10496] Python startup should not require passwd entry

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > I’d be happy to update it to address my remarks if you want me to. Please write your own patch addressing your concerns. -- ___ Python tracker _

[issue14249] unicodeobject.c: aliasing warnings

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: Attached patch uses an union to make the compiler warning quiet. It should not speed up Python because the function already ensures that the pointer is aligned to the size of a long. It may slow down the function, I don't know gcc enough to guess exactly the

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: My patch looses precision for big numbers. It's better to convert Decimal to a number of microseconds. Wrong: >>> value=86400*365.25*99+1e-6; print(datetime.timedelta(seconds=value)) 365249634 days, 18:00:00 >>> value=decimal.Decimal(86400*365.25*99)+

[issue14366] Supporting bzip2 and lzma compression in zip files

2012-03-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: For EOS, please re-read the specification. If you then still think it is not needed, read it again :-) The documentation in liblzma is irrelevant, only the PKWARE specification matters. Take particular notice of the phrase "implementers should include the EO

[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. I was going to commit it but then I realized that Larry is a core developer. Last nits: you should add a newline after } in "} else {", and it would be better to move billion variable into fill_time(). Something like: static void

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-19 Thread Larry Hastings
Larry Hastings added the comment: Incorporated Victor's reinstated assert suggestion. Fingers crossed. -- Added file: http://bugs.python.org/file24952/larry.st_mtime_ns.patch.8.txt ___ Python tracker

[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-19 Thread R. David Murray
R. David Murray added the comment: I applied both patches, and I get 16 test failures in test_smtpd. I haven't looked at the errors, but probably most of them are lack of a HELO in the test. -- ___ Python tracker

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > Revision 7 of my patch. -assert(sizeof(time_t) <= sizeof(long)); You should keep this assertion in _PyLong_FromTime_t(). -- ___ Python tracker

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: memory_watchdog.py should probably use sys.stdout.flush(), and you should replace print("...") by sys.stdout.write("...\n") to only call sys.stdout.write once (print calls write a second time just to write the newline). +1 for the subprocess instead of the th

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-19 Thread Larry Hastings
Larry Hastings added the comment: Revision 7 of my patch. Incorporates all suggestions from Georg. Added "as an integer" in the docs to make Antoine happy. If I fail to create the "billion" int in INITFUNC, I return NULL and leak references. I figure this is fine, as a) the other such test

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-19 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a new version, with a dedicated script for the watchdog process. -- Added file: http://bugs.python.org/file24950/mem_watchdog_1.diff ___ Python tracker ___

[issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords

2012-03-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Did you not see Georg's comments? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords

2012-03-19 Thread Larry Hastings
Larry Hastings added the comment: Anyone else? Or can I get the go-ahead? -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue14310] Socket duplication for windows

2012-03-19 Thread sbt
sbt added the comment: > If duplication happened early, then there would have to be a way to > "unduplicate" it in the source process if, say, IPC somehow failed. > There is currently no api to undo the effects of WSADuplicateSocket(). If this were a normal handle then you could use the DUPL

[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-19 Thread Jason Killen
Jason Killen added the comment: Change of the smtpd test code to match the wording from the smtpd.patch. Also, added \r\n to the end of the expected string. -- Added file: http://bugs.python.org/file24949/test_smtpd.patch ___ Python tracker

[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-19 Thread Jason Killen
Jason Killen added the comment: Redone diff including wording preferred by R. David Murray. -- Added file: http://bugs.python.org/file24948/smtpd.patch ___ Python tracker ___ __

[issue14369] make __closure__ writable

2012-03-19 Thread Yury Selivanov
Yury Selivanov added the comment: Updated patch as per Andrew's code review. Thank you. -- Added file: http://bugs.python.org/file24947/writable_closure_02.patch ___ Python tracker ___

[issue14369] make __closure__ writable

2012-03-19 Thread Yury Selivanov
Changes by Yury Selivanov : Added file: http://bugs.python.org/file24946/writable_closure.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue14369] make __closure__ writable

2012-03-19 Thread Yury Selivanov
Changes by Yury Selivanov : Removed file: http://bugs.python.org/file24943/writable_closure.patch ___ Python tracker ___ ___ Python-bugs-list

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Good point. The docs don't actually say, except that the docs show a pretty elaborate process dance, where the source process only closes its side of the socket once the target process has called WSASocket(). If duplication happened early, then there

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-19 Thread R. David Murray
R. David Murray added the comment: If one could distinguish that python had ended because of a sigint from the error code, then it would be possible for the caller to throw away stderr in that case. I agree with the OP that that having to deal with the traceback when you know what you want i

[issue14310] Socket duplication for windows

2012-03-19 Thread sbt
sbt added the comment: > I think this captures the functionality better than "duplicate" or > duppid() since there is no actual duplication involved until the > fromshare() function is called. Are you saying the WSADuplicateSocket() call in share() doesn't duplicate the handle in to the targ

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-19 Thread Charles-François Natali
Charles-François Natali added the comment: I must be missing something, but I fail to see the problem here. Basically, when SIGINT is received before the user code is run, it's caught by the default handler which prints a traceback and exits. What's wrong with that? Not catching SIGINT would r

[issue14296] Compilation error on CentOS 5.8

2012-03-19 Thread Charles-François Natali
Changes by Charles-François Natali : -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

2012-03-19 Thread Jakub Warmuz
Jakub Warmuz added the comment: Attached quick&dirty fix I'm currently using in my project. Maybe this will help to create a valid patch. Instead of changing _parse_optional, I've overridden _get_option_tuples to scan subparsers for matching optional arguments if option is ambiguous in the c

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is a new version of thepatch. We now have socket.socket.share(pid) and socket.fromshare(data) to do these. I think this captures the functionality better than "duplicate" or duppid() since there is no actual duplication involved until the fromsha

[issue14369] make __closure__ writable

2012-03-19 Thread Yury Selivanov
New submission from Yury Selivanov : __code__ and __closure__ are designed to work together. There is no point in allowing to completely substitute the __code__ object, but protecting the __closure__. -- components: Interpreter Core files: writable_closure.patch keywords: patch messag

[issue14359] _posixsubprocess.o compilation error on CentOS 5.8

2012-03-19 Thread Ross Lagerwall
Ross Lagerwall added the comment: Thanks! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue12568] Add functions to get the width in columns of a character

2012-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Has anyone tested wcswidth on FreeBSD, old Solaris? With non-utf8 locales? -- nosy: +storchaka ___ Python tracker ___ ___

[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-19 Thread Gregory P. Smith
Gregory P. Smith added the comment: 2.7 and 3.2 have been fixed. I'm keeping this open as a reminder to investigate how 3.3 behaves. I'll fix it or close it after verifying that. -- versions: +Python 3.3 -Python 2.7, Python 3.2 ___ Python tracker

[issue14338] Document how to forward POST data on redirects

2012-03-19 Thread Jay Deiman
Jay Deiman added the comment: I actually just worked around this issue in my library to do specifically what I needed it to do, which was an automatic redirect POST with data. As far as general recipes are concerned, anyone could just follow what I did in my library at: https://github.com/c

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : Removed file: http://bugs.python.org/file24941/argparse_howto3.patch ___ Python tracker ___ ___ Python-bugs-

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: Fixing a markup error. Sorry for the noise. -- Added file: http://bugs.python.org/file24942/argparse_howto3.patch ___ Python tracker ___d

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Nick Coghlan added the comment: > > Rather than "is recommended by at least one core CPython developer" I'd say > "matches the way the CPython executable handles its own verbosity argument" > (check the output of "python --help") Done. > Also, a bet

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: On second thought, sendinfo/recvinfo makes no sense. On unix, one has to create and manage the necessary unix domain sockets, and such code belongs higher up somewhere. So dupinfo(pid), and frominfo() I'll add. -- __

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I like the idea of having a frominfo() function. Though "info" is maybe too generic? Also, dupinfo() is probably better than duplicate, even though there is no dup involved. But I also wonder if we can make this windows/unix agnostic? on unix, you w

[issue14309] Deprecate time.clock()

2012-03-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> There's no other single function providing the same functionality > > time.clock() is not portable: it is a different clock depending on the OS. To > write portable code, you have to use t

[issue14366] Supporting bzip2 and lzma compression in zip files

2012-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you, Martin, for review and advices. Lzma in zip format: 2-bytes version (LZMA SDK version, it has not relations with version of XZ Utils used by lzma module), 2-bytes properties size (I have not seen a value other than 5), N-bytes (N=5) property data

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I'm adding an updated version of the patch, taking into account issues raised from reviewers. No documentation yet. -- Added file: http://bugs.python.org/file24940/duplicate.patch ___ Python tracker

[issue14034] Add argparse howto

2012-03-19 Thread Nick Coghlan
Nick Coghlan added the comment: Rather than "is recommended by at least one core CPython developer" I'd say "matches the way the CPython executable handles its own verbosity argument" (check the output of "python --help") Also, a better fix for the non-orderable types problem is to use "defau

[issue12568] Add functions to get the width in columns of a character

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > Martin: I agree that there are going to be cases where it is not > correct because the terminal does something strange, but what we > need is something that gets as close as possible to what the > terminal is likely to be doing Can't we expose wcswidth() as l

[issue14222] Use time.steady() to implement timeout

2012-03-19 Thread STINNER Victor
Changes by STINNER Victor : -- title: Using time.time() in Queue.get breaks when system time is changed -> Use time.steady() to implement timeout ___ Python tracker ___

[issue14318] clarify "may not" in time.steady docs

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: FYI "may not" comes from the C++ Timeout Specification: "Objects of class steady_clock represent clocks for which values of time_point never decrease as physical time advances and for which values of time_point advance at a steady rate relative to real time.

[issue14309] Deprecate time.clock()

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > There's no other single function providing the same functionality time.clock() is not portable: it is a different clock depending on the OS. To write portable code, you have to use the right function: - time.time() - time.steady() - os.times(), resource.

[issue14368] floattime() should not raise an exception

2012-03-19 Thread STINNER Victor
New submission from STINNER Victor : floattime() raises an OSError if _PyTime_gettimeofday() returns secs=0 and usec=0. This is wrong because _PyTime_gettimeofday() cannot fail and secs=0 is valid if the current time is 0 (1970.1.1 at 12:00 UTC). Extract of _PyTime_gettimeofday() "doc": /* Si

[issue14318] clarify "may not" in time.steady docs

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > Does "may not" mean that the user isn't allowed to adjust it, > or that they system won't always have adjusted it? It depends on which clock is used. - clock_gettime(CLOCK_MONOTONIC_RAW) cannot be adjusted - clock_gettime(CLOCK_MONOTONIC) can be adjusted b

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : Removed file: http://bugs.python.org/file24937/argparse_howto2.patch ___ Python tracker ___ ___ Python-bugs-

[issue14277] time.monotonic docstring does not mention the time unit returned

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > The unit (seconds) is not mentioned in the doc The unit (seconds) is *now* mentioned in the doc -- ___ Python tracker ___ __

[issue14277] time.monotonic docstring does not mention the time unit returned

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: The unit (seconds) is not mentioned in the doc. Related changesets: 27441e0d6a75 and c11946846474. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue14222] Using time.time() in Queue.get breaks when system time is changed

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: > Yo, I had marked this as something I was going to review once > the python-dev discussion to complete. FWIW, I'm the maintainer > of the Queue module. And so, do you agree with the change? -- ___ Python tracker

[issue13370] test_ctypes fails when building python with clang

2012-03-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue14350] Strange Exception from copying an iterable

2012-03-19 Thread Ramchandra Apte
Ramchandra Apte added the comment: BTW, can we add support for copying iterators by using itertools.tee -- ___ Python tracker ___ ___

Re: [issue13926] pydoc - stall when requesting a list of available modules in the online help utility

2012-03-19 Thread Martin Gradwell
I'm having the same problem. The problem seems to be that help("modules") iterates through all the modules, loading each one in turn, and if any one of them is broken then the iteration will fail, without a sensible indication of where the failure occurred. As an alternative method of listing all t

[issue14361] No link to issue tracker on Python home page

2012-03-19 Thread Ezio Melotti
Ezio Melotti added the comment: > Starting from the Python web site, it is not obvious how to find the issue > tracker to report a bug. (I had to resort to) For this very reason, what I always do is > googling for "Python bug tracker" to find it. Which doesn't mean that I agree that a link

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: Okay, there was some bad markup on my version 2. Lemme fix. -- Added file: http://bugs.python.org/file24938/argparse_howto2.patch ___ Python tracker

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Find attached. Note that I kept some of those anti-pattern examples > you mentioned, and then later on introduced your preferred way of > doing things (using action="count" and ">=" checks instead of "==" > ones). Reason I kept those is to easily lead t

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > After playing a bit more with this and thinking about it a bit, I do > get your point. It makes a lot of sense. I will attach a patch soon, > which will also include the count keyword. Thanks for the review. Find attached. Note that I kept some of those

[issue11686] Update of some email/ __all__ lists

2012-03-19 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: R. David Murray wrote [2012-03-17 03:51+0100]: > Thanks for the patch, Steffen. Warm to the cleanroom-squatters! (I count this as the promised petit glass of red wine.) --steffen Forza Figa! -- ___ Python

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: On Mon, Mar 19, 2012 at 10:34, Tshepang Lekhonkhobe wrote: >> Nick Coghlan added the comment: >> >> A couple of thoughts on the draft HOWTO: >> >> I like the "verbosity" example, but I'd also like to see it continue on into >> introducing the "action='c

[issue13210] Support Visual Studio 2010

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Super Brian, let me know if I can help. I already did the necessary changes locally. Martin, what I mean by "forward compatibility" is simply that the source code compiles and works with more recent versions of the compiler. The assumption in "errnom

[issue14034] Add argparse howto

2012-03-19 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Nick Coghlan added the comment: > > A couple of thoughts on the draft HOWTO: > > I like the "verbosity" example, but I'd also like to see it continue on into > introducing the "action='count'" alternative that allows "-vv" to set the > verbosity level

[issue14362] No mention of collections.ChainMap in What's New for 3.3

2012-03-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Éric, please go ahead and add a stub entry or a draft entry. I haven't had a chance to start my whatsnew edits yet. -- ___ Python tracker