[issue11015] Bring test.support docs up to date
Georg Brandl ge...@python.org added the comment: The divmod() part of the patch is wrong: assertAlmostEqual does not support tuple arguments. The test succeeds because it first does an exact equality check, which apparently is true on your platform. But if it wasn't, you'd get TypeErrors. Also, fcmp() has a different definition of what almost equal means, but I assume this has been regarded in the discussion. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Georg Brandl ge...@python.org added the comment: Reading clear and copy are not supported by bytearray: shouldn't they be? (sort probably really makes no sense on bytearrays.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11286] Some trivial python 2.x pickles fails to load in Python 3.2
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Thu, Feb 24, 2011 at 3:54 PM, Antoine Pitrou rep...@bugs.python.org wrote: .. I've committed the part of the patch which disallows a NULL data pointer with PyMemoryView_FromBuffer in r88550 and r88551. Is it possible to create such buffer in Python (other than by exploiting a bug or writing a rogue extension module)? If not, this should be a SystemError or even just an assert() rather than ValueError. We normally raise a SystemError for invalid NULL pointers, not ValueErrors. SystemError is used for things that go wrong at the C level and indicate a likely programming error at that level. The origin of that error is not important, but the check will usually happen in the interpreter. FWIW, it's also used in C extensions for much the same reason, so in the wild you'll also find SystemErrors raised by 3rd party extensions. -- title: Some trivial python 2.x pickles fails to load in Python 3.2 - Some trivial python 2.x pickles fails to load in Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11286 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11313] Speed up default encode()/decode()
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: New submission from Alexander Belopolsky belopol...@users.sourceforge.net: In Python 3.x default encoding is always utf-8, but encode()/decode() still try to look it up. Attached patch eliminates a call to normalize_encoding and several strcmp() calls. +1. Please add a comment explaining why this can be done. -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11313 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Eli Bendersky eli...@gmail.com added the comment: Georg, Good catch on the tuples in assertAlmostEqual, thanks! I see three methods of resolution: 1. Since the floats in this case are powers of 1/2, they could be tested for exact equality, or do you figure there are platforms where this is not guaranteed? 2. I can make a local change in the test to assertAlmostEqual on each member of the tuple 3. assertAlmostEqual on tuples can be added to the unittest module Any ideas? I can also commit (2) for the time being since it's the least dubious, and leave the resolution on 1 3 for later (and/or in separate issues). Regarding fcmp being not exactly assertAlmostEqual - it was discussed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Georg Brandl ge...@python.org added the comment: (2) would be my choice. (1) *should* be true, but this is a change in the test semantics. (3) would be feature creep and I don't think it's a good idea. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Eli Bendersky eli...@gmail.com added the comment: Attaching a revised patch with (2) implemented. -- Added file: http://bugs.python.org/file20885/issue11015.py3k.remove_fcmp.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Eli Bendersky eli...@gmail.com added the comment: On Fri, Feb 25, 2011 at 10:11, Georg Brandl rep...@bugs.python.org wrote: Georg Brandl ge...@python.org added the comment: Reading clear and copy are not supported by bytearray: shouldn't they be? Perhaps they should, and it's not a big deal to implement. But I'm not 100% clear on the policy of how such changes are approved. Should this be discussed in the list? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Georg Brandl ge...@python.org added the comment: Yes, that looks good now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Unless someone raises a controversial and non-trivial issue about adding clear() and copy() to bytearray, there is no need for a python-dev discussion on the subject. Just post a patch to the tracker. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Georg Brandl ge...@python.org added the comment: Yes, it should be discussed on python-dev. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Eli Bendersky eli...@gmail.com added the comment: Georg Brandl ge...@python.org added the comment: Yes, that looks good now. Thanks. fcmp FUZZ removal committed in revision 88558 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11222] Python3.2rc3 fails to build on Mac OS X with a non-framework build
Georg Brandl ge...@python.org added the comment: Does this need to be backported? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11316] RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message
New submission from Georges Martin jrjsm...@gmail.com: Both httplib.HTTPMessage and email.message.Message classes[1] implements methods for RFC822 headers parsing. Unfortunately, they have different implementations and they do not provide the same level of functionality. One example that is bugging me is that: * httplib.HTTPMessage is missing the get_filename method present in email.message.Message, that allows you to easily retrieve the filename from a 'Content-disposition: attachment; filename=fghi.xyz' header; * httplib.HTTPMessage has getparam, getplist and parseplist methods but AFAIK, they are not and cannot be used outside of the 'content-type' header parsing; * email.message.Message has a generic get_param method to parse any RFC822 header with parameters, such as 'content-disposition' or 'content-type'. The workaround I'm using is to decorate an httplib.HTTPMessage with the missing methods from email.message.Message: def monkeypatch_http_message(obj): Decorate an httplib.HTTPMessage instance's class with the RFC822 header parameters parsing methods from email.message.Message. (thanks to ncoghlan) import httplib assert isinstance(obj, httplib.HTTPMessage) cls = obj.__class__ from email import utils from email.message import ( _parseparam, _unquotevalue, Message ) funcnames = ( '_get_params_preserve', 'get_params', 'get_param', 'get_filename' ) for funcname in funcnames: cls.__dict__[funcname] = Message.__dict__[funcname] So I can do: import mechanize from some.module import monkeypatch_http_message browser = mechanize.Browser() # in that form, browser.retrieve returns a temporary filename # and an httplib.HTTPMessage instance (tmp_filename, headers) = browser.retrieve(someurl) # monkeypatch the httplib.HTTPMessage instance monkeypatch_http_message(headers) # yeah... my original filename, finally filename = headers.get_filename() -- components: Library (Lib) messages: 129348 nosy: jrjsmrtn priority: normal severity: normal status: open title: RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message type: behavior versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11222] Python3.2rc3 fails to build on Mac OS X with a non-framework build
Ned Deily n...@acm.org added the comment: No backport is needed. The problem was introduced during the 3.2 development cycle by the ABI Version Tagged .so Files feature (PEP 3149). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11314] Subprocess suffers 40% process creation overhead penalty
Charles-Francois Natali neolo...@free.fr added the comment: If you stop to think about it, though, this is actually a shockingly huge percent increase. In any process creation scenario I'm familiar with, its overhead should be so small that you could bump it up several orders of magnitude and still not compete with executing a shell and asking it to do anything, even just exit. os.popen just calls the popen(3) library call, which just performs a fork/execve and some dup/close in between. subprocess.Popen is implemented in Python, so it doesn't come as a surprise that it's slower in your example. But I think there's a point you're missing: you're not just creating a child process, but a shell. subprocess is actually faster than popen to spawn executables (not scripts), because you don't have to spawn a shell. For example: $ cat /tmp/test.c int main(int argc, char *argv[]) { return 0; } $ cat /tmp/test_subprocess.py import subprocess for i in range(1): f = subprocess.Popen('/tmp/test') f.wait() $ cat /tmp/test_popen.py import os for i in range(1): f = os.popen('/tmp/test') f.close() $ time ./python /tmp/test_subprocess.py real0m13.933s user0m3.083s sys 0m12.441s $ time ./python /tmp/test_popen.py real0m18.235s user0m4.293s sys 0m15.176s Given of important the subprocess overhead seems to you, I guess that the processes you're launching are not shell scripts, and thus you're probably better off using subprocess. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors
Georg Brandl ge...@python.org added the comment: Backported to 3.1 in r88556, and 2.7 in r88564. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10360 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Georg Brandl ge...@python.org added the comment: In any case, this issue can be closed. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11317] Documentation not updated to show string exceptions have been deprecated
New submission from Laurence Rowe l...@lrowe.co.uk: The documentation at http://docs.python.org/c-api/exceptions.html#deprecation-of-string-exceptions states that String exceptions are still supported in the interpreter to allow existing code to run unmodified, but this will also change in a future release. String exceptions were removed in 2.6. -- assignee: docs@python components: Documentation messages: 129353 nosy: docs@python, lrowe priority: normal severity: normal status: open title: Documentation not updated to show string exceptions have been deprecated versions: Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11317 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11317] Documentation not updated to show string exceptions have been deprecated
Georg Brandl ge...@python.org added the comment: Thanks, fixed in r88571. -- nosy: +georg.brandl resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11317 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue941346] AIX shared library fix
Georg Brandl ge...@python.org added the comment: Backported to 3.1 in r88560, 2.7 in r88568. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue941346 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11184] Broken large file support on AIX
Georg Brandl ge...@python.org added the comment: Backported to 3.1 in r88562, 2.7 in r88569. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11184 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
New submission from Boštjan Mejak bostjan.me...@gmail.com: I have found a possible typo in an example code of Python 3.2. It's located on page 32 in the PDF version of the FAQ document. The code is: class C: count = 0 # number of times C.__init__ called def __init__(self): C.count = C.count + 1 def getcount(self): return C.count # or return self.count The code block of the __init__ method is the thing that has the typo. Shouldn't C.count = C.count + 1 be c.count = C.count + 1 ? Because the text after this code example says: c.count also refers to C.count for any c such that isinstance(c, C) holds /.../. How can c.count also refer to C.count if there is no c.count in the present code example in the FAQ of Python 3.2? If this is a typo, please fix it for Python 3.2 and also for other Python versions with the same typo. Else if this is not a typo, explain how can c.count refer to C.count if there is no c.count in the code example. -- assignee: docs@python components: Documentation messages: 129357 nosy: Retro, docs@python priority: normal severity: normal status: open title: Python 3.2 FAQ example code typo? versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Boštjan Mejak bostjan.me...@gmail.com added the comment: I have installed Python 3.2 final on my Windows machine and I get an exception when doing list.copy or list.clear in the interpreter. Why is that so? -- Added file: http://bugs.python.org/file20886/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___I have installed Python 3.2 final on my Windows machine and I get an exception when doing list.copy or list.clear in the interpreter. Why is that so? ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Georg Brandl ge...@python.org added the comment: Because they got added *after* 3.2 was released? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: (Not issue related) Ezio and Alexander: after reading your posts and looking back on my code: you're absolutely right. Doing resize(31) is pointless: it doesn't save space (mempool serves [8],16,24,32 there; and: dynamic, normalized coded names don't exist that long in real life, too). And append_char() is inlined but much more expensive than doing (register-loaded) *(target++)=char. Thus i now do believe my code is a bug and i will rewrite doing *target=cstr(resize(len(input)*2)) ... truncate() instead! Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11303 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11316] RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11316] RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message
Changes by R. David Murray rdmur...@bitdance.com: -- type: behavior - feature request versions: +Python 3.3 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Palm Kevin kevin.p...@labsolution.lu added the comment: I think that this issue needs to be reopened... since it never has been resolved... I just downloaded the new version of Python 3.2 and tried to compile, install and use it on Redhat Linux. Installation went fine (configure with --prefix=/usr/mysoft/python32)... But when using Python I get the following error message: Traceback (most recent call last): File /usr/mysoft/python32/lib/python3.2/sysconfig.py, line 332, in _init_posix _parse_makefile(makefile, vars) File /usr/mysoft/python32/lib/python3.2/sysconfig.py, line 220, in _parse_makefile with open(filename, errors=surrogateescape) as f: IOError: [Errno 2] No such file or directory: 'lib/python3.2/config-3.2m/Makefile' During handling of the above exception, another exception occurred: Traceback (most recent call last): File /usr/mysoft/python32/lib/python3.2/site.py, line 529, in module main() File /usr/mysoft/python32/lib/python3.2/site.py, line 517, in main known_paths = addusersitepackages(known_paths) File /usr/mysoft/python32/lib/python3.2/site.py, line 263, in addusersitepackages user_site = getusersitepackages() File /usr/mysoft/python32/lib/python3.2/site.py, line 238, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File /usr/mysoft/python32/lib/python3.2/site.py, line 228, in getuserbase USER_BASE = get_config_var('userbase') File /usr/mysoft/python32/lib/python3.2/sysconfig.py, line 590, in get_config_var return get_config_vars().get(name) File /usr/mysoft/python32/lib/python3.2/sysconfig.py, line 487, in get_config_vars _init_posix(_CONFIG_VARS) File /usr/mysoft/python32/lib/python3.2/sysconfig.py, line 337, in _init_posix raise IOError(msg) IOError: invalid Python installation: unable to open lib/python3.2/config-3.2m/Makefile (No such file or directory) ... I never heard about virtualenv before and I don't know what is the impact of that library, but I guess a just released version of Python should work out of the box?!? (Final 3.2 release) (I was using Python 3.1.3 on the same machine without any hitch...) -- nosy: +palm.kevin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
R. David Murray rdmur...@bitdance.com added the comment: Read a little further: Caution: within a method of C, an assignment like ``self.count = 42`` creates a new and unrelated instance named count in ``self``'s own dict. That is, c.count refers to C.count right up until the point where c.count is assigned a value. So, c.count = c.count + 1 will add one to the current value of C.count, and assign it to the *instance* variable c.count. c.count at that point no longer refers to the *class* variable C.count. Thus your change to the __init__ function would completely defeat the purpose of the example (which is to show how to use a *class* variable. If you can suggest a concise wording that would have made this clearer to you, we can consider a doc patch. -- nosy: +r.david.murray type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
R. David Murray rdmur...@bitdance.com added the comment: Hmm. Rereading your message, is seems like you just didn't understand the statement c.count refers to C.count for any That is a statement about how the language behaves. If there is not yet an instance variable 'count', but a class variable 'count' exists, then the value of the class variable is used when c.count is evaluated. A class is a two level nested name space with a couple of special properties. I don't really see any way to make that statement clearer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Boštjan Mejak bostjan.me...@gmail.com added the comment: Right, right. My bad. Can't wait for Python 3.3! ;) -- Added file: http://bugs.python.org/file20887/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___Right, right. My bad. Can#39;t wait for Python 3.3! ;) ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
Boštjan Mejak bostjan.me...@gmail.com added the comment: Caution: within a method of C, an assignment like ``self.count = 42`` creates a new and unrelated instance named count in ``self``'s own dict. More clear is to say *Caution: within a method of class C, an assignment like ``self.count = 42`` creates a new and unrelated instance named count in ``self``'s own dict.* * * -- Added file: http://bugs.python.org/file20888/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___blockquote class=gmail_quote style=margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; span class=Apple-style-span style=border-collapse: collapse; color: rgb(32, 32, 32); font-family: #39;Droid Sans#39;, arial, sans-serif; font-size: 13px; Caution: within a method of C, an assignment like ``self.count = 42`` creates a new and unrelated instance named quot;countquot; in ``self``#39;s own dict./span/blockquote divbr/divdivMore clear is to say span class=Apple-style-span style=border-collapse: collapse; color: rgb(32, 32, 32); font-family: #39;Droid Sans#39;, arial, sans-serif; font-size: 13px; iCaution: within a method of class C, an assignment like ``self.count = 42`` creates a new and unrelated instance named quot;countquot; in ``self``#39;s own dict./i/span/div divspan class=Apple-style-span style=border-collapse: collapse; color: rgb(32, 32, 32); font-family: #39;Droid Sans#39;, arial, sans-serif; font-size: 13px; ibr/i/span/div ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Palm Kevin kevin.p...@labsolution.lu added the comment: Please find here a small C app embedding python that shows how to reproduce the problem (It turned out that the problem is caused by the new method Py_SetPath): #include Python.h main(int argc, char **argv) { Py_SetPath(Py_GetPath()); printf(Init\n); Py_Initialize(); printf(-- END\n); } -- Python crashes on Py_Initialize... only if the Py_SetPath is executed... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11319] Command line option -t (and -tt) does not work for a particular case
New submission from Jérôme Radix jerome.ra...@gmail.com: The attached example mixes tabs and spaces but python does not report any warning when used with -t. Line 4 contains 1 tab. Lines after line 4 contains spaces. Tested using : Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 C:\python -t test_tt.py C:\ -- components: Interpreter Core files: test_tt.py messages: 129368 nosy: jerome.radix priority: normal severity: normal status: open title: Command line option -t (and -tt) does not work for a particular case type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file20889/test_tt.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11319 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11316] RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message
R. David Murray rdmur...@bitdance.com added the comment: Ah, yes, you are correct. We must reject this, then, since 2.7 is now feature frozen and this is a feature request. -- resolution: - out of date stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Antoine Pitrou pit...@free.fr added the comment: Le vendredi 25 février 2011 à 13:58 +, Palm Kevin a écrit : Palm Kevin kevin.p...@labsolution.lu added the comment: Please find here a small C app embedding python that shows how to reproduce the problem (It turned out that the problem is caused by the new method Py_SetPath): Can you open a separate issue? Also, please include your error message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11253] autodocument first appearance of ctypes.wintypes constants
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Can you provide a patch, or show how to do it concretely? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11253 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11320] Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix ony))
New submission from Palm Kevin kevin.p...@labsolution.lu: The new API method Py_SetPath seems bugged. When executing the following code, then the application crashes on Py_Initialize()-call: #include Python.h main(int argc, char **argv) { Py_SetPath(Py_GetPath()); printf(Init\n); Py_Initialize(); printf(-- END\n); } The raised exception is the following: Traceback (most recent call last): File /usr/labsolution/python32/lib/python3.2/sysconfig.py, line 332, in _init_posix _parse_makefile(makefile, vars) File /usr/labsolution/python32/lib/python3.2/sysconfig.py, line 220, in _parse_makefile with open(filename, errors=surrogateescape) as f: IOError: [Errno 2] No such file or directory: 'lib/python3.2/config-3.2m/Makefile' During handling of the above exception, another exception occurred: Traceback (most recent call last): File /usr/labsolution/python32/lib/python3.2/site.py, line 529, in module main() File /usr/labsolution/python32/lib/python3.2/site.py, line 517, in main known_paths = addusersitepackages(known_paths) File /usr/labsolution/python32/lib/python3.2/site.py, line 263, in addusersitepackages user_site = getusersitepackages() File /usr/labsolution/python32/lib/python3.2/site.py, line 238, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File /usr/labsolution/python32/lib/python3.2/site.py, line 228, in getuserbase USER_BASE = get_config_var('userbase') File /usr/labsolution/python32/lib/python3.2/sysconfig.py, line 590, in get_config_var return get_config_vars().get(name) File /usr/labsolution/python32/lib/python3.2/sysconfig.py, line 487, in get_config_vars _init_posix(_CONFIG_VARS) File /usr/labsolution/python32/lib/python3.2/sysconfig.py, line 337, in _init_posix raise IOError(msg) IOError: invalid Python installation: unable to open lib/python3.2/config-3.2m/Makefile (No such file or directory) (perhaps linked to issue #10743 ?!) -- components: Interpreter Core messages: 129372 nosy: palm.kevin priority: normal severity: normal status: open title: Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix ony)) type: crash versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11320 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Palm Kevin kevin.p...@labsolution.lu added the comment: Done: #11320 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10882] Add os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: Committed in r88580. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10882 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11232] asyncore - don't throw a traceback when a client disconnects in echo server example
Giampaolo Rodola' g.rod...@gmail.com added the comment: Fixed. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11232 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11316] RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message
Georges Martin jrjsm...@gmail.com added the comment: No problem. I thought important that the issue and a workaround were documented somehow... :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11259] asynchat does not check if terminator is negative integer
Giampaolo Rodola' g.rod...@gmail.com added the comment: Can you provide a patch including a test case? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11314] Subprocess suffers 40% process creation overhead penalty
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11314] Subprocess suffers 40% process creation overhead penalty
Antoine Pitrou pit...@free.fr added the comment: But in the two scenarios I mentioned (monitoring and Web services such as CGI, neither of which is particularly rare), this is going to make quite a lot of difference That's why I asked for absolute numbers for the overhead difference. A percentage doesn't tell me if launching a process costs 50µs more or 500ms more. The only question is whether process launch overhead is significant compared to total process runtime (for non-trivial work, that is, not echo 0 ;-)). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11314] Subprocess suffers 40% process creation overhead penalty
Antoine Pitrou pit...@free.fr added the comment: Okay, thanks to Charles-François' measurements, we can deduce that each subprocess launch is at most 0.3ms of user CPU time and 1.2ms of system CPU time. IMO that's not a real problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11232] asyncore - don't throw a traceback when a client disconnects in echo server example
Georg Brandl ge...@python.org added the comment: Please add the revision number when fixing. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11232 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10882] Add os.sendfile()
Georg Brandl ge...@python.org added the comment: Three comments: * When changing configure.in, you also should regenerate configure. (Now done in r88584). * PyParse_off_t is a bad name for this function. It is not a new C API, so it should be static, and therefore there is no need for the Py prefix. Changed this to _parse_off_t in r88585. * The whitespace cleanup should have been committed separately. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10882 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11316] RFC822 header parsing API inconsistencies between httplib.HTTPMessage and email.message.Message
R. David Murray rdmur...@bitdance.com added the comment: Yes, thanks for that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')
Marc-Andre Lemburg m...@egenix.com added the comment: r88586: Normalized the encoding names for Latin-1 and UTF-8 to 'latin-1' and 'utf-8' in the stdlib. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11303 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11321] 9th import of module _pickle always crashes
New submission from Palm Kevin kevin.p...@labsolution.lu: Please have a look to the following app: #include Python.h main(int argc, char **argv) { int i; printf(START\n); for(i = 0; i 20; i++){ Py_Initialize(); printf(Try import #%i ..., i); PyRun_SimpleString(import _pickle\n); printf(SUCCESS\n); Py_Finalize(); } printf(END\n); } If I run that app (Linux), then I get the following output: START Try import #0 ...SUCCESS Try import #1 ...SUCCESS Try import #2 ...SUCCESS Try import #3 ...SUCCESS Try import #4 ...SUCCESS Try import #5 ...SUCCESS Try import #6 ...SUCCESS Try import #7 ...SUCCESS Segmentation fault It systematically crashes on the 9th call ... Does anybody know the reason of this segmentation fault problem?? -- components: Interpreter Core messages: 129384 nosy: palm.kevin priority: normal severity: normal status: open title: 9th import of module _pickle always crashes type: crash versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11321 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')
Marc-Andre Lemburg m...@egenix.com added the comment: I think we should reset this whole discussion and just go with Alexander's original patch issue11303.diff. I don't know who changed the encoding's package normalize_encoding() function (wasn't me), but it's a really slow implementation. The original version used the .translate() method which is a lot faster. I'll open a new issue for that part. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11303 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11321] 9th import of module _pickle always crashes
Changes by Palm Kevin kevin.p...@labsolution.lu: -- versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11321 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11322] encoding package's normalize_encoding() function is too slow
New submission from Marc-Andre Lemburg m...@egenix.com: I don't know who changed the encoding's package normalize_encoding() function (wasn't me), but it's a really slow implementation. The original version used the .translate() method which is a lot faster and can be adapted to work with the Unicode variant of the .translate() method just as well. _norm_encoding_map = (' . ' '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ ' ' abcdefghijklmnopqrstuvwxyz ' '' '' '') def normalize_encoding(encoding): Normalize an encoding name. Normalization works as follows: all non-alphanumeric characters except the dot used for Python package names are collapsed and replaced with a single underscore, e.g. ' -;#' becomes '_'. Leading and trailing underscores are removed. Note that encoding names should be ASCII only; if they do use non-ASCII characters, these must be Latin-1 compatible. # Make sure we have an 8-bit string, because .translate() works # differently for Unicode strings. if hasattr(__builtin__, unicode) and isinstance(encoding, unicode): # Note that .encode('latin-1') does *not* use the codec # registry, so this call doesn't recurse. (See unicodeobject.c # PyUnicode_AsEncodedString() for details) encoding = encoding.encode('latin-1') return '_'.join(encoding.translate(_norm_encoding_map).split()) -- components: Unicode messages: 129386 nosy: lemburg priority: normal severity: normal status: open title: encoding package's normalize_encoding() function is too slow type: performance versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')
Marc-Andre Lemburg m...@egenix.com added the comment: Marc-Andre Lemburg wrote: I don't know who changed the encoding's package normalize_encoding() function (wasn't me), but it's a really slow implementation. The original version used the .translate() method which is a lot faster. I guess that's one of the reasons why Alexander found such a dramatic difference between the shortcut variant of the names and the ones going through the registry. I'll open a new issue for that part. issue11322 -- title: b'x'.decode('latin1') is much slower than b'x'.decode('latin-1') - b'x'.decode('latin1') is much slower thanb'x'.decode('latin-1') ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11303 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Barry A. Warsaw ba...@python.org added the comment: On Feb 25, 2011, at 01:16 PM, Palm Kevin wrote: I think that this issue needs to be reopened... since it never has been resolved... I just downloaded the new version of Python 3.2 and tried to compile, install and use it on Redhat Linux. Installation went fine (configure with --prefix=/usr/mysoft/python32)... On Ubuntu 10.10, I built Python 3.2 from the svn head with --prefix=/tmp/prefix, did a 'make install' and then ran /tmp/prefix/bin/python. It worked fine and I did not get the exception. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11322] encoding package's normalize_encoding() function is too slow
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +belopolsky, ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11322] encoding package's normalize_encoding() function is too slow
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I don't think the normalize_encoding() function was the culprit for issue11303 because I measured timings with timeit which averages multiple runs while normalize_encoding() is called only the one time per encoding spelling due to caching. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
Boštjan Mejak bostjan.me...@gmail.com added the comment: So you're saying that if a class' name is C, then c.count is the same as C.count? I thought Python is case-sensitive. You know: c (small letter c) is not equal to C (big letter C) in Python. I don't understand what you mean by c.count because my intepreter always throws an exception that c is not defined if I feed it with this code example and doc.count -- Added file: http://bugs.python.org/file20890/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___So you#39;re saying that if a class#39; name is C, then c.count is the same as C.count? I thought Python is case-sensitive. You know: c (small letter c) is not equal to C (big letter C) in Python. I don#39;t understand what you mean by c.count because my intepreter always throws an exception that c is not defined if I feed it with this code example and do  gt;gt;gt; c.count ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11277] test_zlib crashes under Snow Leopard buildbot
Charles-Francois Natali neolo...@free.fr added the comment: Could you try with this: def setUp(self): with open(support.TESTFN, wb+) as f: f.seek(_4G) f.write(basdf) f.flush() + os.fsync(f.fileno()) self.mapping = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) HFS+ doesn't seem to support sparse files, so the file is actually zero-filled asynchronously. Maybe the mapping gets done before the blocks have been allocated, which triggers a segfault when the first page is accessed. I'm not sure it'll make any difference, but I'm curious... Also, I'd be curious to see the result of import os name = '/tmp/foo' f = open(name, 'wb') f.seek(1 32) f.write(b'asdf') f.flush() print(os.fstat(f.fileno())) f.close() print(os.stat(name)) Thanks ! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11277 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
Georg Brandl ge...@python.org added the comment: Now it's clear that David is right -- what c refers to is defined in this very sentence. -- nosy: +georg.brandl resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
Boštjan Mejak bostjan.me...@gmail.com added the comment: I don't understand it. My bad. Please explain to me exactly what c refers to. -- Added file: http://bugs.python.org/file20891/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___I don#39;t understand it. My bad. Please explain to me exactly what quot;cquot; refers to. ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
R. David Murray rdmur...@bitdance.com added the comment: Please consult the python tutor's list, the bug tracker is not the place to get introductory help with Python. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11320] Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix ony))
Sridhar Ratnakumar sridh...@activestate.com added the comment: This issue is potentially breaking virtualenv5, http://code.google.com/p/virtualenv5/issues/detail?id=6 -- nosy: +srid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11320 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11320] Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix ony))
Antoine Pitrou pit...@free.fr added the comment: Can you explain why this is a problem in Python? Can't lib/python3.2/config-3.2m/Makefile simply be provided by virtualenv (by copying it, I guess)? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11320 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5421] Irritating error message by socket's sendto method
Changes by Matt Joiner anacro...@gmail.com: -- nosy: +anacrolix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5421 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11314] Subprocess suffers 40% process creation overhead penalty
Gregory P. Smith g...@krypto.org added the comment: fyi - while I still need to update it now that 3.2 final has been released, the http://code.google.com/p/python-subprocess32/ project has a backport of the _posixsubprocess stuff from python 3.2 for use on Python 2.x. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Just some comments for the historical record: During the discussion of issue 4953 research and testing revealed that browsers send back their cgi data using the same charset as the page that they are responding to. So the only way that quoting would be necessary on field names would be if they were quoted funny, as in your example here. It is somewhat unlikely that people would go to the trouble of coding field names that contain and ' and % characters, just to mess themselves up (which ones do that, depend on which quote character is used for the name in the HTML and whether the enctype is multipart/form-data or URL encoding). And Firefox 3.6... provides name=%22 and that presently works with Python 3.2 CGI! But that might mean that for Firefox 4.x, providing the \%22, CGI might pass through the \? And really, the dequoting must be incorrectly coded for the Firefox 3.6 to work. -- nosy: +v+python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11269 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Palm Kevin kevin.p...@labsolution.lu added the comment: @Barry: Yes python runs correctly. The problem arises when you embed python in a C application when calling the Py_SetPath-method (see the follow up issue #11320) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data
Sergey Schetinin ser...@maluke.com added the comment: It does work (Python 2.7.1 here): import cgi cgi.parse_header('Content-Disposition: form-data; name=%22') ('Content-Disposition: form-data', {'name': '%22'}) cgi.parse_header('Content-Disposition: form-data; name=\\%22') ('Content-Disposition: form-data', {'name': '%22'}) However as the unescaping is done sequential .replace, one can construct a header to make it unescape incorrectly: cgi.parse_header('Content-Disposition: form-data; name=%22') ('Content-Disposition: form-data', {'name': '%22'}) Which should be: ('Content-Disposition: form-data', {'name': '\\%22'}) That probably doesn't matter anyway. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11269 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data
Sergey Schetinin ser...@maluke.com added the comment: I wanted to add that the fact that browsers encode the field names in the page encoding does not change that they should escape the header according to RFC 2047. The percent-encoding used in the field name has nothing to do with multipart/form-data or headers encoding or even html attribute value escaping. There's no reason for Chrome to percent-escape the quotation mark in the field name and my use of the percent sign in the field name is only to show that Chrome does not escape the percent sign itself and that there's no way to recover the data from the header sent by Chrome. I imagine there could be a non-ASCII field name that, when encoded in some encoding, will produce something SQL-injection-like: '; other=xx'. That string would make the header parse into something completely different. With IE8 and FF 3.6 it looks like it would be very simple. The same applies to uploaded files names too, so it's not just a matter of choosing sane field names. That's all a browsers' problem though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11269 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10882] Add os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: Thanks Georg. It seems we have a failure on Leopard: http://www.python.org/dev/buildbot/all/builders/PPC%20Leopard%203.x/builds/1411/steps/test/logs/stdio Also, I think I can add support for AIX if someone gives me SSH access over an AIX box. I'm maintaining a separate project to port sendfile() on python 2: http://code.google.com/p/py-sendfile/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10882 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11232] asyncore - don't throw a traceback when a client disconnects in echo server example
Giampaolo Rodola' g.rod...@gmail.com added the comment: Sorry: fixed in r88581. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11232 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Committed issue11303.diff and doc change in revision 88602. I think the remaining ideas are best addressed in issue11322. Given that we are starting to have a whole set of such aliases in the C code, I wonder whether it would be better to make the string comparisons more efficient, e.g. I don't think we can do much better than a string of strcmp()s. Even if a more efficient algorithm can be found, it will certainly be less readable. Moving strcmp()s before normalize_encoding() (and either forgoing optimization for alternative capitalizations or using case insensitive comparison) may be a more promising optimization strategy. In any case all these micro-optimizations are dwarfed by that of bypassing Python calls and are probably not worth pursuing. -- assignee: - belopolsky resolution: - fixed stage: - committed/rejected status: open - pending superseder: - encoding package's normalize_encoding() function is too slow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11303 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11245] Implementation of IMAP IDLE in imaplib?
Terry J. Reedy tjre...@udel.edu added the comment: imaplib has no particular maintainer and I know little about it. Doc says it implements 'a large subset of the IMAP4rev1 client protocol as defined in RFC 2060. I do not remember any discussion on pydev, over the last several years, about imaplib. I presume just the subset was chosen because of some combination of necessity and feasibility, as judged by the implementors. Hence the complement, the unimplemented subset, would be 'not done' rather than 'not wanted'. If your proposed new feature, an IDLE command, is part of this complement, then I would assume that a patch would, in principle, be acceptable. I cannot comment on your particular proposal, but I hope the above helps as far as it goes. -- nosy: +terry.reedy stage: - test needed versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11245 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Georg, what is the issue? Is there some reason that bytearrays should not be copied or cleared? Is there some reason to prefer the current: dup = b[:] # copy del b[:] # clear -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11284] slow close file descriptors in subprocess, popen2, os.popen*
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +loewis stage: - patch review title: slow close file descriptors in subprocess, popen2, os.pepen* - slow close file descriptors in subprocess, popen2, os.popen* versions: -Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11284 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11245] Implementation of IMAP IDLE in imaplib?
R. David Murray rdmur...@bitdance.com added the comment: I just wound up doing a bit of research on this for other reasons. Piers Lauder was the original author of the imaplib module, and he is (as far as I can tell) currently maintaining an imaplib2 module that does support IDLE (but not, I think, python3). But it does IDLE (and other things) via threads, and in the email I found announcing it he didn't think it was suitable for stdlib inclusion (because of the threading). Piers hasn't contributed to core in quite a while as far as I can tell, but he was active in a bug report back in 2008 according to google, so I thought I'd add him to nosy and see if he has time for an opinion. -- nosy: +eric.smith, pierslauder, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11245 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11283] incorrect pattern in the re module docs for conditional regex
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +pitrou stage: - patch review versions: -Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11283 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Georg Brandl ge...@python.org added the comment: No -- but the question is if copy() and clear() mightn't be added to the (mutable) sequence ABC if we make all builtin such sequences implement them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11282] 3.3 unittest document not kept consist with code
Terry J. Reedy tjre...@udel.edu added the comment: Georg, what is policy on removed features? Remove doc or leave and state removed? Deprecated in version 3.2 and removed in 3.3. or just Removed in version 3.3 (Once removed, does it really matter when deprecated?) If left, should they be moved to separate section, especially when multiple? It could be a bit annoying for newcomers starting with 3.3 to read and struggle to understand and then read that they just wasted their time. There enough things already to learn and remember. -- nosy: +georg.brandl, terry.reedy stage: - needs patch title: unittest document not keep consist with code - 3.3 unittest document not kept consist with code ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11282 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11282] 3.3 unittest document not kept consist with code
Michael Foord mich...@voidspace.org.uk added the comment: Actually I think these methods are going back in and staying deprecated, so hold off for a bit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11282 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11323] os.sendfile() bo failure on solaris
New submission from Giampaolo Rodola' g.rod...@gmail.com: http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.x/builds/2658/steps/test/logs/stdio Patch in attachment. -- files: sendfile-test.patch keywords: patch messages: 129411 nosy: giampaolo.rodola, loewis priority: normal severity: normal status: open title: os.sendfile() bo failure on solaris versions: Python 3.3 Added file: http://bugs.python.org/file20892/sendfile-test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11323 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11275] Linking to gcc's gomp causes crash later.
Terry J. Reedy tjre...@udel.edu added the comment: 2.6 is in security-fix only mode (though this might qualify as a security issue). Can you test with a current version (2.7.1, 3.2.0)? That said, most problems with extensions crashing are with the extension, though hard to determine sometimes. -- nosy: +terry.reedy stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11275 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11282] 3.3 unittest document not kept consist with code
Changes by Michael Foord mich...@voidspace.org.uk: -- assignee: docs@python - michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11282 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11282] 3.3 unittest document not kept consist with code
Georg Brandl ge...@python.org added the comment: Removed things are also removed from the doc. I just committed as much as was necessary to stop buildbot breakage, and notified Michael to take care of the rest (which he did, by explaining I removed the wrong thing :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11282 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11214] test_asyncore fails on AIX
Giampaolo Rodola' g.rod...@gmail.com added the comment: Fixed in r88604, r88605, r88606 -- resolution: - fixed status: open - closed versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11214 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Sergey says: I wanted to add that the fact that browsers encode the field names in the page encoding does not change that they should escape the header according to RFC 2047. I respond: True, but RFC 2047 is _so_ weird, that it seems that browsers have a better solution. RFC 2047 is needed for 7-bit mail servers, from which it seems to have been inherited by specs for HTTP (but I've never seen it used by a browser, have you?). It would be nicer if HTTP had a header that allowed definition of the charset used for subsequent headers. Right now, the code processing form data has to assume a particular encoding for headers data, and somehow make sure that all the forms that use the same code have the same encoding. Sergey says: I imagine there could be a non-ASCII field name that, when encoded in some encoding, will produce something SQL-injection-like: '; other=xx'. That string would make the header parse into something completely different. With IE8 and FF 3.6 it looks like it would be very simple. The same applies to uploaded files names too, so it's not just a matter of choosing sane field names. That's all a browsers' problem though. I respond: Perhaps there is, although it depends on how the parser is written what injection techniques would work, and it also depends on having a followon parameter with dangerous semantics to incorrectly act on. It isn't just a problem for the browsers, but for every CGI script that parses such parameters. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11269 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
Boštjan Mejak bostjan.me...@gmail.com added the comment: How awful! A little pointer to the tutorial where this is explained would be also quite smashing. -- Added file: http://bugs.python.org/file20893/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___How awful! A little pointer to the tutorial where this is explained would be also quite smashing. ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11290] ttk.Combobox['values'] String Conversion to Tcl
Terry J. Reedy tjre...@udel.edu added the comment: With 3.2, (Winxp) I get combobox with first line, input as r'C:\Python31\Lib\tkinter\test\test_ttk', displayed as C:Python31Lib kinter est est_ttk Something either deleted \ or converted \t to tab. Indeed, adding a space to the end of the string or enclosing as you specify inhibits deletion/conversion, so this seems like an error. With imports fixed from Tkinter import * import ttk the file runs fine in 2.7, so this seems 3.x specific problem. -- nosy: +gpolo, terry.reedy versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11290 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11114] TextIOWrapper.tell extremely slow
Antoine Pitrou pit...@free.fr added the comment: Committed in r88607 (3.3). -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11299] Allow deepcopying and pickling paused generators
Terry J. Reedy tjre...@udel.edu added the comment: Test cases always help when appropriate. A link to the Pypy code that does this might also help. Or perhaps ask them to submit a patch to this issue. -- nosy: +alexandre.vassalotti, pitrou, terry.reedy stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11299 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9795] nntplib.NNTP should support the context protocol
Giampaolo Rodola' g.rod...@gmail.com added the comment: Patch in attachment. -- keywords: +patch versions: +Python 3.3 -Python 3.2 Added file: http://bugs.python.org/file20894/nntplib-context-manager.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11324] ConfigParser(interpolation=None) doesn't work
New submission from Tobias Brink tobias.br...@gmail.com: The docs for Python 3.2 say that p = configparser.ConfigParser(interpolation=None) disables interpolation. Instead it gives this traceback when calling p.read(): Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.2/configparser.py, line 688, in read self._read(fp, filename) File /usr/lib/python3.2/configparser.py, line 1081, in _read self._join_multiline_values() File /usr/lib/python3.2/configparser.py, line 1091, in _join_multiline_values options[name] = self._interpolation.before_read(self, AttributeError: 'NoneType' object has no attribute 'before_read' The attached patch should fix it. -- components: Library (Lib) files: configparser_interpolation.patch keywords: patch messages: 129421 nosy: tbrink priority: normal severity: normal status: open title: ConfigParser(interpolation=None) doesn't work type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20895/configparser_interpolation.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11324 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11324] ConfigParser(interpolation=None) doesn't work
Changes by Brian Curtin cur...@acm.org: -- assignee: - lukasz.langa nosy: +lukasz.langa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11324 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11290] ttk.Combobox['values'] String Conversion to Tcl
Clayton Darwin claytondar...@gmail.com added the comment: This is a simple work around. def fix_tcl_error(s): if '\\' in s and not ' ' in s: s = '{'+s+'}' return s You can get the text from the Combobox with no issues. The error is in posting it to the Combobox when you have backslashes and no spaces (I think). I have just been running everything through this def before adding it. It has worked with no problems so far using Windows paths and grep-type search strings. CD -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11290 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1662581] the re module can perform poorly: O(2**n) versus O(n**2)
Terry J. Reedy tjre...@udel.edu added the comment: Another example from #11307 import re r = re.compile(r'(\w+)*=.*') r.match(abcdefghijklmnopqrstuvwxyz) -- nosy: +terry.reedy versions: +Python 3.3 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1662581 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11307] re engine exhaustively explores more than necessary
Terry J. Reedy tjre...@udel.edu added the comment: 13 secs on my 7 year old windows machine. -- nosy: +terry.reedy resolution: - duplicate status: open - closed superseder: - the re module can perform poorly: O(2**n) versus O(n**2) versions: +Python 2.7, Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11307 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11318] Python 3.2 FAQ example code typo?
Boštjan Mejak bostjan.me...@gmail.com added the comment: c.count also refers to C.count Where in the code is c.count? Please explain this for the sake of really closing this issue. -- Added file: http://bugs.python.org/file20896/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11318 ___quot;span class=Apple-style-span style=border-collapse: collapse; color: rgb(32, 32, 32); font-family: #39;Droid Sans#39;, arial, sans-serif; font-size: 13px; c.count also refers to C.countquot;  Where in the code is quot;c.countquot;? Please explain this for the sake of really closing this issue./span ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com