[issue6498] Py_Main() does not return on SystemExit
Mark Hammond skippy.hamm...@gmail.com added the comment: Note the quoted documentation in comment 1, the paragraph Note that if an otherwise unhandled SystemError ... I don't think that paragraph is correct - SystemError doesn't seem to terminate Py_Main - but if you replace SystemError with SystemExit, that paragraph is correct, including the comment about Py_InspectFlag. So I think there are 2 simple documentation bugs (the component of this bug is Documentation) and not necessarily a behaviour bug (even though the type is set to behaviour :) * The first paragraph should have references to sys.exit() removed (I didn't mention this in my previous comment!) * The second paragraph should s/SystemError/SystemExit/ and optionally a note that calling sys.exit() will result in a SystemExit exception. I just traced through this in Python 2.6 - PyRun_InteractiveOneFlags winds up calling PyErr_PrintEx() and this function explicitly checks for SystemExit and calls handle_system_exit, which calls exit(). There doesn't seem to be any special handling for SystemError at all. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Jan Kaliszewski z...@chopin.edu.pl added the comment: Thank you. Raymond is against the idea so I don't know if it makes sense to create the real patch for now (it would patch the collections module and, I suppose, addming tests, docs etc.). Anyway, if somebody would be interested in the idea, the newest version of the draft is here: http://dpaste.org/qyKv/. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11699] Documentation for get_option_group is wrong
New submission from Weeble clockworksa...@gmail.com: The docs for optparse say this: OptionParser.get_option_group(opt_str) Return, if defined, the OptionGroup that has the title or the long description equals to opt_str After failing to get this to work at all, I looked at the implementation, and the documentation is completely wrong. The method takes an option string, like '-o' or '--option' and returns the option group that it belongs to. Personally, I would much prefer the function to do what the documentation describes, i.e. find the option group with the given name, but I guess it's far too late for that. The scenario I'm in is that I'm writing a plugin for an existing tool which provides access to its OptionParser to add new options, but doesn't provide references to any of the groups that are already created. It looks like this documentation was added recently: http://bugs.python.org/issue1665333 -- messages: 132385 nosy: weeble priority: normal severity: normal status: open title: Documentation for get_option_group is wrong ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11699 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665333] Documentation missing for OptionGroup class in optparse
Weeble clockworksa...@gmail.com added the comment: I think the documentation for get_option_group is not right. I've created a new bug: http://bugs.python.org/issue11699 -- nosy: +weeble ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1665333 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11699] Documentation for get_option_group is wrong
Changes by Sandro Tosi sandro.t...@gmail.com: -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11699 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11693] memory leak in email.generator.Generator().flatten() method
New submission from Kaushik Kannan kaushik1...@gmail.com: I wrote a daemon to monitor a directory and send out emails periodically. To create the email, I used MIMEMultipart() object. When as_string() method is called on the MIMEMultipart() object, it seemed to cause memory leaks. On looking at the as_string() method, I saw that the email.generator.Generator().flatten() method call is causing the memory leak. I copied the as_string() method out as a function and used it for tracing the memory leak. #!/usr/bin/python from guppy import hpy import time import gc from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from cStringIO import StringIO from email.generator import Generator def as_string_mod(msg, unixfrom=False): Return the entire formatted message as a string. Optional `unixfrom' when True, means include the Unix From_ envelope header. This is a convenience method and may not generate the message exactly as you intend because by default it mangles lines that begin with From . For more flexibility, use the flatten() method of a Generator instance. fp = StringIO() g = Generator(fp) g.flatten(msg, unixfrom=unixfrom) return fp.getvalue() msg = MIMEMultipart() msg['From'] = 'f...@gmail.com' msg['To'] = 't...@gmail.com' msg['Subject'] = 'Function' msg.attach(MIMEText('Blah')) if __name__=='__main__': while True: as_string_mod(msg) gc.collect() print hpy().heap() time.sleep(5) -- nosy: +kauboy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11693 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11693] memory leak in email.generator.Generator().flatten() method
Kaushik Kannan kaushik1...@gmail.com added the comment: The memory usage trace as printed out by guppy is attached. For every new call of the Generator.flatten() method by the MIMEMultipart.as_string() method, the number of objects increases by 3 and the total size increases by 484Bytes. -- Added file: http://bugs.python.org/file21435/MemLeak.log ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11693 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1690608] email.utils.formataddr() should be rfc2047 aware
Torsten Becker torsten.bec...@gmail.com added the comment: I incorporated that change as well. My rationale behind the previous version was to be consistent with how Lib/email/header.py handled this, unfortunately I did not look around in the other classes and didn't think about that kind of compatibility. When formataddr() is called with a object which is not a string and which does not have a header_encode it will raise the following exception now: AttributeError: 'CharsetMock' object has no attribute 'header_encode' Thank you for your patience, sorry that it took probably more of your time by taking 4 iterations for this patch than if you had just implemented it yourself. -- Added file: http://bugs.python.org/file21436/issue-1690608-v4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1690608 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1690608] email.utils.formataddr() should be rfc2047 aware
R. David Murray rdmur...@bitdance.com added the comment: Ah, yes. Header is probably wrong there, I should fix that at some point. Sorry for the misytpes in my last message (it was late at night for me when I wrote it :) As for time, it probably didn't take any more time than it would have to write it myself, and the end product is almost certainly better for having had two sets of eyes on it. This kind of back and forth often happens even when it is an experienced developer writing the patch. But even if neither of those were true it would be worthwhile to do it in order to support you in learning to contribute. Thanks again for working on this, and I'll probably commit it some time today. -- stage: test needed - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1690608 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1690608] email.utils.formataddr() should be rfc2047 aware
Changes by R. David Murray rdmur...@bitdance.com: -- versions: -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1690608 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10617] Collections ABCs can’t be linked to
Roundup Robot devnull@devnull added the comment: New changeset cc04b591d768 by Ezio Melotti in branch '2.7': #10617: add class directives to collections ABCs. http://hg.python.org/cpython/rev/cc04b591d768 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10617 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6087] distutils.sysconfig.get_python_lib gives surprising result when used with a Python build
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Attached is a simple script to show include and lib paths. The makefile location seems OK on my system. -- Added file: http://bugs.python.org/file21437/libdir.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6087 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11671] Security hole in wsgiref.headers.Headers
Felix Gröbert groeb...@google.com added the comment: If the spec forbids control characters in headers, the module should enforce that. The most frequent example of header injection is the redirect-case: an application is forwarding using the Location header to a user-supplied URL. http://google.com/codesearch?as_q=self.redirect%5C%28self.request.get Other examples are proxies, setting user-agent, or, as you mention, custom set-cookies headers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11671 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11678] Add support for Arch Linux to platform.linux_distributions()
Marc-Andre Lemburg m...@egenix.com added the comment: Westley Martínez wrote: Westley Martínez aniko...@gmail.com added the comment: I forgot to say, Arch Linux is rolling release so it doesn't have a version or id. Ok, but then what's the output of the function on Arch Linux (with the patch) ? -- title: Add support for Arch Linux to platform.linux_distributions() - Add support for Arch Linux toplatform.linux_distributions() ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11678 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11700] mailbox.py proxy updates
New submission from Steffen Daode Nurpmeso sdao...@googlemail.com: I'll send a patch that updates/fixes handling of file closes in the internal proxy-file classes. It could cause errors yet because self._file is del-eted but that field may still be used afterwards. mb = mailbox.Maildir('sdaoden', create=False) mbf = mb.get_file(mb.keys()[0]) msg = email.parser.BytesParser().parse(mbf, headersonly=True) mbf.close() Traceback (most recent call last): File stdin, line 1, in module File /Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py, line 1922, in close if hasattr(self._file, 'close'): AttributeError: '_ProxyFile' object has no attribute '_file' The patched version will always act correctly. And yes, i'll open yet another issue due to the email.parser (or even TextIOWrapper) based problem. -- components: Library (Lib) messages: 132395 nosy: georg.brandl, r.david.murray, sdaoden, twouters priority: normal severity: normal status: open title: mailbox.py proxy updates versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11700 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11700] mailbox.py proxy updates
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Here's the patch. -- keywords: +patch Added file: http://bugs.python.org/file21438/11700.1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11700 ___diff --git a/Lib/mailbox.py b/Lib/mailbox.py --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -382,7 +382,7 @@ def get_file(self, key): Return a file-like representation or raise a KeyError. f = open(os.path.join(self._path, self._lookup(key)), 'rb') -return _ProxyFile(f) +return _ProxyFile(f, close=True) def iterkeys(self): Return an iterator over keys. @@ -1032,7 +1032,7 @@ raise KeyError('No message with key: %s' % key) else: raise -return _ProxyFile(f) +return _ProxyFile(f, close=True) def iterkeys(self): Return an iterator over keys. @@ -1867,13 +1867,15 @@ class _ProxyFile: A read-only wrapper of a file. -def __init__(self, f, pos=None): +def __init__(self, f, pos=None, close=False): Initialize a _ProxyFile. self._file = f if pos is None: self._pos = f.tell() else: self._pos = pos +self._do_close = close +self._is_open = True def read(self, size=None): Read bytes. @@ -1919,9 +1921,11 @@ def close(self): Close the file. -if hasattr(self._file, 'close'): +if self._do_close: +self._do_close = False self._file.close() -del self._file +del self._file +self._is_open = False def _read(self, size, read_method): Read size bytes using read_method. @@ -1953,7 +1957,7 @@ @property def closed(self): -return self._file.closed +return not self._is_open class _PartialFile(_ProxyFile): @@ -1988,11 +1992,6 @@ size = remaining return _ProxyFile._read(self, size, read_method) -def close(self): -# do *not* close the underlying file object for partial files, -# since it's global to the mailbox object -del self._file - def _lock_file(f, dotlock=True): Lock file f using lockf and dot locking. ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11701] email.parser.BytesParser() uses TextIOWrapper
New submission from Steffen Daode Nurpmeso sdao...@googlemail.com: ... and that closes the original file, too! (I've also opened #11700 due to the mailbox.py side of this.) static PyObject * textiowrapper_close(textio *self, PyObject *args) return PyObject_CallMethod(self-buffer, close, NULL); mb = mailbox.Maildir('sdaoden', create=False) mbf = mb.get_file(mb.keys()[0]) msg = email.parser.BytesParser().parse(mbf, headersonly=True) mbf.close() Traceback (most recent call last): File stdin, line 1, in module File /Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py, line 1922, in close if hasattr(self._file, 'close'): AttributeError: '_ProxyFile' object has no attribute '_file' -- components: Library (Lib) messages: 132397 nosy: r.david.murray, sdaoden priority: normal severity: normal status: open title: email.parser.BytesParser() uses TextIOWrapper versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11701 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11650] Faulty RESTART/EINTR handling in Parser/myreadline.c
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: \|/ _ . | = Yes!? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11650 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Eric Frederich eric.freder...@gmail.com added the comment: So there is a disconnect. You can either change the documentation to match the behavior or you can change the code to match the documentation. I would prefer to leave the documentation alone and make Py_Main return rather than exit on sys.exit. That's just my 2 cents. -- nosy: +eric.frederich ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag
Changes by knickerkicker knicker.kic...@gmail.com: -- nosy: +knicker.kicker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6085 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag
Changes by Charles-Francois Natali neolo...@free.fr: Removed file: http://bugs.python.org/file17081/base_http_server_fqdn_lag.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6085 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improving property to accept abstract methods
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1673007] urllib2 requests history + HEAD support
Changes by Brian Curtin br...@python.org: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1673007 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8150] urllib needs ability to set METHOD for HTTP requests
Brian Curtin br...@python.org added the comment: Closing as duplicate. #1673007 tackles the same issues and has a few patches available. -- nosy: +brian.curtin resolution: - duplicate stage: test needed - committed/rejected status: open - closed superseder: - urllib2 requests history + HEAD support ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8150 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11647] function decorated with a context manager can only be invoked once
ysj.ray ysj@gmail.com added the comment: Now I found that I am wrong and I feel OK with make the context manager reusable when used as a decorator. I missed one thing: the reusable behavior is regarded as in the decorated function but not in the decorator context manager. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11702] dir on return value of msilib.OpenDatabase() crashes python
New submission from Mark Mc Mahon mtnbikingm...@gmail.com: Running the following code: import msilib db = msilib.OpenDatabase('c:/windows/installer/1c7a1.msi', 1) db _msi.Database object at 0x01E230A0 dir(db) (Python crashes - tested on current Trunk and Python 2.7.1). I tried tracking it through the C code - and it seems to be a problem when dir is checking for __dir__ (the pointer in PyObject_GetAttrString seems to be incorrect). -- components: Windows messages: 132402 nosy: markm priority: normal severity: normal status: open title: dir on return value of msilib.OpenDatabase() crashes python type: crash versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11702 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11699] Documentation for get_option_group is wrong
Changes by Éric Araujo mer...@netwok.org: -- assignee: - docs@python components: +Documentation nosy: +docs@python, eric.araujo, georg.brandl, lunar_yorn, nnorwitz versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11699 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9181] Solaris extension building does not work with 64 bit python
Charles Solar charlesso...@gmail.com added the comment: Hello again, I got a copy of the latest python from the 2.7 branch, recompiled with CFLAGS=-m64 -O3 and LDFLAGS=-m64 and my extension compiled just fine. So I can verify this bug fixed -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9181] Solaris extension building does not work with 64 bit python
Antoine Pitrou pit...@free.fr added the comment: Thanks for checking. Closing as fixed. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()
Changes by Filip Gruszczyński grusz...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9544 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11662] Redirect vulnerability in urllib/urllib2
Henri Salo he...@nerv.fi added the comment: CVE-2011-1521 has been assigned to this issue. -- nosy: +Henri.Salo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10617] Collections ABCs can’t be linked to
Roundup Robot devnull@devnull added the comment: New changeset c5de208d205c by Ezio Melotti in branch '3.1': #10617: add class directives to collections ABCs. http://hg.python.org/cpython/rev/c5de208d205c New changeset 3daca2b76297 by Ezio Melotti in branch '3.2': #10617: merge with 3.1. http://hg.python.org/cpython/rev/3daca2b76297 New changeset 30a026a25167 by Ezio Melotti in branch 'default': #10617: merge with 3.2. http://hg.python.org/cpython/rev/30a026a25167 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10617 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10617] Collections ABCs can’t be linked to
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10617 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Rogi r...@linuxmail.org added the comment: Sorry, some years have passed since I posted this. I will take a look on teh code again. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11693] memory leak in email.generator.Generator().flatten() method
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I replaced guppy by a debug build of Python and a simple print sys.gettotalrefcount(). Indeed, I see a reference leak with Python2.6 (10 more references on every loop). There seems to be no leak with Python2.7. Which version of Python do you use? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11693 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11397] os.path.realpath() may produce incorrect results
Santoso Wijaya santoso.wij...@gmail.com added the comment: Attaching patches against 3.1 and 3.2 (due to unicode and slightly different unittest layout). -- Added file: http://bugs.python.org/file21439/issue11397_py31.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11397 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11397] os.path.realpath() may produce incorrect results
Changes by Santoso Wijaya santoso.wij...@gmail.com: Added file: http://bugs.python.org/file21440/issue11397_py32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11397 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1571878] Improvements to socket module exceptions
Changes by Sandro Tosi sandro.t...@gmail.com: -- nosy: +sandro.tosi versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1571878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1571878] Improvements to socket module exceptions
Changes by Sandro Tosi sandro.t...@gmail.com: -- keywords: -patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1571878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Changes by Sridhar Ratnakumar sridh...@activestate.com: -- nosy: -srid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10632] multiprocessing generates a fatal error
Sandro Tosi sandro.t...@gmail.com added the comment: Hi Brian, are you able to replicate it? I just build 3.2 and default (3.3) on a Debian unstable system and wasn't able to replicate it (with a busy loop like while date ; do ./python -c import multiprocessing.managers ; mpp = multiprocessing.Pool(4); sm = multiprocessing.managers.SyncManager(); sm.start() ; done ) -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10632 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improving property to accept abstract methods
Ned Deily n...@acm.org added the comment: (Darren, I'm not sure why you are running into problems with that setup. I test with what sounds to be a very similar one including a MacPorts gettext port providing libintl although I do install ports as +universal (i386, x86_64) by default. And I don't know why you would have problems with _scproxy. If you would like to pursue, please open a separate issue with the results of your configure and make.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10617] Collections ABCs can’t be linked to
Éric Araujo mer...@netwok.org added the comment: Thanks Ezio. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10617 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5340] Change in cgi behavior breaks existing software
Changes by Éric Araujo mer...@netwok.org: -- versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11702] dir on return value of msilib.OpenDatabase() crashes python
Changes by Éric Araujo mer...@netwok.org: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11702 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Rogi r...@linuxmail.org added the comment: I reviewed teh problem and rewrote teh text to better explain what is happening. Also, I noticed teh change to teh docs, and in fact it is not correct that teh functions call exit() on SystemError. *** From teh docs: http://docs.python.org/c-api/veryhigh.html int Py_Main(int argc, char **argv)¶ The main program for the standard interpreter. This is made available for programs which embed Python. The argc and argv parameters should be prepared exactly as those which are passed to a C program¿s main() function. It is important to note that the argument list may be modified (but the contents of the strings pointed to by the argument list are not). The return value will be the integer passed to the sys.exit() function, 1 if the interpreter exits due to an exception, or 2 if the parameter list does not represent a valid Python command line. Note that if an otherwise unhandled SystemError is raised, this function will not return 1, but exit the process, as long as Py_InspectFlag is not set. *** Teh problem: Teh Py_Main() function does not return on any unhandled exception. If a unhandled exception is caught, teh function prints teh error and go to teh prompt. Try: ... raise(SystemError) Traceback (most recent call last): File stdin, line 1, in module SystemError Consequently, Py_Main() does not return on unhandled SystemExit. But not only that. It calls exit() which terminate teh process. Try: ... Py_Main(argc, argv); fprintf(stderr, reached!); ... ... raise(SystemExit) $ note it did not print after Py_Main() termination. *** Analysis: After greping python source, I found that this behaviour is triggered in function PyErr_PrintEx(). For some reason, SystemExit is handled here, in a function that, from its name, should print, not handle, and its handling involves a call to exit(), which terminate teh teh process. Also, not only Py_Main() is affected by this, but any other function that calls PyErr_PrintEx(), such as PyRun_SimpleString(). I tried to fix this but it would require some rewriting. I think this could be accomplished with some set/longjmp, but still some rewriting would be needed to fix other functions that rely on PyErr_PrintEx() behaviour. *** Possible solutions: * fix teh source to match teh docs * fix teh docs to match teh source *** Proposed solution: Teh current behaviour hit me when I was writing an app which had Py_Main() running on a thread. If teh user typed exit() in Python, teh program would crash from exiting on a bad place. Based on this I propose a review of teh source that adhere to teh following: 1 - PyErr_PrintEx() should not be handling any kind of exception. This should be done by a function liek PyErr_HandleException(). 2 - In functions liek PyRun_SimpleString(), teh default exception handling should only occur after giving teh programmer a chance to handle and clear teh exception himself. 3 - No calls to exit() should be made by teh Python interpreter, except, maybe, in some function which is a explicit wrapper. Since proposing is easy and doing is not, It would be nice to have, for now, a warning at teh docs for every bad behaving function, specially those which call exit(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10740] sqlite3 module should allow DDL statements in transactions
dholth dho...@fastmail.fm added the comment: Torsten basically you are suggesting that PRAGMA would never work at all with my 'do not strcmp() the sql at all, always begin a transaction' approach? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10740 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5872] New C API for declaring Python types
Martin v. Löwis mar...@v.loewis.de added the comment: With PEP 384, this is now obsolete, so closing it as such. If you think that selected features of this patch should still be added, please submit them as separate patches. -- nosy: +loewis resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11676] imp.load_module and submodules - doc issue, or bug?
Brett Cannon br...@python.org added the comment: I say it's a documentation bug. -- assignee: - docs@python components: +Documentation -Interpreter Core, Library (Lib) nosy: +brett.cannon, docs@python stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7796] No way to find out if an object is an instance of a namedtuple
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11697] Unsigned type in mmap_move_method
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Did you see a compiler warning? Indeed, this function (mmap.move) decodes its arguments with: PyArg_ParseTuple(args, kkk:move, dest, src, cnt) This looks wrong to me: these three numbers should be Py_ssize_t, and decoded with nnn. An example of wrong behavior (on win32): m = mmap.mmap(-1, 500) m.move(2**32, 10, 4) # Should throw a ValueError -- nosy: +amaury.forgeotdarc stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11697 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11697] Unsigned type in mmap_move_method
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11697 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10632] multiprocessing generates a fatal error
Brian Quinlan br...@sweetapp.com added the comment: No, I wasn't able to replicate. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10632 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11662] Redirect vulnerability in urllib/urllib2
Changes by Guido van Rossum gu...@python.org: Added file: http://bugs.python.org/file21441/9d06d5eb1a7e.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11662] Redirect vulnerability in urllib/urllib2
Guido van Rossum gu...@python.org added the comment: Aha. I now see the point of raising an exception instead of just returning None. I have backported Senthil's patch to the 2.5 branch. Please review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11662] Redirect vulnerability in urllib/urllib2
Changes by Guido van Rossum gu...@python.org: Added file: http://bugs.python.org/file21442/f03e2acb9826.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11662] Redirect vulnerability in urllib/urllib2
Changes by Guido van Rossum gu...@python.org: Removed file: http://bugs.python.org/file21441/9d06d5eb1a7e.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11662 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11653] Problems with some tests using -j2
Ned Deily n...@acm.org added the comment: Antoine is correct in principle, however LD_LIBRARY_PATH does not work on OS X. To test without installing, you would need to use DYLD_LIBRARY_PATH instead. Also keep in mind that, unlike most other systems, OS X binaries embed absolute paths to dynamic libraries. As a learning exercise for myself, I constructed this example. I added a printf to the errno module, a module that is included in the shared library, to help see what's happening: $ cd /tmp/a/py3k $ ./configure --prefix=/tmp/a/local --enable-shared LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include make $ file ./libpython3.3m.dylib ./libpython3.3m.dylib: Mach-O 64-bit dynamically linked shared library x86_64 $ otool -L ./python ./python: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.42.0) /tmp/a/local/lib/libpython3.3m.dylib (compatibility version 3.3.0, current version 3.3.0) [...] # note, make install not yet run so lib not available in configured path $ ls /tmp/a/local/lib/libpython3.3m.dylib ls: /tmp/a/local/lib/libpython3.3m.dylib: No such file or directory $ ./python -c 'pass' dyld: Library not loaded: /tmp/a/local/lib/libpython3.3m.dylib Referenced from: /private/tmp/a/py3k/./python Reason: image not found Trace/BPT trap # override path so that uninstalled shared lib is found in build dir $ DYLD_LIBRARY_PATH=. ./python -c 'pass' errno module version 0 $ make install $ ls /tmp/a/local/lib/libpython3.3m.dylib /tmp/a/local/lib/libpython3.3m.dylib* # now lib is installed and found $ ./python -c 'pass' errno module version 0 # edit message in errno module to version 1 $ make # have not done a new install so old shared lib is found $ ./python -c 'pass' errno module version 0 # enable dynamic loader printing of loads $ export DYLD_PRINT_LIBRARIES=1 $ ./python -c 'pass' dyld: loaded: /private/tmp/a/py3k/./python dyld: loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation dyld: loaded: /tmp/a/local/lib/libpython3.3m.dylib [...] errno module version 0 # override loads from build directory - works correctly $ DYLD_LIBRARY_PATH=. ./python -c 'pass' dyld: loaded: /private/tmp/a/py3k/./python dyld: loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation dyld: loaded: /private/tmp/a/py3k/libpython3.3m.dylib errno module version 1 # install updated lib $ make install # also works correctly $ ./python -c 'pass' dyld: loaded: /private/tmp/a/py3k/./python dyld: loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation dyld: loaded: /tmp/a/local/lib/libpython3.3m.dylib [...] errno module version 1 So the moral of the story is: if you use --enable-shared, you need to be careful to either make install or to use DYLD_LIBRARY_PATH=/path/to/build_directory. Skip, are you OK with closing this issue? -- resolution: - works for me stage: - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11653 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11416] netrc module does not handle multiple entries for a single host
Jean-Marc Saffroy saff...@gmail.com added the comment: So I finally cooked a little patch for netrc.py in python 2.6. The patch extends netrc.authenticators() with an extra parameter to select a login name, but otherwise the behaviour remains the same (still returns the last entry for a given host). Lightly tested, works for me. -- keywords: +patch Added file: http://bugs.python.org/file21443/netrc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11416 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11416] netrc module does not handle multiple entries for a single host
Brian Curtin br...@python.org added the comment: Can you add your tests to Lib/test/test_netrc.py? -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11416 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11703] Bug in python = 2.7 with urllib2 fragment
New submission from Ivan Ivanenko ivan.ivane...@gmail.com: result = urllib.urlopen(http://docs.python.org/library/urllib.html#OK;) print result.geturl() result = urllib2.urlopen(http://docs.python.org/library/urllib.html#OK;) print result.geturl() Python 2.6 returns: http://docs.python.org/library/urllib.html#OK; http://docs.python.org/library/urllib.html#OK; Python 2.7 returns: http://docs.python.org/library/urllib.html#OK; http://docs.python.org/library/urllib.html; 2to3 -w test.py Python 3 returns: http://docs.python.org/library/urllib.html; http://docs.python.org/library/urllib.html; I expect geturl() result with #OK in all cases -- components: Library (Lib) messages: 132423 nosy: Ivan.Ivanenko priority: normal severity: normal status: open title: Bug in python = 2.7 with urllib2 fragment type: behavior versions: Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1294959] Problems with /usr/lib64 builds.
Barry A. Warsaw ba...@python.org added the comment: Please note another aspect of this problem will bite all Python developers on Ubuntu 11.04. With the introduction of multiarch, not all stdlib Python extension modules can be built out of the box, as seen here: https://bugs.launchpad.net/ubuntu/+source/db4.8/+bug/738213/comments/13 Ubuntu's source package was hacked to make things work, by calling out to dpkg-architecture and adding the resulting directories to library_dirs and include_dirs search paths. That patch would obviously have to be modified at the very least to be robust on non-Debian/Ubuntu platforms. I'm not sure what the right solution is for upstream. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1294959 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11704] functools.partial doesn't create bound methods
New submission from Alex Gaynor alex.gay...@gmail.com: This is related to the discussion we had at the PyCon language summit about C vs Python function binding. If you create a partial instance and put it on a class it doesn't create bound instances. This behavior is a tad surprising in my view. At a minimum it'd be nice if the docs mentioned this. -- messages: 132425 nosy: alex priority: normal severity: normal status: open title: functools.partial doesn't create bound methods versions: Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11685] possible SQL injection into db APIs via table names... sqlite3
Martin v. Löwis mar...@v.loewis.de added the comment: Aren’t you supposed to use the DB API to get safe queries? http://docs.python.org/dev/library/sqlite3 Yes, but the OP complains that the DB API doesn't support specification of the table name from a parameter. So the DB API won't help here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11685 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11700] mailbox.py proxy updates
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: mbf.close() should not fail when called twice. The close() method in the io module states that This method has no effect if the file is already closed. But then, is close=False necessary? -- nosy: +amaury.forgeotdarc stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11700 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10517] test_concurrent_futures crashes with --with-pydebug on RHEL5 with Fatal Python error: Invalid thread state for this thread
Sandro Tosi sandro.t...@gmail.com added the comment: Is someone still able to replicate this crash? I'm not, with a fresh built 3.2 and default (3.3), --with-pydebug enabled. Brian confirmed on msg132418 that he can't any longer replicate it. -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10517 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10632] multiprocessing generates a fatal error
Sandro Tosi sandro.t...@gmail.com added the comment: can we close this issue then? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10632 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Mark Hammond skippy.hamm...@gmail.com added the comment: @Rogi - you seem to have a problem with your keyboard - the 'h' and 'e' keys seem to have been swapped. The docs are wrong regardless - I don't think anyone would suggest the behaviour match the docs regarding SystemError - having Py_Main return on SystemError would be backwards incompatible. Given the discussion in those docs about SystemError, I'm confident that the person who wrote the docs was simply attempting to document the actual implementation and made an error. The implementation has, as far as I know, always worked the way it does (ie, there has never been a regression in this). So IMO there are 2 issues: * The documentation should be made to reflect the actual and historic behaviour. The fact it doesn't is a clear bug and it should be addressed ASAP and without changing the behaviour so people are not misled in the future. This change should be easy and non-controversial. * You may have a desire to change the actual and historic implementation, which I can understand. However, this should be tackled in a new feature request. If the feature request is accepted, then both the behaviour and the docs should be changed to match the new agreed behaviour. This change would be harder and may well be controversial, depending on a perception on how many people rely on the current behaviour regardless of what the docs say. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11667] 'configure' script overrides users setting of CFLAGS
David Kirkby david.kir...@onetel.net added the comment: Yes, I think this could do with being documented, as it is not obvious. Generally one would expect CFLAGS to do this, and not OPT. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11667 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8624] Aliasing warnings in multiprocessing.c
Sandro Tosi sandro.t...@gmail.com added the comment: This was fixed in f8fc2d03d7e4 by Benjamin Peterson. -- nosy: +sandro.tosi resolution: - out of date stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8624 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9067] Use macros from pyctype.h
Sandro Tosi sandro.t...@gmail.com added the comment: Hi Stefan, can you please expand a bit this issue and details the places you think can benefit from pyctype macros? you know, a patch would be the best :) -- nosy: +sandro.tosi versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11416] netrc module does not handle multiple entries for a single host
Jean-Marc Saffroy saff...@gmail.com added the comment: Good that you mentioned the official tests, they let me see that netrc.hosts is actually part of the API, and my first patch broke it. Here is an updated patch, with extra tests. -- Added file: http://bugs.python.org/file21444/netrc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11416 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11704] functools.partial doesn't create bound methods
Nick Coghlan ncogh...@gmail.com added the comment: True, this could be documented better - flagging as a docs bug. (It is mentioned at the bottom of http://docs.python.org/library/functools.html#partial-objects, but that could be referenced better from the main documentation of the function higher up in the page) There's actually more to it than just an oversight though - partial() fills in positional arguments from the left, so using one as a method would require specification of a carefully crafted selection of positional and keyword arguments to ensure the instance was bound and passed in at the right point. -- assignee: - docs@python components: +Documentation nosy: +docs@python, ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11702] dir on return value of msilib.OpenDatabase() crashes python
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: A call to PyType_Ready() fixes the issue, see attached patch. I added a test that opens a random file in c:\windows\installer, I don't know if this is correct for all Windows version. -- keywords: +patch nosy: +amaury.forgeotdarc stage: - patch review Added file: http://bugs.python.org/file21445/msi_opendatabase.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11702 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11705] sys.excepthook doesn't work in imported modules
New submission from Elias Zamaria mikez...@gmail.com: I am trying to design a Python program that logs all uncaught exceptions using the logging module. I am doing this by using the sys.excepthook function to override the default exception handling. I noticed that if I run the program directly from the command line, it works fine, but if I try to import the file, it doesn't work. It seems like the sys.excepthook function is unaware of the logging module. Here is an example: #! /usr/bin/env python2.7 import logging, sys logger = logging.getLogger() logger.setLevel(logging.DEBUG) logger.addHandler(logging.FileHandler(test.log)) print outside of exception handler: logger = %s % logger def handleException(excType, excValue, traceback): #global logger # this function doesn't work whether or not I include this line print inside exception handler: logger = %s % logger logger.error(Uncaught exception, exc_info=(excType, excValue, traceback)) sys.excepthook = handleException logger.debug(starting) asdf# create an exception If I run this from the command line (`./loggingTest.py`), it works fine. The exception gets logged, and I see this output: outside of exception handler: logger = logging.RootLogger object at 0x7f2022eab950 inside exception handler: logger = logging.RootLogger object at 0x7f2022eab950 However, if I run the Python interpreter and try to import the file (`import loggingTest`), it acts strangely. The exception doesn't get logged and I see this: outside of exception handler: logger = logging.RootLogger object at 0x7f8ab04f3ad0 inside exception handler: logger = None Error in sys.excepthook: Traceback (most recent call last): File loggingTest.py, line 13, in handleException logger.error(Uncaught exception, exc_info=(excType, excValue, traceback)) AttributeError: 'NoneType' object has no attribute 'error' Original exception was: Traceback (most recent call last): File stdin, line 1, in module File loggingTest.py, line 18, in module asdf# create an exception NameError: name 'asdf' is not defined I can maybe work around this problem by importing the logging module again within sys.excepthook, but I am still curious: why is this happening? The above text was copied from my question on Stack Overflow (http://stackoverflow.com/questions/5451746/sys-excepthook-doesnt-work-in-imported-modules). Someone on there (Jochen Ritzel) has mentioned that he noticed this bug in Python 2.7.1 but not 2.7. To me, it seems like the sys.excepthook function is unaware of any imported modules, unless those modules are imported from inside the function. -- components: Library (Lib) files: loggingTest.py messages: 132437 nosy: mikez302 priority: normal severity: normal status: open title: sys.excepthook doesn't work in imported modules type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file21446/loggingTest.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11704] functools.partial doesn't create bound methods
Alex Gaynor alex.gay...@gmail.com added the comment: Indeed I completely missed the section at the bottom. A note in the above section would be a useful addition. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11256] inspect.getcallargs raises TypeError on valid arguments
Roundup Robot devnull@devnull added the comment: New changeset 57e99f5f5e8f by Benjamin Peterson in branch '3.2': Correct handling of functions with only kwarg args in getcallargs (closes #11256) http://hg.python.org/cpython/rev/57e99f5f5e8f New changeset b19d76d9d2a7 by Benjamin Peterson in branch '2.7': Correct handling of functions with only kwarg args in getcallargs (closes #11256) http://hg.python.org/cpython/rev/b19d76d9d2a7 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11256 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11706] Build from hg fails with ancient hg version (0.9.3)
New submission from Dave Malcolm dmalc...@redhat.com: With hg/mercurial 0.9.3, the build of CPython fails with this error: gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes-I. -IInclude -I./Include-DPy_BUILD_CORE \ -DHGVERSION=\`LC_ALL=C hg id -i .`\ \ -DHGTAG=\`LC_ALL=C hg id -t .`\ \ -DHGBRANCH=\`LC_ALL=C hg id -b .`\ \ -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c hg identify: option -i not recognized hg identify: option -t not recognized hg identify: option -b not recognized ./Modules/getbuildinfo.c: In function ‘Py_GetBuildInfo’: ./Modules/getbuildinfo.c:37: error: missing terminating character ./Modules/getbuildinfo.c:37: error: expected expression before ‘)’ token ./Modules/getbuildinfo.c:38: error: missing terminating character ./Modules/getbuildinfo.c:38: error: missing terminating character ./Modules/getbuildinfo.c:39: error: missing terminating character ./Modules/getbuildinfo.c:39: error: missing terminating character ./Modules/getbuildinfo.c:45: error: ‘buildinfo’ undeclared (first use in this function) ./Modules/getbuildinfo.c:45: error: (Each undeclared identifier is reported only once ./Modules/getbuildinfo.c:45: error: for each function it appears in.) ./Modules/getbuildinfo.c:49: warning: control reaches end of non-void function ./Modules/getbuildinfo.c: In function ‘_Py_hgversion’: ./Modules/getbuildinfo.c:54: error: missing terminating character ./Modules/getbuildinfo.c:54: warning: ‘return’ with no value, in function returning non-void ./Modules/getbuildinfo.c: In function ‘_Py_hgidentifier’: ./Modules/getbuildinfo.c:61: error: missing terminating character ./Modules/getbuildinfo.c:61: error: expected expression before ‘;’ token ./Modules/getbuildinfo.c:65: error: missing terminating character ./Modules/getbuildinfo.c:65: error: expected expression before ‘;’ token make: *** [Modules/getbuildinfo.o] Error 1 What's happening is that hg id doesn't recognize the given options, and thus the various HG macros get set to insane multi-line strings containing usage information, but without quote characters, rather than to empty string literals [1]. This means that the post-processed code isn't valid C. The workaround presumably is to upgrade to a more recent version of mercurial. I'm reporting this here in the bug tracker in case anyone else runs into this problem. [1] Adding -v to the gcc invocation demonstrates that the values being passed are: -DHGVERSION=hg identify print information about the working copy Print a short summary of the current state of the repo. This summary identifies the repository state using one or two parent hash identifiers, followed by a + if there are uncommitted changes in the working directory, followed by a list of tags for this revision. aliases: id -DHGTAG=hg identify print information about the working copy Print a short summary of the current state of the repo. This summary identifies the repository state using one or two parent hash identifiers, followed by a + if there are uncommitted changes in the working directory, followed by a list of tags for this revision. aliases: id -DHGBRANCH=hg identify print information about the working copy Print a short summary of the current state of the repo. This summary identifies the repository state using one or two parent hash identifiers, followed by a + if there are uncommitted changes in the working directory, followed by a list of tags for this revision. aliases: id -- components: Build messages: 132440 nosy: dmalcolm priority: low severity: normal status: open title: Build from hg fails with ancient hg version (0.9.3) type: compile error versions: Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11706 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11109] socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass
Justin justin.warken...@gmail.com added the comment: Just following up on this. Now that 3.2 is out, has the patch been committed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11109 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11706] Build from hg fails in Modules/getbuildinfo.c when built using ancient hg version (0.9.3)
Dave Malcolm dmalc...@redhat.com added the comment: Works OK with mercurial 1.3.1 (specifically, this is on a RHEL5 box, using mercurial-1.3.1-3.el5.i386.rpm from EPEL5) Closing this out, and changing title to help people searching for this. Not sure of the exact version of mercurial that's required. -- resolution: - works for me stage: - committed/rejected status: open - closed title: Build from hg fails with ancient hg version (0.9.3) - Build from hg fails in Modules/getbuildinfo.c when built using ancient hg version (0.9.3) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11706 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11676] imp.load_module and submodules - doc issue, or bug?
Dave Peck davep...@gmail.com added the comment: Definitely could agree with this assessment, but it is surprising given the lack of parallel behavior between 'import' and 'imp'. Note that imp.load_module(subpackage) _does_ modify the parent module's attributes -- but it will never put the subpackage attribute itself on parent. That's the part that made me think it shouldn't work this way and that its more bug than documentation. (That, and the specific use of the imp module in Google's dev_appserver.py which indicates that others have the same expectation of load_module() that I did.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10517] test_concurrent_futures crashes with --with-pydebug on RHEL5 with Fatal Python error: Invalid thread state for this thread
Dave Malcolm dmalc...@redhat.com added the comment: I tried again, and I'm still able to reproduce this bug on a RHEL5 box with cpython --with-pydebug as of a recent checkout (69030:00217100b9e7 as it happens): $ ./python -c import multiprocessing.managers ; mpp = multiprocessing.Pool(4); sm = multiprocessing.managers.SyncManager(); sm.start() Fatal Python error: Invalid thread state for this thread [66448 refs] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10517 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11639] Documentation for *Config functions in logging module should be in logging.config
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- assignee: docs@python - vinay.sajip nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11705] sys.excepthook doesn't work in imported modules
Andreas Stührk andy-pyt...@hammerhartes.de added the comment: I really doubt that this issue has anything to do with `sys.excepthook` at all. It's rather that module members are set to `None` during module cleanup. Because the module raises an exception when one tries to import it, it will be cleaned up immediately (see `PyImport_ExecCodeModuleEx`: it calls `remove_module` which will call at some point `_PyModule_Clear`). At the time when `sys.excepthook` is called, all module members are already set to `None`. One can easily demonstrate that this is really the problem by removing the exception raise in your example code: If one then imports loggingTest in an interactive session and raises an exception, the expected behaviour can be observed. Another workaround is to bind `logger` as a default argument (i.e. ``def handleException(excType, excValue, traceback, logger=logger):``). -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Rogi r...@linuxmail.org added the comment: @mhammond Maybe its just me but it seems to be a really bad idea to let those functions terminate your process as they wish. Teh programmer should be allowed to control teh flow of his application. However, I am not teh only one affected by this. I recall seeing blender crash when I typed raise(SystemExit) on its interactive console. Teh new blender beta worked around this by UNDEFINING SystemExit, which, to me, seems a UGLY HACK. If backwards compatibility is teh problem, things could still be hacked to maintain it and achieve teh desired behaviour during transition. For example, one could set a macro GOOD_BEHAVING_PYTHON and obtain teh desired behaviour, without breaking old stuff. It's ugly but it works. Teh new behaviour could be something liek that: ... #define GOOD_BEHAVING_PYTHON 1 #include Python.h ... PyRun_SimpleString(...); /* allow programmer to do what he wants */ /* if he wants to, he can do teh following */ PyErr_Print(); PyErr_Handle(); ... this way, Py_Main() could be implemented in a way it would return to its caller instead of terminating teh process. Adn about my keyboadr, its not juts teh 'h' adn 'e' keys. Cheers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11639] Documentation for *Config functions in logging module should be in logging.config
Roundup Robot devnull@devnull added the comment: New changeset bfa2a8d91859 by Vinay Sajip in branch '2.6': Issue #11639: Configuration function documentation referred to logging.XXX rather than logging.config.XXX. http://hg.python.org/cpython/rev/bfa2a8d91859 New changeset f494339674e7 by Vinay Sajip in branch '2.7': Issue #11639: Configuration function documentation referred to logging.XXX rather than logging.config.XXX. http://hg.python.org/cpython/rev/f494339674e7 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11707] Create C version of functools.cmp_to_key()
New submission from Raymond Hettinger raymond.hettin...@gmail.com: For cases where the underlying comparison function is in C (strcoll for example), the pure Python dispatch in cmp_to_key dominates running time. This can be reduced considerably by writing cmp_to_key in C, making its overhead as low or lower than the cost of bound method dispatch. -- assignee: rhettinger components: Interpreter Core keywords: easy messages: 132448 nosy: rhettinger priority: low severity: normal stage: needs patch status: open title: Create C version of functools.cmp_to_key() type: performance versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11707 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11639] Documentation for *Config functions in logging module should be in logging.config
Roundup Robot devnull@devnull added the comment: New changeset 1a5aab273332 by Vinay Sajip in branch '2.7': Issue #11639: Configuration function documentation referred to logging.XXX rather than logging.config.XXX. http://hg.python.org/cpython/rev/1a5aab273332 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11639] Documentation for *Config functions in logging module should be in logging.config
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- resolution: - fixed status: open - closed versions: +Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Rogi r...@linuxmail.org added the comment: @mhammond After reading your post again I noticed you talk about SystemError and not SystemExit. In fact, Py_Main() should not return on SystemError. Teh documentation states if the interpreter exits due to an exception, which implies teh interpreter _exiting_, not simply catching a exception. It is just a BAD IDEA to allow python functions to print messages or call exit() as they wish. They should be split so teh programmer could put printing and exiting where he finds appropriate. Teh printing part is just another nuisance, but teh exit() is serious. Again, all of this could be accomplished while maintaining backward compatibility. Cheers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11693] memory leak in email.generator.Generator().flatten() method
Kaushik Kannan kaushik1...@gmail.com added the comment: I'm on Ubuntu 10.04 with Python 2.6.5, Python 3.1 is also available in the repos, I'll try that and post back. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11693 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6498] Py_Main() does not return on SystemExit
Mark Hammond skippy.hamm...@gmail.com added the comment: @Rogi - you might like to re-read my responses a couple more times: * I refer to SystemError as the docs *you quoted* refer to SystemError. Therefore, we should *not* make the implementation match the docs - the docs would be wrong *even if* we change Python to work how you want. IOW, the docs need changing regardless of the outcome (and this is the bug where that should be managed, given the Components and assignee already on this bug) * I understand your point that calling exit() directly is undesirable but that should be handled as a new separate feature request bug. But while that bug goes through the process, the docs should be fixed to reflect the current reality (this bug). Once your new bug is accepted and fixed, the docs should be changed again to reflect that new reality. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11549] Rewrite peephole to work on AST
Eugene Toder elto...@gmail.com added the comment: If we have to preserve backward compatibility of Python AST API, we can do this relatively easily (at the expense of some code complexity): * Add 'version' argument to compile() and ast.parse() with default value of 1 (old AST). Value 2 will correspond to the new AST. * Do not remove Num/Str/Bytes/Ellipsis Python classes. Make PyAST_obj2mod and PyAST_mod2obj do appropriate conversions when version is 1. * Possibly emit a PendingDeprecationWarning when version 1 is used with the goal of removing it in 3.5 Alternative implementation is to leave Num/Str/etc classes in C as well, and write visitors (similar to folding one) to convert AST between old and new forms. Does this sounds reasonable? Should this be posted to python-dev? Should I write a PEP (I'd need some help with this)? Are there any other big issues preventing this to be merged? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11549 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11705] sys.excepthook doesn't work in imported modules
Elias Zamaria mikez...@gmail.com added the comment: Andreas, your explanation seems plausible. What has changed between 2.7 and 2.7.1 such that doing the same thing produces different results? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11549] Rewrite peephole to work on AST
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Eugene, I think you're doing great work here and would like to see you succeed. In the near term, I don't have time to participate, but don't let that stop you. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11549 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11705] sys.excepthook doesn't work in imported modules
Andreas Stührk andy-pyt...@hammerhartes.de added the comment: The difference between 2.7 and 2.7.1 is issue #10068 (e2aa3b1d08bc). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11705] sys.excepthook doesn't work in imported modules
Elias Zamaria mikez...@gmail.com added the comment: Is my issue a bug or is it expected behavior? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11705] sys.excepthook doesn't work in imported modules
Andreas Stührk andy-pyt...@hammerhartes.de added the comment: In my opinion, it is expected behaviour (but then, I'm not a core developer). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com