[issue7464] circular reference in HTTPResponse by urllib2

2009-12-10 Thread Senthil Kumaran
Senthil Kumaran added the comment: weak method idea seems interesting. I have not used it anytime yet, and in this case,it seems okay. -- nosy: +orsenthil ___ Python tracker ___

[issue7471] GZipFile.readline too slow

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > How can I put this without being an ass? Hell, I'm no good at diplomacy > - the gzip module blows chunks - if I can shell out to a standard unix > util and it uses a tiny fraction of the memory to do the same job the > module is inherently broken no matter how

[issue7449] A number tests "crash" if python is compiled --without-threads

2009-12-10 Thread Jerry Seutter
Changes by Jerry Seutter : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7449] A number tests "crash" if python is compiled --without-threads

2009-12-10 Thread Jerry Seutter
Jerry Seutter added the comment: The patch makes it so that tests that use threading skip rather than generate errors when python is compiled --without-threads. I added a skip_if_no('modulename') decorator to test_support. Let me know if this patch is too big to review and I'll break it up. I

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

2009-12-10 Thread Benjamin Peterson
Benjamin Peterson added the comment: I agree with Martin. gzip and bz2 convert bytes to bytes. Encodings deal strictly with unicode -> bytes. -- nosy: +benjamin.peterson status: open -> closed ___ Python tracker __

[issue7474] multiprocessing.managers.SyncManager managed object creation fails when started outside of invoked file

2009-12-10 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue7470] logger.StreamHandler emit encoding fallback is wrong

2009-12-10 Thread Vinay Sajip
Vinay Sajip added the comment: Sorry Christian, your patch appears just to rename 'fs' to 'ufs' so I'm not sure if your patch is exactly what you intended. -- assignee: -> vinay.sajip ___ Python tracker __

[issue7476] pipes.quote does not handle zero-length args correctly

2009-12-10 Thread Eric Smith
Eric Smith added the comment: In addition, quote is undocumented, although there is a test for it. It should also be documented and/or have a docstring. -- nosy: +eric.smith ___ Python tracker _

[issue7464] circular reference in HTTPResponse by urllib2

2009-12-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The WeakMethod idea is not new: http://code.activestate.com/recipes/81253/ http://mindtrove.info/articles/python-weak-references/#toc-extending-weak- references -- nosy: +amaury.forgeotdarc ___ Python tracker

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

2009-12-10 Thread Martin v . Löwis
Martin v. Löwis added the comment: It's not possible to add these codecs back. Bytes objects (correctly) don't have an encode method, and string objects (correctly) don't have a decode method. The codec architecture of Python 3.x just doesn't support this kind of application; the codec architect

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

2009-12-10 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reopening the ticket. -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mail

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

2009-12-10 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > These are not encodings, in that they don't convert characters to bytes. > It was a mistake that they were integrated into the codecs interfaces in > Python 2.x; this mistake is corrected i

[issue7476] pipes.quote does not handle zero-length args correctly

2009-12-10 Thread John Wiseman
New submission from John Wiseman : In python 2.5.2, I believe pipes.quote gives the wrong result for zero- length arguments. >>> from pipes import quote >>> args = ['arg1', '', 'arg3'] >>> print 'mycommand %s' % (' '.join(quote(arg) for arg in args)) mycommand arg1 arg3 I think the result shou

[issue7464] circular reference in HTTPResponse by urllib2

2009-12-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I have two solutions for this problem. The first is a mundane one, and what I employed in our production environment: class RecvAdapter(object): def __init__(self, wrapped): self.wrapped = wrapped def recv(self, amt): return sel

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

2009-12-10 Thread Martin v . Löwis
Martin v. Löwis added the comment: These are not encodings, in that they don't convert characters to bytes. It was a mistake that they were integrated into the codecs interfaces in Python 2.x; this mistake is corrected in 3.x. -- nosy: +loewis resolution: -> invalid status: open -> clo

[issue7471] GZipFile.readline too slow

2009-12-10 Thread asnakelover
asnakelover added the comment: Yes, subprocess works fine and was the quickest to implement and probably the fastest to run too. How can I put this without being an ass? Hell, I'm no good at diplomacy - the gzip module blows chunks - if I can shell out to a standard unix util and it uses a tiny

[issue7471] GZipFile.readline too slow

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The gz in question is 17mb compressed and 247mb uncompressed. Calling > zcat the python process uses between 250 and 260 mb with the whole > string in memory using zcat as a fork. Numbers for the gzip module > aren't obtainable except for readline(), which doe

[issue7471] GZipFile.readline too slow

2009-12-10 Thread asnakelover
asnakelover added the comment: The gz in question is 17mb compressed and 247mb uncompressed. Calling zcat the python process uses between 250 and 260 mb with the whole string in memory using zcat as a fork. Numbers for the gzip module aren't obtainable except for readline(), which doesn't use mu

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

