Re: Ideas for a module to process command line arguments

2011-01-13 Thread Michele Simionato
On Jan 12, 6:09 pm, Alice Bevan–McGregor al...@gothcandy.com wrote: entirely sure what you mean by 'smart' options.  If your'e referring to using a single hyphen and a list of characters to represent a long option (which, to the rest of the world, use two leading hyphens) then that's pretty

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread DevPlayer
lst = [1, 2, 3, 4, 5] def maketup(lst): cur_item = lst[-1] lst = lst[:-1] if len(lst): return maketup(lst), cur_item else: return cur_item print maketup(lst) 1, 2), 3), 4), 5) But I'm confused as to what you mean by : Among them, I want to pair up terminals

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread DevPlayer
def maketup(lst): if len(lst) == 1: return lst[0] elif len(lst) == 2: return (lst[0],lst[1]) elif len(lst) 2: return ( (maketup(lst[:-2]), lst[-2]), lst[-1]) maketup(lst) 1, 2), 3), 4), 5) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Alain Ketterlin
justin justpar...@gmail.com writes: Suppose I have [1,2,3,4,5], then there are many ways of making clustering. Among them, I want to pair up terminals until there is only one left at the end. Are you trying ascending hierarchical clustering by any chance? In that case you're supposed to use

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Alain Ketterlin
DevPlayer devpla...@gmail.com writes: def maketup(lst): if len(lst) == 1: return lst[0] elif len(lst) == 2: return (lst[0],lst[1]) elif len(lst) 2: return ( (maketup(lst[:-2]), lst[-2]), lst[-1]) The OP wants all binary trees over the elements, not

File /usr/lib/python2.6/atexit.py, line 24, in _run_exitfuncs

2011-01-13 Thread dzizes451
Hello! I wrote a python (2.6) deamon running on linux. Program (deamon, manager) collects lets say work-orders from db and creates sub- processes for each one. Sub-processes do their job with out problems, errors, exceptions. However, sometimes deamon throws: Traceback (most recent call last):

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread DevPlayer
tuple([ (tuple(lst[x-1:x+1]) if len(tuple(lst[x-1:x+1]))==2 else lst[x-1]) for x in lst[::2]]) ((1, 2), (3, 4), 5) # or x = ((tuple(lst[x-1:x+1]) if len(tuple(lst[x-1:x+1]))==2 else lst[x-1]) for x in lst[::2]) x.next() (1, 2) x.next() (3, 4) x.next() 5 --

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread DevPlayer
Ah. out of my depth. -- http://mail.python.org/mailman/listinfo/python-list

Re: cipher encoding

2011-01-13 Thread Krzysztof Bieniasz
Dear all, I hope someone out there can help me. The output string of my code is close to what i need, but i need it 1)printed on one line and 2) reversed #mycode: s= input(Enter message: ) key=1 for letter in s: num=(chr(ord(letter)+1)) print(num) #or is there a

Re: Nested structures question

2011-01-13 Thread Jean-Michel Pichavant
Physics Python wrote: Hello, I am teaching myself python using the book: Python Programming for Absolute Beginners, 2nd edition by Michael Dawson. I am using python 2.7.1. In chapter 3 we are learning to use structures (while, if, elif) to write a program that has the user guess a number

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Richard Thomas
On Jan 13, 10:02 am, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: justin justpar...@gmail.com writes: Suppose I have [1,2,3,4,5], then there are many ways of making clustering. Among them, I want to pair up terminals until there is only one left at the end. Are you trying

Re: Career path - where next?

2011-01-13 Thread Hank Fay
I would second the recommendation for Django: on LinkedIn, the python jobs postings (there is a Python group there) most often mention Django. I also would second the recommendation to participate in open source projects. I met a couple of days ago with a college sophomore who is a core

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Alain Ketterlin
Richard Thomas chards...@gmail.com writes: On Jan 13, 10:02 am, Alain Ketterlin al...@dpt-info.u-strasbg.fr def clusterings(l):     if len(l) == 1:         print repr(l)     else:         n = len(l)         for i in xrange(n):             for j in xrange(i+1,n):                

