Re: splitting a large dictionary into smaller ones

2009-03-22 Thread Terry Reedy
per wrote: hi all, i have a very large dictionary object that is built from a text file that is about 800 MB -- it contains several million keys. ideally i would like to pickle this object so that i wouldnt have to parse this large file to compute the dictionary every time i run my program.

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-22 Thread venutaurus...@gmail.com
On Mar 21, 3:05 pm, Tim Golden m...@timgolden.me.uk wrote: venutaurus...@gmail.com wrote: Thank you Sir for your reply. It is working for me. But is failing if I have Unicode characters in my path. I tried giving a 'u' in front of the path but still it fails at f.createdat. Does it support

Re: safely rename a method with a decorator

2009-03-22 Thread Daniel Fetchinson
there was discussion related to this same problem earlier in the week. http://groups.google.com/group/comp.lang.python/browse_thread/thread/ad08eb9eb83a4e61/d1906cbc26e16d15?q=Mangle+function+name+with+decorator%3F Thanks this was very helpful! I'd like to implement a decorator that would

Re: what features would you like to see in 2to3?

2009-03-22 Thread Kay Schluehr
On 22 Mrz., 20:39, Benjamin Peterson benja...@python.org wrote: It's GSoC time again, and I've had lots of interested students asking about doing on project on improving 2to3. What kinds of improvements and features would you like to see in it which student programmers could accomplish? It

Re: Using python 3 for scripting?

2009-03-22 Thread afriere
On Mar 23, 5:59 am, timo.my...@gmail.com (Timo Myyrä) wrote: I might get summer job in doing some 2nd tier support and doing some scripting besides that in Solaris environment. I gotta see what kind of scripts are needed but I'd guess the 2.6 would be the safest option. Timo Solaris? In

Re: 3.0 - bsddb removed

2009-03-22 Thread alex23
On Mar 23, 3:30 am, Nick Craig-Wood n...@craig-wood.com wrote: You would need to make a dictionary interface to sqlite, eg  http://code.activestate.com/recipes/576638/ Or do something a bit simpler yourself. Another option is to use the 'shove' module: http://pypi.python.org/pypi/shove

[issue5534] Decimal __format__ reverses meaning of '' and '' alignment specs

2009-03-22 Thread Donald O'Donnell
New submission from Donald O'Donnell upwest...@gmail.com: decimal.py ver 2.6: line 5474 is if align == '': s/b if align == '': line 5476 is if align == '': s/b if align == '': decimal.py ver 3.01: line 5578 is if align == '': s/b if align == '': line 5580 is if align ==

[issue5534] Decimal __format__ reverses meaning of '' and '' alignment specs

2009-03-22 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - marketdickinson nosy: +marketdickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5534 ___

[issue4753] Faster opcode dispatch on gcc

2009-03-22 Thread Andrew I MacIntyre
Andrew I MacIntyre aimacint...@users.sourceforge.net added the comment: Out of interest, the attached patch against the py3k branch at r70516 cleans up the threaded code changes a little: - gets rid of TARGET_WITH_IMPL macro; - TARGET(op) is followed by a colon, so that it looks like a label

[issue5534] Decimal __format__ reverses meaning of '' and '' alignment specs

2009-03-22 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Mark, can you confirm that this is out of date? -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5534

[issue1497532] C API to retain GIL during Python Callback

2009-03-22 Thread Lukas Lueg
Lukas Lueg knabberknusperh...@yahoo.de added the comment: I'm not sure if such a API is feasible. The very nature of Python makes it impossible to tell in advance what the interpreter will do when getting called. This is even true for simple functions - think of your function getting

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Pierre Hanser
New submission from Pierre Hanser han...@club-internet.fr: The json module provides an encoder python - json. The encoding may be specialized by the user, using the cls parameter of the dumps function. But all simple types are always handled by the library encoder, the user encoder is only used

[issue5534] Decimal __format__ reverses meaning of '' and '' alignment specs

2009-03-22 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Yes, it should be fixed already in the release maintenance branches. See r70430 through r70433. -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Agreed with Brett and Raymond. Besides, I'm not sure how getting a failure rather an error changes anything in the big picture (for my non native English-speaking brain, it certainly doesn't make a difference :-)). -- nosy: +pitrou

[issue4294] Macros for PyLong: sign, number of digits, fits in an int

2009-03-22 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: A few comments: I think PyLong_SIGN and PyLong_EQUALS_ZERO should go in Include/longobject.h, not Include/longintrepr.h: these 2 macros have an unambiguous meaning for *any* representation of integers. And longintrepr.h is really