2009-12-10 Thread Skip Montanaro
Changes by Skip Montanaro : -- nosy: +skip.montanaro ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue7471] GZipFile.readline too slow

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I tried the splitlines() version you suggested, it thrashed my machine > so badly I pressed alt+sysrq+f (which invokes kernel oom_kill) after > about 1 minute so I didn't lose anything important. This sounds very weird. How much memory do you have, and how la

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

2009-12-10 Thread flox
New submission from flox : AFAIK these codecs were not ported to Python 3. 1. I found no hint in documentation on this matter. 2. Is it possible to contribute some of them, or there's a good reason to look elsewhere? -- components: Library (Lib) messages: 96218 nosy: flox severity: nor

[issue7471] GZipFile.readline too slow

2009-12-10 Thread asnakelover
asnakelover added the comment: Hope this reply works right, the python bug interface is a bit confusing for this newbie, it doesn't say "Reply" anywhere - sorry if it goes FUBAR. I tried the splitlines() version you suggested, it thrashed my machine so badly I pressed alt+sysrq+f (which invokes

[issue7474] multiprocessing.managers.SyncManager managed object creation fails when started outside of invoked file

2009-12-10 Thread R. David Murray
Changes by R. David Murray : -- nosy: +jnoller priority: -> normal type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list

[issue1395552] add support for thread function result storage

2009-12-10 Thread Michal Božoň
Michal Božoň added the comment: i still do not agree, it will always feel somehow incomplete, being able to easily "threadize" the function: >>> t = threading.Thread(target=func) and then not being able to get the target function result (easily) -- __

[issue7471] GZipFile.readline too slow

2009-12-10 Thread Brian Curtin
Changes by Brian Curtin : -- nosy: +brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue7474] multiprocessing.managers.SyncManager managed object creation fails when started outside of invoked file

2009-12-10 Thread Eric
Changes by Eric : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue7474] multiprocessing.managers.SyncManager managed object creation fails when started outside of invoked file

2009-12-10 Thread Eric
New submission from Eric : I am attempting to create a multiprocessing.SyncManager subclass instance, register a test class with it, start the manager, and instantiate the test class. The example I'm providing here is basically equivalent, and illustrates the same problem (example code is at the

[issue7472] email.encoders.encode_7or8bit(): typo "iso-2202". "iso-2022" is correct.

2009-12-10 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> barry nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue1395552] add support for thread function result storage

2009-12-10 Thread R. David Murray
R. David Murray added the comment: I agree with Stephen. You can implement this functionality easily through the current API (subclassing), so there's no need to complicate the existing API to handle this one communication method as a special case. Furthermore, this particular use case is the

[issue7473] x84_64 arch Missing from 2.6.4 Mac universal binaries - Cripples building embedded 64-bit

2009-12-10 Thread Paul Nelson
New submission from Paul Nelson : By excluding the x86_64 architecture from the supplied MacOS install, you are crippling the ability to build an 64-bit application that embeds python. The Apple supplied universal binary includes all 3 architectures ppc, i386, and x86_64. If you are going to

[issue1395552] add support for thread function result storage

2009-12-10 Thread Michal Božoň
Michal Božoň added the comment: why would we throw the thread function result out of the window? because there is a another way, to do it? there are always many ways, how to do it, so why would we want to do it very difficult way? i think that not having the result stored somewhere is a bug and

[issue7472] email.encoders.encode_7or8bit(): typo "iso-2202". "iso-2022" is correct.