Re: File /usr/lib/python2.6/atexit.py, line 24, in _run_exitfuncs

2011-01-13 Thread Terry Reedy
On 1/13/2011 5:28 AM, dzizes451 wrote: Hello! I wrote a python (2.6) deamon running on linux. Program (deamon, manager) collects lets say work-orders from db and creates sub- processes for each one. Sub-processes do their job with out problems, errors, exceptions. However, sometimes deamon

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Richard Thomas
On Jan 13, 3:59 pm, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Richard Thomas chards...@gmail.com writes: On Jan 13, 10:02 am, Alain Ketterlin al...@dpt-info.u-strasbg.fr def clusterings(l):     if len(l) == 1:         print repr(l)     else:         n = len(l)         for i

Re: Career path - where next?

2011-01-13 Thread Ethan Furman
Hank Fay wrote: ... From a selfish (to you and to me s) perspective, may I suggest the pyjamas (pyjs.org) project and accompanying visual designer (http://pyjsglade.sourceforge.net), which brings the GWT widgets to Python, for desktop and web apps. Selfish to me because I'm porting our

troubles compiling pythonwebkit

2011-01-13 Thread Dave
Hello Python enthusiasts, I'm trying to install the Python Webkit DOM Bindings (http://www.gnu.org/software/pythonwebkit/) but am not successful. The trouble starts when trying to 'make' pywebkitgtk. I've tried the prepatched version and downloading and patching myself. In both case the

how to use priority queue with multiprocessing

2011-01-13 Thread Marco Hornung
Hey, -- question -- How can I use a priority queue to schedule jobs within the multiprocessing pool module?

Re: apscheduler error

2011-01-13 Thread Hesham
In cases like that instead of sleep() can use pause(). E.g., from apscheduler.scheduler import Scheduler import signal sched = Scheduler() sched.start() def some_job(): print Decorated job sched.add_interval_job(some_job,minutes=1) signal.pause() Mosalam --

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Arnaud Delobelle
Peter Otten __pete...@web.de writes: justin wrote: The title sounds too complex, but my question is actually simple. Suppose I have [1,2,3,4,5], then there are many ways of making clustering. Among them, I want to pair up terminals until there is only one left at the end. For example,

python 3 and Unicode line breaking

2011-01-13 Thread leoboiko
Hi, Is there an equivalent to the textwrap module that knows about the Unicode line breaking algorithm (UAX #14, http://unicode.org/reports/tr14/ )? -- http://mail.python.org/mailman/listinfo/python-list

GURU NEEDED : break a command into several lines and comment each line

2011-01-13 Thread bolega
Basically, I have spent a few hours experimenting and searching on the comp.unix.shell how to break a command with several switches into more than one line AND to be able to put some comment on each line. #!/bin/bash -xv command \ # comment1 -sw1 \ # comment2 -sw2 \ #

Re: GURU NEEDED : break a command into several lines and comment each line

2011-01-13 Thread Chris Rebert
On Thu, Jan 13, 2011 at 1:18 PM, bolega gnuist...@gmail.com wrote: Basically, I have spent a few hours experimenting and searching on the comp.unix.shell how to break a command with several switches into more than one line AND to be able to put some comment on each line. #!/bin/bash -xv

Re: GURU NEEDED : break a command into several lines and comment each line

2011-01-13 Thread Berthold Höllmann
bolega gnuist...@gmail.com writes: Basically, I have spent a few hours experimenting and searching on the comp.unix.shell how to break a command with several switches into more than one line AND to be able to put some comment on each line. #!/bin/bash -xv command \ # comment1

Re: GURU NEEDED : break a command into several lines and comment each line

2011-01-13 Thread David W. Hodgins
On Thu, 13 Jan 2011 16:18:31 -0500, bolega gnuist...@gmail.com wrote: how to break a command with several switches into more than one line AND to be able to put some comment on each line. command \ # comment1 -sw1 \ # comment2 Not what you want to hear, but that will not work.

Re: python 3 and Unicode line breaking

2011-01-13 Thread Steven D'Aprano
On Thu, 13 Jan 2011 12:45:31 -0800, leoboiko wrote: Hi, Is there an equivalent to the textwrap module that knows about the Unicode line breaking algorithm (UAX #14, http://unicode.org/reports/tr14/ )? Is access to Google blocked where you are, or would you just like us to do your

Multiple independently started python processes and sharing of a module

2011-01-13 Thread Martin P. Hellwig
Hi all, I have the following problem (which I already have a hacked around solution that works but I'd would like some more input on it): I have a situation where multiple python processes are started independently from each other but by the same user with the same environment (as happens

Re: GURU NEEDED : break a command into several lines and comment each line

2011-01-13 Thread Steven D'Aprano
On Thu, 13 Jan 2011 13:49:06 -0800, Chris Rebert wrote: On Thu, Jan 13, 2011 at 1:18 PM, bolega gnuist...@gmail.com wrote: Basically, I have spent a few hours experimenting and searching on the comp.unix.shell [...] This doesn't seem to have anything whatsoever to do with Python... Well, I

Re: Trying to parse a HUGE(1gb) xml file

2011-01-13 Thread Aahz
In article mailman.176.1292919399.6505.python-l...@python.org, Stefan Behnel stefan...@behnel.de wrote: Try import xml.etree.cElementTree as etree instead. Note the leading c, which hints at the C implementations of ElementTree. It's much faster and much more memory friendly than the

Re: Resolve circular reference

2011-01-13 Thread Magnus Lyckå
On 2011-01-07 03:24, moerchendiser2k3 wrote: Everything works fine, the problem starts when I start to make a circular reference in Python. I didn't quite grok your example, but concerning CPython GC circular references... import gc class X: ... def __del__(self): ...

Re: How to read ansic file into a pre-defined class?

2011-01-13 Thread Magnus Lyckå
On 2011-01-08 04:24, Ying Zu wrote: How to read ansic file into a pre-defined class? I have a series of files written in the following format, ... You might like to take a look at the json module if you aren't locked to the exact format you suggested. http://json.org/

Re: Multiple independently started python processes and sharing of a module

2011-01-13 Thread Kushal Kumaran
- Original message - Hi all, I have the following problem (which I already have a hacked around solution that works but I'd would like some more input on it): I have a situation where multiple python processes are started independently from each other but by the same user with

Re: GURU NEEDED : break a command into several lines and comment each line

2011-01-13 Thread Stefan Monnier
#!/bin/bash -xv command \ # comment1 -sw1 \ # comment2 -sw2 \ # comment3 arguments One ought to be able to comment every single switch if desired for whatever reason. Thanks for the riddle. Here's a solution: command$(: # comment1 )

overplot while keeping the axes fixed

2011-01-13 Thread ZuYing
Hi folks, I was trying to split the frame into 2 panels using subplot, fig = matplotlib.pyplot.figure() plt1 = fig.add_subplot(2,1,1 ) plt2 = fig.add_subplot(2,1,2 ) plt1.plot(x1, y1, 'g-') plt2.plot(x2, y2, 'g-') then I need to overplot other curves on each subplot panel using the same

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Peter Otten
Arnaud Delobelle wrote: more simply: def clusters(l): if len(l) == 1: yield l[0] return for i in range(1, len(l)): for left in clusters(l[:i]): for right in clusters(l[i:]): yield (left, right) That would give all solutions

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: I knew the builtins hack was terrible, thanks for the replies... I changed cgi.py with Glenn's IOMix class, and included the changes in make_file(). The patch is attached to this message Is it really too late to include it in 3.2 ?

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: diff for the updated version of test_cgi.py, compatible with cgi.py -- Added file: http://bugs.python.org/file20384/test_cgi_20111013.diff ___ Python tracker rep...@bugs.python.org

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: zip file with the updated cgi_test.py and associated files -- Added file: http://bugs.python.org/file20385/cgi_tests.zip ___ Python tracker rep...@bugs.python.org

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Ross Lagerwall
Ross Lagerwall rosslagerw...@gmail.com added the comment: How about this? Instead of just losing the data that's been read so far in readline(), this patch adds the data as a new field to the exception that is thrown - this way the semantics remain exactly the same but the data is not

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-13 Thread Glenn Linderman
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Pierre, Looking better. I see you've retained the charset parameter, but do not pass it through to nested calls of FieldStorage. This is good, because it wouldn't work if you did. However, purists might still complain that FieldStorage

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Small tip: To ease review, I recommend you work from a checkout of the Subversion py3k branch, using svn add if you have new files and then producing one svn diff of the whole checkout. It’s easier than looking at multiple files, even more so if

[issue10577] (Fancy) URL opener stuck when trying to open redirected url

2011-01-13 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: It's a dupe of http://bugs.python.org/issue8035. By the way, it works with 2.7 because urllib used HTTP 1.0 by default, and in py3k it now uses HTTP 1.1. And from what I understood (by I'm by no means an http expert), in http 1.0 the

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20229/cgi_diff.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20235/cgi_diff.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20322/cgi_diff_20110109.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20323/cgi_tests.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20356/cgi_diff_20110111.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20382/cgi_diff_20110112.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20383/cgi_20110113.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20384/test_cgi_20111013.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Changes by Pierre Quentel pierre.quen...@gmail.com: Removed file: http://bugs.python.org/file20244/cgi_diff.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Ok Eric, thanks for the tips I attach the diff for the 2 modified modules (cgi.py and test_cgi.py). For the other tests, they are not in the branch and there are many test files so I leave the zip file I removed outdated diffs

[issue2650] re.escape should not escape underscore

2011-01-13 Thread SilentGhost
SilentGhost ghost@gmail.com added the comment: Here is the patch, including adjustment to the test. -- Added file: http://bugs.python.org/file20388/issue2650.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2650

[issue10899] No function type annotations in the standard library

2011-01-13 Thread Scott Dial
Scott Dial sc...@scottdial.com added the comment: Raymond Hettinger wrote: I think those annotations should be replaced with comments. In your revisions, you didn't do anything but blow away the annotations despite what you said here, which is an unfortunate loss of information for

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread David Beazley
David Beazley d...@dabeaz.com added the comment: Have any other programming environments ever had a feature where a socket timeout returns an exception containing partial data?I'm not aware of one offhand and speaking as a systems programmer, something like this might be somewhat

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This is an interesting approach. The problem is that AFAICT the issue is not limited to readline. If you call e.g. read(1) and the socket times out after having returned the first 5000 bytes, then those 5000 bytes might get lost as well

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: By the way, I recently fixed the makefile() documentation: “The socket must be in blocking mode; it can have a timeout, but the file object’s internal buffer may end up in a inconsistent state if a timeout occurs.” (in

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It getting in to 3.2 would be a release manager call, so I've set it to release blocker so Georg can make the call. My opinion is that while I would *really* like to see this fixed in 3.2, the changes really should have a thorough

[issue10897] UNIX mmap unnecessarily dup() file descriptor

2011-01-13 Thread Ralf Schmitt
Changes by Ralf Schmitt sch...@gmail.com: -- nosy: +schmir ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10897 ___ ___ Python-bugs-list mailing

[issue10013] fix `./libpython2.6.so: undefined reference to `_PyParser_Grammar´` in parallel builds

2011-01-13 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: This change was backported to 2.7 (r87701) and 3.1 (r87702). -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10013

[issue10013] fix `./libpython2.6.so: undefined reference to `_PyParser_Grammar´` in parallel builds

2011-01-13 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: -- resolution: - accepted status: open - closed versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10013 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Pierre Quentel
Pierre Quentel pierre.quen...@gmail.com added the comment: Ok, thanks. Here is a summary of the API changes : - the argument fp passed to FieldStorage is either an instance of (a subclass of) io.TextIOBase with a buffer attribute for the underlying binary layer (thus, it can't be a StringIO

[issue2650] re.escape should not escape underscore

2011-01-13 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: Removed file: http://bugs.python.org/file20388/issue2650.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2650 ___

[issue2650] re.escape should not escape underscore

2011-01-13 Thread SilentGhost
SilentGhost ghost@gmail.com added the comment: The naïve version of the code proposed was about 3 times slower than existing version. However, the test, I think, is valuable enough. So, I'm reinstating it. -- Added file: http://bugs.python.org/file20389/test_re.diff

[issue10013] fix `./libpython2.6.so: undefined reference to `_PyParser_Grammar´` in parallel builds

2011-01-13 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: -- resolution: accepted - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10013 ___ ___

[issue2650] re.escape should not escape underscore

2011-01-13 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Show your speed test? Looks 2.5x faster to me. But I'm running this on python 2.6, so I guess it's possible that the re module's speed was decimated in Py3k. python -m timeit -s $(printf import re\ndef escape(s):\n return

[issue10899] No function type annotations in the standard library

2011-01-13 Thread Guido van Rossum
Guido van Rossum gu...@python.org added the comment: Yes, please add the lost info back to docstrings. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10899 ___

[issue10577] (Fancy) URL opener stuck when trying to open redirected url

2011-01-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ok, closing as duplicate. -- resolution: - duplicate status: open - closed superseder: - urllib.request.urlretrieve hangs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10577

[issue8035] urllib.request.urlretrieve hangs waiting for connection close after a redirect

2011-01-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: issue10577 is a duplicate. See an URL allowing reproducing in msg122831. -- nosy: +pitrou priority: high - normal stage: unit test needed - needs patch title: urllib.request.urlretrieve hangs - urllib.request.urlretrieve hangs waiting

[issue2650] re.escape should not escape underscore

2011-01-13 Thread SilentGhost
SilentGhost ghost@gmail.com added the comment: James, I think the setup statement should have been: import re\ndef escape(s):\n return re.sub(r'([][.^$*+?{}\\|()])', r'\\\1', s)) note the raw string literals. The timings that I got after applying file20388

[issue2710] error: (10035, 'The socket operation could not complete without blocking')

2011-01-13 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: This can be reopened if the problem ever appears in a current issue. -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2710

[issue10899] No function type annotations in the standard library

2011-01-13 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Will do :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10899 ___ ___

[issue2650] re.escape should not escape underscore

2011-01-13 Thread James Y Knight
James Y Knight f...@users.sourceforge.net added the comment: Right you are, it seems that python's regexp implementation is terribly slow when doing replacements with a substitution in them. (fixing the broken test, as you pointed out changed the timing to 97.6 usec vs the in-error-reported

[issue2650] re.escape should not escape underscore

2011-01-13 Thread yeswanth
yeswanth swamiyeswa...@yahoo.com added the comment: @James test results for py3k python -m timeit -s $(printf import re\ndef escape(s):\n return re.sub('([][.^$*+?{}\\|()])', '\\\1', s)) 'escape(!@#$%^*()!@#$%^*()!@#$%^*()!@#$%^*()!@#$%^*()!@#$%^*()!@#$%^*()!@#$%^*())' 10 loops, best

[issue10900] bz2 module fails to uncompress large files

2011-01-13 Thread wrobell
New submission from wrobell wrob...@pld-linux.org: There is problem to uncompress large files with bz2 module. For example, please download 13GB OpenStreetMap file using following torrent http://osm-torrent.torres.voyager.hr/files/planet-latest.osm.bz2.torrent Try to count lines in the

[issue10901] Python 3 MIME generator dies if not given boundary

2011-01-13 Thread Brandon Craig Rhodes
New submission from Brandon Craig Rhodes bran...@rhodesmill.org: If you try doing msg.as_string() to a MIMEMultipart message that has not been given a boundary, then it dies with this exception: Traceback (most recent call last): File mime_gen_alt.py, line 40, in module

[issue10901] Python 3 MIME generator dies if not given boundary

2011-01-13 Thread Brandon Craig Rhodes
Brandon Craig Rhodes bran...@rhodesmill.org added the comment: Here is a patch that fixes the problem. The problem probably only occurs if the MIMEMultipart is actually given several MIME parts to use in its interior. -- keywords: +patch Added file:

[issue2650] re.escape should not escape underscore

2011-01-13 Thread A.M. Kuchling
Changes by A.M. Kuchling li...@amk.ca: -- nosy: -akuchling ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2650 ___ ___ Python-bugs-list mailing

[issue10900] bz2 module fails to uncompress large files

2011-01-13 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: -- nosy: +gustavo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10900 ___ ___ Python-bugs-list mailing

[issue10900] bz2 module fails to uncompress large files

2011-01-13 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: -- nosy: +niemeyer -gustavo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10900 ___ ___

[issue10901] Python 3 MIME generator dies if not given boundary

2011-01-13 Thread SilentGhost
SilentGhost ghost@gmail.com added the comment: It is a duplicate of #1243654. Closing. -- nosy: +SilentGhost resolution: - duplicate status: open - closed superseder: - Faster output if message already has a boundary ___ Python tracker

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: Generally there is no guarantee that a buffered object works properly when the raw IO object raises some exception intermittently I disagree. EINTR is a classic case of this and is something that buffering IO layers deal with all the time.

[issue1243654] Faster output if message already has a boundary

2011-01-13 Thread SilentGhost
SilentGhost ghost@gmail.com added the comment: Issue #10901 was closed as a duplicate of this issue. -- nosy: +SilentGhost versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1243654

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Generally there is no guarantee that a buffered object works properly when the raw IO object raises some exception intermittently I disagree. EINTR is a classic case of this and is something that buffering IO layers deal with all the time.

[issue10900] bz2 module fails to uncompress large files

2011-01-13 Thread wrobell
wrobell wrob...@pld-linux.org added the comment: Forgot the mention the real amount of lines! bzip2 -dc planet-110105.osm.bz2 | wc -l 2783595867 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10900

[issue5863] bz2.BZ2File should accept other file-like objects.

2011-01-13 Thread wrobell
wrobell wrob...@pld-linux.org added the comment: A use case wget -O http://planet.openstreetmap.org/planet-110112.osm.bz2 | tee planet.bz2 | osm2sql | psql osm planet-*osm.bz2 files are 14GB at the moment. it would be great to read them from stdin while downloading from a server and

[issue5863] bz2.BZ2File should accept other file-like objects.

2011-01-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: We’ve already agreed the feature is desirable; what’s missing is a patch, not user stories :) -- nosy: +niemeyer versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue5863] bz2.BZ2File should accept other file-like objects.

2011-01-13 Thread wrobell
wrobell wrob...@pld-linux.org added the comment: OK! :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5863 ___ ___ Python-bugs-list mailing

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Ross Lagerwall
Ross Lagerwall rosslagerw...@gmail.com added the comment: That complicates things quite a bit, especially given that it has to be grafted on at least two layers of the IO stack (the raw IO layer, and the buffered IO layer). Also the TextIO layer I think. That's my opinion too. So, instead,

[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: That's my opinion too. So, instead, of doing the above surgery inside the IO stack, the SocketIO layer could detect the timeout and disallow further access. What do you think? So after a timeout occurs the file-object basically becomes

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Andy Harrington ahar...@luc.edu added the comment: I found a similar issue. If you want more simple files demonstrating the issue, I have attached some. If I start my localCGIServer.py, then I can use adder.html fine (uses get), but with adderpost.html (uses post) the cgi action file,

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington ahar...@luc.edu: Removed file: http://bugs.python.org/file20392/localCGIServer.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington ahar...@luc.edu: Added file: http://bugs.python.org/file20393/adder.html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington ahar...@luc.edu: Added file: http://bugs.python.org/file20394/adderpost.html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: -pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington ahar...@luc.edu: Added file: http://bugs.python.org/file20395/localCGIServer.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington ahar...@luc.edu: Added file: http://bugs.python.org/file20396/adder.cgi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___

[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Ram Rachum
Ram Rachum cool...@cool-rr.com added the comment: But why? What's the reason for that? Why mislabel a type as a function? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10893 ___

[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: staticmethod being a type or int being a function is really a CPython implementation detail. If the docs say something is a class, it behaves as a class, you can subclass it and everything, and the other VMs implement it as a class, why would

[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Ram Rachum
Ram Rachum cool...@cool-rr.com added the comment: I'm really confused by your comment. int being a function is really a CPython implementation detail I don't understand this. I should be able to do isinstance(x, int) in all implementations of Python, no? So `int` must be a class across all

  1   2   >