[issue4294] Macros for PyLong: sign, number of digits, fits in an int

2009-03-22 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - marketdickinson components: +Interpreter Core priority: - normal type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4294

[issue1501108] Add write buffering to gzip

2009-03-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Although the script does not work as-is (missing import of string, typo between frags and wfrags), I can conform the 3x ratio. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Tim Cuthbertson
Tim Cuthbertson tim3d.j...@gmail.com added the comment: In my mind, an error means something is wrong. A failure just means a test case hasn't been implemented yet, or has regressed. For me it's misleading to have an AssertionError reported as a failure. It's not as if changing the reporting in

[issue5536] urllib: urlretrieve() does not close file objects on failure

2009-03-22 Thread Petr Dolezal
New submission from Petr Dolezal petr.dole...@matfyz.cz: urllib.request.urlretrieve() does not close the file object created for the retrieval when it fails during processing of the incoming data and raises an exception (e.g. on HTTP 404 response). Therefore the file remains opened until the

[issue5529] Backport sys module docs involving import to 2.7

2009-03-22 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Oh, it's nice to have something to do at PyCon. :) -- assignee: - georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5529 ___

[issue5502] io-c: TextIOWrapper is faster than BufferedReader but not protected by a lock

2009-03-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - pitrou priority: - normal stage: - needs patch type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5502 ___

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: - bob.ippolito nosy: +bob.ippolito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5535 ___

[issue4688] GC optimization: don't track simple tuples and dicts

2009-03-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - pitrou resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4688 ___

[issue1974] email.MIMEText.MIMEText.as_string incorrectly folding long subject header

2009-03-22 Thread Martin von Gagern
Changes by Martin von Gagern martin.vgag...@gmx.net: -- nosy: +gagern ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1974 ___ ___ Python-bugs-list

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Bob Ippolito
Bob Ippolito b...@redivi.com added the comment: It is common to specify a default function but it would be terrible for performance if this function was called for every single object passed through to the decoder. If you want a serialization different from a primitive type you'll have to

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5535 ___ ___

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I concur with other developers. In strict unittesting, assertions of correct behavior should only ever happen in the test not during set up or tear down. -- nosy: +benjamin.peterson resolution: - rejected status: open - closed

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Thanks for the patch and the attempt, Tim! -- Added file: http://bugs.python.org/file13395/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5531

[issue1034053] unittest.py patch: add skipped test functionality

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Ok, here's my unittest skipping patch. It supports skipping classes and expected failures and includes skipping decorators. I had to employ a little evil to make test skipping work for classes. The made a new TestSuite class called

[issue5532] imap usage in itertools unique_justseen recipe

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Done in r70520. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5532 ___

[issue1034053] unittest.py patch: add skipped test functionality

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Here's the patch on Rietveld: http://codereview.appspot.com/27095 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1034053 ___

[issue5536] urllib: urlretrieve() does not close file objects on failure

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r70521. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5536

[issue5537] LWPCookieJar cannot handle cookies with expirations of 2038 or greater on 32-bit platforms

2009-03-22 Thread Chris Hollenbeck
New submission from Chris Hollenbeck chris.hollenb...@gmail.com: The LWPCookieJar can be saved on 64-bit Ubuntu, but not on 32-bit Ubuntu when the expiration year is greater than 2038. This has not been tested on any other Intel-compatible Linux platform, though it appears related to the Year

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Pierre Hanser
Pierre Hanser han...@club-internet.fr added the comment: you realize that the current handling is incorrect and also not documented? and that the described case is from the real world: it prevents using pydbus and dbus.Boolean type to send a json boolean I don't take your argument about

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Bob Ippolito
Bob Ippolito b...@redivi.com added the comment: The documentation says If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError. *can't otherwise be serialized* means that

[issue5068] tarfile loops forever on broken input

2009-03-22 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: I just checked in a fix for the problem, r70523-70527. Thank you very much for your report. -- resolution: - fixed status: open - closed versions: +Python 2.5 ___ Python tracker

[issue5538] tearDown in unittest should be executed regardless of result in setUp

2009-03-22 Thread Garrett Cooper
New submission from Garrett Cooper yaneg...@gmail.com: While trying to deal with some annoying issues with setting up and tearing down consoles via pexpect, I noticed that the teardown functions / methods weren't being executed via nose. After applying this change to 2.4.5 and 2.6.1, things

[issue5538] tearDown in unittest should be executed regardless of result in setUp