2009-12-10 Thread Yukihiro Nakadaira
New submission from Yukihiro Nakadaira : email.encoders.encode_7or8bit(): typo "iso-2202". "iso-2022" is correct. Index: Lib/email/encoders.py === --- Lib/email/encoders.py (revision 76749) +++ Lib/email/encoders.py (wo

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread flox
Changes by flox : Added file: http://bugs.python.org/file15521/issue7466.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread flox
Changes by flox : Removed file: http://bugs.python.org/file15520/issue7466.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread flox
flox added the comment: Well... here comes the patch. -- keywords: +patch Added file: http://bugs.python.org/file15520/issue7466.diff ___ Python tracker ___ _

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, you've been faster than me, flox :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: An even simpler way to reproduce: >>> import gc >>> def g(it): ... for x in it: ... gc.collect() ... yield x ... >>> t = tuple(g(range(100))) Erreur de segmentation This is probably caused by the GC optimizations I introduced in trunk and 3.1. ---

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread flox
flox added the comment: Fix is coming soon... ## Sample code: import gc tuple(gc.collect() for i in range(11)) ## python: Objects/tupleobject.c:853: _PyTuple_Resize: ## Assertion `g->gc.gc_refs != (-2)' failed. And Trunk is affected -- versions: +Python 2.7 ___

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +pitrou priority: -> high stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue7471] GZipFile.readline too slow

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: (GZipFile.readline() is implemented in pure Python, which explains why it's rather slow) -- priority: -> normal title: gzip module too slow -> GZipFile.readline too slow ___ Python tracker

[issue7471] gzip module too slow

2009-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: How does the following compare? f = gzip.open(...) s = f.read() for line in s.splitlines(): print line -- nosy: +pitrou ___ Python tracker

[issue7471] gzip module too slow

2009-12-10 Thread asnakelover
New submission from asnakelover : It's not a big problem because we can just shell to zcat but compare these two: $ time python ./b.py >/dev/null real0m10.977s user0m7.128s sys 0m0.888s $ time python ./a.py >/dev/null real1m19.015s user1m18.185s sys 0m0.072s $ # Notice

[issue7470] logger.StreamHandler emit encoding fallback is wrong

2009-12-10 Thread Christian Boos
Christian Boos added the comment: PPS: Ok, links to the Mercurial repo /really/ don't work, and it was not the #l837 part ;-) -- ___ Python tracker ___ _

[issue7470] logger.StreamHandler emit encoding fallback is wrong

2009-12-10 Thread Christian Boos
Christian Boos added the comment: One way to solve the issue. PS: copy/pasting URLs to the Mercurial repo apparently doesn't work, for some reason (probably the line anchor); the URL I gave above was: http://code.python.org/hg/trunk/file/bd98b2c097fe/Lib/logging/__init__.py + #l837 -

[issue7470] logger.StreamHandler emit encoding fallback is wrong

2009-12-10 Thread Christian Boos
New submission from Christian Boos : For a stream with a "poor" encoding, such as sys.stderr on Windows where encoding is cp437, the encoding of an unicode message will fail (expected) and then a fallback encoding to UTF-8 will be done: (in http://code.python.org/hg/trunk/file/bd98b2c097fe/Li

[issue7469] Design and History FAQ entry on Floating Point does not mention short repr.

2009-12-10 Thread R. David Murray
New submission from R. David Murray : See http://docs.python.org/dev/faq/design.html#why-are-floating-point-calculations-so-inaccurate. The 3.1 version is the same, so it also needs to be updated. The entry links to the tutorial, which has the correct information for 3.1/3.2, but not for trunk.

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread flox
flox added the comment: Yes, confirmed too. Both 3.1 and 3.2 are broken. Minimal sequence to trigger the bug: """ ~ $ ./python Python 3.2a0 (py3k:76743M, Dec 10 2009, 12:19:41) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. """ def m(i): if

[issue7468] PyErr_Format documentation doesn't mention all format codes

2009-12-10 Thread Ronald Oussoren
New submission from Ronald Oussoren : I haven't checked the 3.1, 2.7 and 2.6 documentation, but at least for 3.2 the documentation of PyErr_Format lists a very small number of supported format characters compared to PyUnicode_FromFormat even though PyErr_Format calls PyUnicode_FromFormatV to d

[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-10 Thread Stefan Krah
Stefan Krah added the comment: Segfault confirmed on 64 bit Ubuntu, Python 3.2a0: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f5074dea6e0 (LWP 11665)] 0x0042111b in _PyTuple_Resize (pv=0x7fff7ce03b10, newsize=25) at Objects/tupleobject.c:853 853

[issue3363] python version incorrectly reported in crash reports on Mac OS X 10.4.11 PPC

2009-12-10 Thread Ronald Oussoren
Changes by Ronald Oussoren : -- assignee: -> ronaldoussoren nosy: +ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list mailing

[issue1706039] Added clearerr() to clear EOF state

2009-12-10 Thread Scott Dial
Changes by Scott Dial : Removed file: http://bugs.python.org/file15516/issue1706039-py3k.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue1706039] Added clearerr() to clear EOF state

2009-12-10 Thread Scott Dial
Changes by Scott Dial : Added file: http://bugs.python.org/file15517/issue1706039-py3k.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue1706039] Added clearerr() to clear EOF state

2009-12-10 Thread Scott Dial
Scott Dial added the comment: I've attached a patch that applies cleanly against py3k. I do not have an in-depth understanding of the new io module, but at a cursory glance, it seems to not use FILE streams, and would not be subject to this bug. However, Py_UniversalNewlineFgets() still remains

[issue6692] asyncore kqueue support

2009-12-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I have a patch for adding epoll() support which is almost ready (asyncore supports poll(), not epoll()), it's just a matter of writing tests. kqueue() shouldn't be too difficult to implement considering that we can take Twisted as example. ...But aside fro