[issue10183] test_concurrent_futures failure on Windows

2010-11-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Then I get more failures: == FAIL: test_map_timeout (test.test_concurrent_futures.ProcessPoolExecutorTest

[issue10183] test_concurrent_futures failure on Windows

2010-11-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Could you try with the patch that I just attached? And thanks for you help, I really appreciated it! It works ok indeed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue10399] AST Optimization: inlining of function calls

2010-11-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Sorry again for another epic-length comment... I'm attaching the latest work-in-progress on this. If this a work in progress, you could create an SVN branch in the sandbox (you can then use svnmerge to avoid diverging too much from mainline

[issue10469] test_socket fails

2010-11-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, loewis, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469

[issue10469] test_socket fails

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The core problem seems to be that the errno module has mismatching values on your Python build (for ECONNREFUSED and EWOULDBLOCK, at least, which explains all 4 failures). On a Windows 7 VM here: errno.ECONNREFUSED 10061 errno.EWOULDBLOCK

[issue10469] test_socket fails

2010-11-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs

[issue9435] test_distutils fails without zlib

2010-11-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9435 ___ ___ Python-bugs-list

[issue8340] bytearray undocumented on trunk

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Done in r86602. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8340

[issue10255] refleak in initstdio

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Fixed in r86607, thanks. -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10255

[issue8078] add more baud constants to termios

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch committed in r86610, thank you! -- nosy: +pitrou resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue7804] test_readline failure

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I can't reproduce anymore (Debian 5.0.6). Barry? -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7804