2009-03-22 Thread Garrett Cooper
Changes by Garrett Cooper yaneg...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5538 ___ ___ Python-bugs-list

[issue1501108] Add write buffering to gzip

2009-03-22 Thread Lukas Lueg
Lukas Lueg knabberknusperh...@yahoo.de added the comment: This is true for all objects whose input could be concatenated. For example with hashlib: data = ['foobar']*10 mdX = hashlib.sha1() for d in data: mdX.update(d) mdY = hashlib.sha1() mdY.update(.join(data)) mdX.digest() ==

[issue5538] tearDown in unittest should be executed regardless of result in setUp

2009-03-22 Thread Garrett Cooper
Garrett Cooper yaneg...@gmail.com added the comment: That patch wasn't complete -_-... here's a more complete 2.4.x patch. -- Added file: http://bugs.python.org/file13398/issue-5538-2.4.5.diff ___ Python tracker rep...@bugs.python.org

[issue5538] tearDown in unittest should be executed regardless of result in setUp

2009-03-22 Thread Garrett Cooper
Changes by Garrett Cooper yaneg...@gmail.com: Removed file: http://bugs.python.org/file13397/issue-blah-2.4.5.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5538 ___

[issue5538] tearDown in unittest should be executed regardless of result in setUp

2009-03-22 Thread Garrett Cooper
Garrett Cooper yaneg...@gmail.com added the comment: If someone will provide a link to a page with instructions on how to checkout python from cvs / svn / etc I'll gladly apply a patch to the sources on 2.x and 3.x HEAD. Thanks, -Garrett -- ___

[issue5538] tearDown in unittest should be executed regardless of result in setUp

2009-03-22 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: It's up to Steve to decide wheter to commit. I presume that he will want to stay true to JUnit and to avoid risk of breaking existing test suites. -- assignee: - purcell keywords: +needs review -patch nosy:

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-03-22 Thread Matthew Barnett
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: An additional feature that could be borrowed, though in slightly modified form, from Perl is case-changing controls in replacement strings. Roughly the idea is to add these forms to the replacement string: \g1 provides capture

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-03-22 Thread Robert Xiao
Robert Xiao nneon...@gmail.com added the comment: Frankly, I don't really like that idea; I think it muddles up the RE syntax to have such a group-modifying operator, and seems rather unpythonic: the existing way to do this -- use .upper(), .lower() or .title() to format the groups in a match

[issue5539] open documentation unclear

2009-03-22 Thread David W. Lambert
New submission from David W. Lambert lamber...@corning.com: See thread http://groups.google.com/group/comp.lang.python/browse_thread/thread/85e c714aa6898d84# En Sun, 22 Mar 2009 19:12:13 -0300, Benjamin Peterson benja...@python.org escribió: Gabriel Genellina gagsl-py2 at yahoo.com.ar

[issue5540] file objects in python 3 tutorial

2009-03-22 Thread David W. Lambert
New submission from David W. Lambert lamber...@corning.com: http://docs.python.org/dev/py3k/tutorial/inputoutput.html#methods-of- file-objects Is it proper to discuss file objects in py3K? -- assignee: georg.brandl components: Documentation messages: 83991 nosy: LambertDW, georg.brandl

[issue5539] open documentation unclear

2009-03-22 Thread David W. Lambert
Changes by David W. Lambert lamber...@corning.com: -- assignee: - georg.brandl components: +Documentation nosy: +georg.brandl versions: +Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5539

[issue1034053] unittest.py patch: add skipped test functionality

2009-03-22 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: Removed file: http://bugs.python.org/file13396/unittest_galore.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1034053 ___

[issue1034053] unittest.py patch: add skipped test functionality

2009-03-22 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: Added file: http://bugs.python.org/file13399/unittest_galore.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1034053 ___

[issue1034053] unittest.py patch: add skipped test functionality

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I've attached a new patch which takes into account Antoine's review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1034053 ___

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-03-22 Thread Matthew Barnett
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: Ah, too Perlish! :-) Another feature request that I've decided not to consider any further is recursive regular expressions. There are other tools available for that kind of thing, and I don't want the re module to go the way of Perl

[issue2170] rewrite of minidom.Node.normalize

2009-03-22 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2170 ___ ___ Python-bugs-list

[issue5540] file objects in python 3 tutorial

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Why shouldn't it be? One of the goals of 3.x io is to present a more pythonic interface while preserving a similar interface to 2.x. Users can learn about the complete io stack later. -- nosy: +benjamin.peterson

[issue5539] open documentation unclear

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r70534. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5539

[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r70536. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5513 ___

<    1   2