[issue10448] Add Mako template benchmark to Python Benchmark Suite

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Pushed in 40e80cede832, thank you. (2to3'ed Mako appears 3x slower than on 2x, but it's not obvious whether it's Python 3 itself or the constructs added by 2to3; I think running 2to3ed benchmarks is a bit pointless in itself, because it's

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Martin, You misunderstood. I was not proposing that scripts provide a CA list, but that users might deploy a CA list into their Python installation, which is then picked up in the same way as you are asking for on Ubuntu. Could you elaborate

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Having applications/scripts explicitly opt-in to a default CA certificate list would be an option (then making those applications break in installations where the default CA list is empty). Errors should never pass silently. IMHO

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7995 ___ ___ Python-bugs-list mailing

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Oh, and a test should be added of course. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7995

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It seems to me that it's a reasonable request. There is indeed a bug, since Python uses non-blocking sockets to implement its timeout feature, and flags inheritance means Python's view of whether the socket is non-blocking is not in sync

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: nh2, your issue looks slightly different. In any case, can you tell us what your system is, and post a simple script to reproduce the issue? -- ___ Python tracker rep...@bugs.python.org http

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Fine. So if not in the ssl module what about for urllib etc.? The same answer really... We can't change default settings without breaking compatibility. -- ___ Python tracker rep...@bugs.python.org

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: -db ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10441 ___ ___ Python-bugs-list mailing list

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: rejected - stage: needs patch - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10441

[issue10478] Ctrl-C locks up the interpreter

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Wow. The lock is precisely there so that the buffered object doesn't have to be MT-safe or reentrant. It doesn't seem reasonable to attempt to restore the file to a stable state in the middle of an inner routine. Also, the outer TextIOWrapper

[issue10479] cgitb.py should assume a binary stream for output

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +facundobatista, fdrake, orsenthil versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10479

[issue10486] http.server doesn't set all CGI environment variables

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +facundobatista, fdrake, orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10486

[issue10491] Insecure Windows python directory permissions

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10491 ___ ___ Python-bugs-list mailing

[issue10485] http.server fails when query string contains addition '?' characters

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +facundobatista, fdrake, orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10485

[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +facundobatista, fdrake, orsenthil versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10484

[issue10487] http.server - doesn't process Status: header from CGI scripts

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +facundobatista, fdrake, orsenthil type: behavior - feature request versions: -Python 2.6, Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10487

[issue10478] Ctrl-C locks up the interpreter

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10478 ___ ___ Python-bugs-list

[issue10492] test_doctest fails with iso-8859-15 locale

2010-11-21 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: $ LANG=ISO-8859-15 ./python -m test.regrtest test_doctest [1/1] test_doctest ** File /home/antoine/py3k/__svn__/Lib/test/test_doctest.py, line 1676

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Anyway, my personal opinion is that we should consider the current behavior a bug and fix it. I like the idea of setting all accepted sockets to blocking mode (and documenting it clearly). -1. I think it is what most people would

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le dimanche 21 novembre 2010 à 20:16 +, Martin v. Löwis a écrit : We are talking about the timeout feature, which is a Python feature, not a BSD (or Linux) sockets feature. It should work properly, even if that means adding some

[issue10493] test_strptime failures under OpenIndiana

2010-11-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10493 ___ ___ Python-bugs-list

[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well if WeakKeyDictionary silences the TypeError from ref(), it sounds consistent for WeakSet to silence it too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10360

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The notes in the documentation under socket.gettimeout() do go into more detail than elsewhere. But at least one thing there is at best misleading: Sockets are always created in blocking mode is, as we've seen, not correct for BSD-ish systems

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-11-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, unless someone explains convincingly how the current behaviour is desireable (rather than misleading and useless), I really think this is a bug that should be fix (then we can also discuss what the fix should exactly be). So

[issue9915] speeding up sorting with a key

2010-11-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Worthwhile trade? +1 obviously. Why don't you contribute a list sorting benchmark to the suite in http://hg.python.org/benchmarks/? -- ___ Python tracker rep...@bugs.python.org http

[issue9915] speeding up sorting with a key

2010-11-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le mardi 23 novembre 2010 à 00:10 +, Daniel Stutzbach a écrit : Daniel Stutzbach stutzb...@google.com added the comment: Antoine Pitrou rep...@bugs.python.org wrote: Why don't you contribute a list sorting benchmark to the suite

[issue9915] speeding up sorting with a key

2010-11-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The Rietveld issue is here: http://codereview.appspot.com/3269041 I ended up loading my incremental patches in, but it's easy enough to diff the base with the last patch. If for some reasons it doesn't work as conveniently as I expect, let

[issue9915] speeding up sorting with a key

2010-11-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I ended up loading my incremental patches in, but it's easy enough to diff the base with the last patch. If for some reasons it doesn't work as conveniently as I expect, let me know and I will upload it to Rietveld again as one big patch

[issue9915] speeding up sorting with a key

2010-11-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: My original patch was much more focused, but had a slightly larger performance penalty for sorting random keys (see http://bugs.python.org/msg122178). Do you think the performance tradeoff there was still worthwhile? I am not objecting

[issue10518] Bring back callable()

2010-11-24 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: It was just resting. Here is a patch to wake it up for 3.2 (or 3.3 pending moratorium interpretation). As for the py3k warning in 2.x (and the 2to3 fixer), it's not obvious what we should do: callable() clearly doesn't exist in 3.0 and 3.1

[issue10519] setobject.c no-op typo

2010-11-24 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +rhettinger, stutzbach versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10519

[issue10520] Build with --enable-shared fails

2010-11-24 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10520 ___ ___ Python-bugs-list mailing

[issue10522] test_telnet exception

2010-11-24 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: This has just occurred on the Solaris buildbot: test_telnetlib Exception in thread Thread-452: Traceback (most recent call last): File /home2/buildbot/slave/2.7.loewis-sun/build/Lib/threading.py, line 530, in __bootstrap_inner self.run

[issue10521] str methods don't accept non-BMP fillchar on a narrow Unicode build

2010-11-24 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The question is, what should it do with such an input? Pretend it's a single char (but other chars in the source string won't get the same treatment)? Treat it as a two-char string (but then center() and friends should logically be extended

[issue10518] Bring back callable()

2010-11-25 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'm with Ezio here. I'm -1 for callable(), +0 for iscallable() (there should be preferably one obvious way to do it and using isinstance() seems to be that way at this point). The thing is, isisinstance(x, collections.Callable) is hardly

[issue10154] locale.normalize strips - from UTF-8, which fails on Mac

2010-11-25 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Mandriva and Debian also work fine with both UTF8 and UTF-8. For the record, the canonical spelling inside /usr/share/locale is UTF-8. I suppose glibc does its own normalization. -- nosy: +pitrou

[issue10538] PyArg_ParseTuple(s*) does not always incref object

2010-11-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10538 ___ ___ Python-bugs-list mailing

[issue10541] regrtest.py -T broken

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: `make coverage` is fine, you just have to use the -m test.regrtest form when running the tests. -- nosy: +pitrou resolution: - invalid status: open - pending ___ Python tracker rep...@bugs.python.org

[issue10478] Ctrl-C locks up the interpreter

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a patch raising RuntimeError on reentrant calls to a buffered object. I haven't touched _pyio; I wonder how to do it without making it even slower. -- keywords: +patch Added file: http://bugs.python.org/file19841

[issue10478] Ctrl-C locks up the interpreter

2010-11-27 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- stage: - patch review versions: +Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10478

[issue10518] Bring back callable()

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It might be not obvious, but it's consistent with the check for other attributes. I don't know what attributes you're talking about, and there doesn't seem to be a lot of consistency there. Besides, being consistently obscure and hard to find

[issue10518] Bring back callable()

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed in r86842. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10518

[issue10555] AIX 5.3 - GCC - Python 2.7 Shared Library Support - Fatal Python error: Interpreter not initialized (version mismatch?)

2010-11-27 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +barry, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10555 ___ ___ Python-bugs-list

[issue10518] Bring back callable()

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le samedi 27 novembre 2010 à 22:23 +, SilentGhost a écrit : SilentGhost michael.mischurow+...@gmail.com added the comment: I thought PEP 3003 was quite unambiguous: The stated goal of the moratorium is to make it easier for alternate

[issue10518] Bring back callable()

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I thought that moratorium meant Guido dis/approval is not applicable to the 3.2 Guido can decide of everything: PEPs, etc. That's what BDFL means. So he can also decide of exceptions to the rules he decided on. (rules can have exception in any

[issue10518] Bring back callable()

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: yes, my problem is that callable was removed and a way was shown how to do this check. The way which is consistent with the check for any other type (ABC). ABCs are still the exception in Python, and duck typing is still the rule. I don't

[issue10518] Bring back callable()

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: ABCs are still the exception in Python, and duck typing is still the rule. Then why do we callable again? Because the way __call__ is looked up means hasattr(x, __call__) is not the right answer. Otherwise there would be no point

[issue10556] test_zipimport_support mucks up with modules

2010-11-27 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: This test failure is due to test_zipimport_support loading and unloading modules, which leads to them being reloaded. Then the ssl.CertificateError which is checked for by assertRaises isn't the same as the one raised by the module under test

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-11-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I suggest Py_UNICODE_ADVANCE() to avoid false suggestion that the iterator protocol is being used. You can't use the iterator protocol on a non-PyObject, and Py_UNICODE_* (as opposed to PyUnicode_*) suggests the macro operates on a raw array

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-11-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - mark.dickinson nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10562

[issue10547] FreeBSD: wrong value for LDSHARED in sysconfig

2010-11-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Antoine, there are some remaining {LDFLAGS}, two in the Darwin sections, one in the OpenBSD section. I think all of those should be removed as well. Do you agree? I didn't want to mess with these things too much. I guess you can try

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-11-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (and perhaps a ResourceWarning if you choose something different from i and j) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10562

[issue3243] Support iterable bodies in httplib

2010-11-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thanks for the patch. First, you don't need to support str, since sockets only accept binary strings (not unicode). Second, I think it's simpler and more generic to do something like: try: self.sock.sendall(data) except TypeError

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

2010-11-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I can reproduce the issue with 3.2 here. Using Wireshark, I see that the request to http://www.ihnez.cz is satisfied, but the second request (to http://ihnez.cz) is never issued. Here is the Wireshark dump for the TCP session (request

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

2010-11-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: That line of code (`void = fp.read()`) dates back to a commit by Guido in 1995, and isn't motivated by any comment or message. HTTP servers probably have evolved till then :) -- ___ Python tracker

[issue10541] regrtest.py -T broken

2010-11-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: haypo - resolution: invalid - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10541

[issue10576] Add a progress callback to gcmodule

2010-11-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, as you point out, it would make more sense to have two separate callbacks. Also, PyErr_WriteUnraisable() is better than PyErr_Clear(). Finally, you accidentally recoded the file; it should be kept utf-8, not latin-whatever

[issue10580] Installer sentence in bold

2010-11-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10580 ___ ___ Python-bugs-list mailing

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

2010-11-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: For the record, this will need a comprehensive rewrite of bz2module, since it uses FILE pointers right now. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5863

[issue10478] Ctrl-C locks up the interpreter

2010-11-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Would avoiding PyErr_CheckSignals() while the file object is in inconsistent state be a reasonable alternative? No, because we'd like IO operations to be interruptible by the user (e.g. pressing Ctrl-C) when they would otherwise block

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Let's start bikeshedding the calling signature. I like having a single callback, since multiple callables are a nuisance to manage. IMO the callback should have a second argument as a dict containing various statistics that we can expand over

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: pitrou: actually that seems a bit suspect now... you need to handle 'data' differently depending on its type, Yes, but you can't know all appropriate types in advance, so it's better to try and catch the TypeError. I don't understand your

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: len(data) will raise anyway. No, it won't, if the iterable happens to be a sequence. Well, it seems the patch is confused between iterable and iterator. Only iterators have a __next__, but they usually don't have a __len__. The patch should

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: One way to check that it's bytes-compatible is to take a memoryview of it: memoryview(babc) memory at 0x1cf5120 memoryview(bytearray(babc)) memory at 0x1cf55a0 memoryview(array.array('b', babc)) memory at 0x1cf52a0 memoryview([babc

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: - Lets have the ValueError raised from the urllib/request.py. Changing it to isinstance(data,collections.Iterable) as Antoine suggested is okay here too. Xuanji is right: it's not. We want bytes to be accepted, and it's an iterable

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: You are right, Antoine. How about a string and a dict? the string can be start and stop and we can add interesting information to the dict as you suggest. Looks good to me. -- ___ Python tracker

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Answering to myself, sorry. memoryview() does return the right answer of whether the object supports the buffer interface, *however* it doesn't mean the len() will be right. For example, take an array.array of ints: memoryview(array.array(I

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10589 ___ ___ Python-bugs-list mailing

[issue8685] set(range(100000)).difference(set()) is slow

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Raymond, unless you object, I'd like to commit this before beta1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8685

[issue8685] set(range(100000)).difference(set()) is slow

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Modified patch committed in r86905. Thanks! -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: What does unsupported mean? Abstract would look more exact. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10589

[issue10591] test_os failure in refleak runs

2010-11-30 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: $ ./python -m test.regrtest -R 3:2 test_os [1/1] test_os [35351 refs] [35351 refs] [35352 refs] beginning 5 repetitions 12345 [35351 refs] [35351 refs] [35352 refs] test test_os failed -- Traceback (most recent call last): File /home/antoine

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: What does unsupported mean? Abstract would look more exact. It means they raise io.UnsupportedOperation when called (unless the subclass overrides them to do something else). They are not marked with @abstractmethod, so Abstract would

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Other suggestions for a better name for that column are certainly welcome. :-) Stub Methods? Fine with me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10589

[issue10478] Ctrl-C locks up the interpreter

2010-11-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10478 ___ ___ Python-bugs-list mailing

[issue6594] json C serializer performance tied to structure depth on some systems

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Raymond, I'll follow up in private with Shawn. All the recent performance improvements done on JSON (in 3.2) mean the issue can be closed IMO. -- resolution: - out of date status: open - closed

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: just to confirm: we WANT array.array(I, [1,2,3]) to have a content- length of 12, right? Yes, since it will emit 12 bytes in the body (you could actually have a test for it). -- ___ Python tracker

[issue3243] Support iterable bodies in httplib

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Senthil: +try: + self.sock.sendall(data) Indentation problem here. +if isinstance(data,str): +content_length = len(data) I'm not sure I understand. What does sending an unicode string mean

[issue10594] Typo in PyList_New doc.

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: You don't need to backport, we'll do it ourselves. Can someone from the doc team please review/commit? -- assignee: eli.bendersky - d...@python nosy: +pitrou stage: - patch review ___ Python tracker

[issue8805] urllib should support SSL contexts

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: HTTPSHandler now allows to pass an SSLContext and the old API should be buried in the ground, closing. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue10596] modulo operator bug

2010-12-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10596 ___ ___ Python-bugs-list

[issue3243] Support iterable bodies in httplib

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: if not request.has_header('Content-length'): if (not hasattr(data, '__read__') and What is __read__ supposed to be? 2) Can call len but not buffer: assume len == #bytes Why do you need it at all

[issue9915] speeding up sorting with a key

2010-12-02 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Just wanted to post this so there weren't any illusions about the patch being a big win. Daniel has already posted benchmark numbers, I would trust them rather than any theoretical speculation about whether the patch is interesting

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Since the conventional mathematical symbols for the additional imaginary units of quaternions are j and k, confusion is bound to happen. My preferred solution is to limit PYTHONIMAGINARYSYMBOL values to i, j or k in Python 3.4. The two

[issue9915] speeding up sorting with a key

2010-12-02 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thank you! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9915 ___ ___ Python-bugs-list mailing

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le jeudi 02 décembre 2010 à 22:29 +, Mark Dickinson a écrit : Mark Dickinson dicki...@gmail.com added the comment: Maybe we need a complex analog to datetime.strptime: complex.strpcx('(3 + 4i)', '(%R + %Ii)') - 3 + 4j How about '3

[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2010-12-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Not all incompatibilities have to raise a py3k warnings; AFAIK, only those which are not handled by 2to3 do. -- nosy: +benjamin.peterson, pitrou ___ Python tracker rep...@bugs.python.org http

[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: -pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10562 ___ ___ Python-bugs-list mailing

  1   2   3   4   5   6   7   8   9   10   >