[issue13453] Tests and network timeouts
Changes by Charles-François Natali neolo...@free.fr: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13453 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Dict.update documentation bug
The current docstring for dict.update shows: help(dict.update) Help on method_descriptor: update(...) D.update(E, **F) - None. Update D from dict/iterable E and F. If E has a .keys() method, does: for k in E: D[k] = E[k] If E lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] Better, would be something like: update(...) D.update(E=None, **F) - None. Update D from dict/iterable E and F. If E is not None then: If E has a .keys() method, does: for k in E: D[k] = E[k] If E lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] The current signature states that argument E is mandatory, when it is not. eg. d = {} d.update(mykey={1:2}) # just keywords passed in, no E I tried subclassing the builtin dict using the current signature as a guide, but my implementation was incorrect since I had assumed there was a mandatory argument, E. Regards, Gerrat ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock
Antoine Pitrou pit...@free.fr added the comment: To make sure we are on the same page, here is what I changed it to: https://github.com/jango/PC/blob/test/pc/pc.py - lines 47-50 commented out (init of PC class that initialises threads); - lines 64, 65, 77, 78 getLogger within the PC class and print some messages; - lines 59, 61 71, 74 -- None is passed to the constructor of _Consumer and _Producer; - lines 135, 203 -- children user logger; Ok, can you try to move the getLogger call from _Producer.__init__ to _Producer.run? (same for _Consumer) (note these aren't threads, but processes) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13248] deprecated in 3.2, should be removed in 3.3
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f82ebf9b3a52 by Florent Xicluna in branch 'default': Issue #13248: turn 3.2's PendingDeprecationWarning into 3.3's DeprecationWarning (cgi, importlib, nntplib, smtpd). http://hg.python.org/cpython/rev/f82ebf9b3a52 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13248 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13453] Tests and network timeouts
Antoine Pitrou pit...@free.fr added the comment: Wow, the error description (Non-recoverable failure in name resolution) is as useful as a Windows error message. Ok for the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13453 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10408] Denser dicts and linear probing
Charles-François Natali neolo...@free.fr added the comment: This paper might be of interest: http://www.siam.org/meetings/alenex05/papers/13gheileman.pdf Basically, it concludes that most of the time, there's no speedup to be gained from the increased cached locality incurred by linear probing when the input sample differ from a uniform distribution. However, figure 1 shows a clear win with a uniform distribution, and figure 2 shows that even with a non-uniform distribution, there's still a gain as the load factor increases. So if experiments show measurable improvements, this might be an interesting idea. However, the problem with linear probing is that the performance will be much more dependent on the input distribution that with quadratic probing/double hashing, so this will definitely degrade with some workloads. The problem with linear probing, as noted in the comments, is that it degrades performance quite a lot when the hashing function clusters results. The solution I'm proposing is to apply an *initial* perturbation, by multiplying the hash() with a prime number. I fail to see how this would avoid primary clustering: IIUC, you replace the hash function h(k) by h'(k), but you still use linear probing: an empty slot preceded by i filled slots has a probablility (i+1)/N of getting filled next (N being the total number of slots). -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10408 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11870] test_3_join_in_forked_from_thread() of test_threading hangs 1 hour on x86 Ubuntu Shared 3.x
Charles-François Natali neolo...@free.fr added the comment: Here's a patch to help nail this down. -- Added file: http://bugs.python.org/file23896/debug_stuck.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11870 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13453] Tests and network timeouts
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 5ba1a22c8988 by Charles-François Natali in branch '2.7': Issue #13453: Catch EAI_FAIL in support.transient_internet. http://hg.python.org/cpython/rev/5ba1a22c8988 New changeset c998c6f5464b by Charles-François Natali in branch '3.2': Issue #13453: Catch EAI_FAIL in support.transient_internet. http://hg.python.org/cpython/rev/c998c6f5464b New changeset 767badea87c3 by Charles-François Natali in branch 'default': Issue #13453: Catch EAI_FAIL in support.transient_internet. http://hg.python.org/cpython/rev/767badea87c3 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13453 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13502] Documentation for Event.wait return value is either wrong or incomplete
Charles-François Natali neolo...@free.fr added the comment: Thanks, here's a patch updated accordingly. -- Added file: http://bugs.python.org/file23897/event_wait_cleared-1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13502 ___diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -804,8 +804,10 @@ floating point number specifying a timeout for the operation in seconds (or fractions thereof). - This method returns the internal flag on exit, so it will always return - ``True`` except if a timeout is given and the operation times out. + This method returns true if and only if the internal flag has been set to + true, either before the wait call or after the wait starts, so it will + always return ``True`` except if a timeout is given and the operation + times out. .. versionchanged:: 3.1 Previously, the method always returned ``None``. diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py --- a/Lib/test/lock_tests.py +++ b/Lib/test/lock_tests.py @@ -353,6 +353,22 @@ for r, dt in results2: self.assertTrue(r) +def test_set_and_clear(self): +# Issue #13502: check that wait() returns true even when the event is +# cleared before the waiting thread is woken up. +evt = self.eventtype() +results = [] +N = 5 +def f(): +results.append(evt.wait(1)) +b = Bunch(f, N) +b.wait_for_started() +time.sleep(0.5) +evt.set() +evt.clear() +b.wait_for_finished() +self.assertEqual(results, [True] * N) + class ConditionTests(BaseTestCase): diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -408,9 +408,10 @@ def wait(self, timeout=None): self._cond.acquire() try: -if not self._flag: -self._cond.wait(timeout) -return self._flag +signaled = self._flag +if not signaled: +signaled = self._cond.wait(timeout) +return signaled finally: self._cond.release() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13570] Expose faster unicode-ascii functions in the C-API
STINNER Victor victor.stin...@haypocalc.com added the comment: Le 09/12/2011 22:12, Stefan Krah a écrit : The bottleneck in _decimal is (res is ascii): PyUnicode_FromString(res); PyUnicode_DecodeASCII(res) has the same performance. With this function ... static PyObject* unicode_fromascii(const char* s, Py_ssize_t size) { PyObject *res; res = PyUnicode_New(size, 127); if (!res) return NULL; memcpy(PyUnicode_1BYTE_DATA(res), s, size); return res; } ... I get the same performance as with Python 2.7 (5.85s)! The problem is that unicode_fromascii() is unsafe: it doesn't check that the string is pure ASCII. That's why this function is private. Because of the PEP 383, ASCII and UTF-8 decoders (PyUnicode_DecodeASCII and PyUnicode_FromString) have to first scan the input to check for errors, and then do a fast memcpy. The scanner of these two decoders is already optimized to process the input string word by word (word=the C long type), instead of byte by byte, using a bit mask. -- You can write your own super fast ASCII decoder using two lines: res = PyUnicode_New(size, 127); memcpy(PyUnicode_1BYTE_DATA(res), s, size); (this is exactly what unicode_fromascii does) I think it would be really beneficial for C-API users to have more ascii low level functions that don't do error checking and are simply as fast as possible. It is really important to ensure that a ASCII string doesn't contain characters outside [U+; U+007F] because many operations on ASCII string are optimized (e.g. UTF-8 pointer is shared with the ASCII pointer). I prefer to not expose such function or someone will use it without understanding exactly how dangerous it is. Martin and other may disagree with me. Do you know Murphy's Law? :-) http://en.wikipedia.org/wiki/Murphy%27s_law -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13570 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13559] Use sendfile where possible in httplib
Changes by Ross Lagerwall rosslagerw...@gmail.com: -- nosy: +rosslagerwall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13453] Tests and network timeouts
Charles-François Natali neolo...@free.fr added the comment: The test_poplib failures are likely due to this obvious race: def setUp(self): [...] threading.Thread(target=self.server, args=(self.evt,self.sock)).start() time.sleep(.1) [...] def server(self, evt, serv): serv.listen(5) If the server thread doesn't call listen() before sleep(.1) returns, the client will receive ECONNREFUSED (the test fail consistently without the sleep). The patch attached fixes this, and also does the same type of cleanup as for test_telnetlib in #11812. -- Added file: http://bugs.python.org/file23898/fix_poplib.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13453 ___diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -320,32 +320,34 @@ def setUp(self): self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -self.sock.settimeout(3) +self.sock.settimeout(60) # Safety net. Look issue 11812 self.port = test_support.bind_port(self.sock) -threading.Thread(target=self.server, args=(self.evt,self.sock)).start() -time.sleep(.1) +self.thread = threading.Thread(target=self.server, args=(self.evt,self.sock)) +self.thread.setDaemon(True) +self.thread.start() +self.evt.wait() def tearDown(self): -self.evt.wait() +self.thread.join() +del self.thread # Clear out any dangling Thread objects. def server(self, evt, serv): serv.listen(5) +evt.set() try: conn, addr = serv.accept() +conn.send(b+ Hola mundo\n) +conn.close() except socket.timeout: pass -else: -conn.send(b+ Hola mundo\n) -conn.close() finally: serv.close() -evt.set() def testTimeoutDefault(self): self.assertTrue(socket.getdefaulttimeout() is None) socket.setdefaulttimeout(30) try: -pop = poplib.POP3(localhost, self.port) +pop = poplib.POP3(HOST, self.port) finally: socket.setdefaulttimeout(None) self.assertEqual(pop.sock.gettimeout(), 30) @@ -362,7 +364,7 @@ pop.sock.close() def testTimeoutValue(self): -pop = poplib.POP3(localhost, self.port, timeout=30) +pop = poplib.POP3(HOST, self.port, timeout=30) self.assertEqual(pop.sock.gettimeout(), 30) pop.sock.close() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13564] ftplib and sendfile()
Changes by Ross Lagerwall rosslagerw...@gmail.com: -- nosy: +rosslagerwall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13564 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13530] Docs for os.lseek neglect to mention what it returns
Changes by Ross Lagerwall rosslagerw...@gmail.com: -- nosy: +rosslagerwall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13530 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11886] test_time.test_tzset() fails on x86 FreeBSD 7.2 3.x: AEST timezone called EST
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset e37a7dc8944e by Victor Stinner in branch 'default': Issue #11886: Fix also test_time for the non-DST timezone name (EST/AEST) http://hg.python.org/cpython/rev/e37a7dc8944e -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11886 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock
Nikita Pchelin nikita.pche...@gmail.com added the comment: (note these aren't threads, but processes) Fair enough, I should be more careful with terminology. Ok, can you try to move the getLogger call from _Producer.__init__ to, _Producer.run?, (same for _Consumer) Yes, that seems to work fine. One thing, however, that this would mean that I would have to declare logger in any method outside of __init__, like in shutdown() for example. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x
New submission from STINNER Victor victor.stin...@haypocalc.com: http://www.python.org/dev/buildbot/all/builders/ARM%20Ubuntu%203.x/builds/143/steps/test/logs/stdio --- test test_curses crashed -- Traceback (most recent call last): File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/test/regrtest.py, line 1214, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/test/test_curses.py, line 23, in module curses = import_module('curses') File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/test/support.py, line 105, in import_module return importlib.import_module(name) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/__init__.py, line 123, in import_module return _bootstrap._gcd_import(name[level:], package, level) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 840, in _gcd_import loader.load_module(name) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 466, in load_module return self._load_module(fullname) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 170, in decorated return fxn(self, module, *args, **kwargs) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 371, in _load_module exec(code_object, module.__dict__) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/curses/__init__.py, line 13, in module from _curses import * File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 190, in inner return method(self, name, *args, **kwargs) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 126, in wrapper module = fxn(*args, **kwargs) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 139, in wrapper module = fxn(self, *args, **kwargs) File /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/importlib/_bootstrap.py, line 574, in load_module return imp.load_dynamic(fullname, self._path) UnicodeDecodeError: 'utf8' codec can't decode byte 0xb5 in position 0: invalid start byte --- The locale encoding is UTF-8 (LANG=en_US.UTF-8), Python directory is /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build. Full header: --- make buildbottest TESTOPTS= TESTPYTHONOPTS= TESTTIMEOUT=3600 in dir /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build (timeout 3900 secs) watching logfiles {} argv: ['make', 'buildbottest', 'TESTOPTS=', 'TESTPYTHONOPTS=', 'TESTTIMEOUT=3600'] environment: HOME=/var/lib/buildbot LANG=en_US.UTF-8 LOGNAME=buildbot MAIL=/var/mail/buildbot PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games PWD=/var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build SHELL=/bin/sh SPEECHD_PORT=6678 TERM=linux USER=buildbot XDG_SESSION_COOKIE=559ce1e92f80d0de13b3936e4c1475f9-29.919136-1746652091 closing stdin using PTY: False --- In Unicode, U+00B5 is µ (micro sign). Add Barry, the owner of the buildbot, to the nosy list. Add Brett to the nosy, even if I don't think that the problem comes from the importlib. -- components: Library (Lib), Unicode messages: 149155 nosy: barry, brett.cannon, ezio.melotti, haypo priority: normal severity: normal status: open title: import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x
STINNER Victor victor.stin...@haypocalc.com added the comment: The compilation of the module failed for the same reason: building '_curses' extension gcc -pthread -fPIC -Wno-unused-result -g -O0 -Wall -Wstrict-prototypes -DHAVE_NCURSESW=1 -I/usr/include/ncursesw -IInclude -I. -I./Include -I/usr/include/arm-linux-gnueabi -I/usr/local/include -I/var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build -c /var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Modules/_cursesmodule.c -o build/temp.linux-armv7l-3.3-pydebug/var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Modules/_cursesmodule.o gcc -pthread -shared build/temp.linux-armv7l-3.3-pydebug/var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Modules/_cursesmodule.o -L/usr/lib/arm-linux-gnueabi -L/usr/local/lib -lncursesw -o build/lib.linux-armv7l-3.3-pydebug/_curses.cpython-33dm.so *** WARNING: importing extension _curses failed with class 'UnicodeDecodeError': 'utf8' codec can't decode byte 0xb5 in position 0: invalid start byte -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13453] Tests and network timeouts
Charles-François Natali neolo...@free.fr added the comment: And I assume that the test_telnetlib failure on the OpenIndiana buildbot is due to a broken name resolution service, as in issue #11812. Here's a patch bumping the timeout to 60s, which should be enough to resolve localhost... -- Added file: http://bugs.python.org/file23899/test_telnetlib_broken_nss.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13453 ___diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -95,7 +95,7 @@ self.evt = threading.Event() self.dataq = Queue.Queue() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -self.sock.settimeout(3) +self.sock.settimeout(60) # Safety net. Look issue 11812 self.port = test_support.bind_port(self.sock) self.thread = threading.Thread(target=server, args=(self.evt,self.sock, self.dataq)) self.thread.start() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x
STINNER Victor victor.stin...@haypocalc.com added the comment: The problem comes maybe from the name of a curses key, keyname(). PyInit__curses() gets the name of all keys (KEY_MIN..KEY_MAX). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13570] Expose faster unicode-ascii functions in the C-API
Stefan Krah stefan-use...@bytereef.org added the comment: I prefer to not expose such function or someone will use it without understanding exactly how dangerous it is. OK. - I'm afraid that I made an error in the benchmarks, since I accidentally used a changed version of telco.py, namely: # t is a Decimal outfil.write(%s\n % t) # original version ... outfil.write(str(t)) # changed version runs outfil.write('\n') # faster since PEP-393 ... Since PEP-393 the changed version with two calls to write() runs quite a bit faster than the original. For Python-3.2 and 2.7 the original runs faster. Do you have an idea what could cause this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13570 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13502] Documentation for Event.wait return value is either wrong or incomplete
R. David Murray rdmur...@bitdance.com added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13544] Add __qualname__ to functools.WRAPPER_ASSIGNMENTS
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13544 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13525] Tutorial: Example of Source Code Encoding triggers error
Éric Araujo mer...@netwok.org added the comment: Thanks for the detailed bug report. I thought the normalization performed by the codec lookup system would convert 'cp-1252' to 'cp1252' (its “real” name, i.e. the name of the module implementing the codec), but it does not. I’m +1 to removing the hyphen in the example, then. Python raises the following exception: SyntaxError: encoding problem: with BOM I reproduced this and it’s surprising. Maybe there is a bug with error reporting here. Alternatively a totally other example as for Python 2.7 would be nice too This file has seen different changes in 2.7 and 3.2, given that the default encoding is different in 3.x. I’ll check the history and upload a patch here to get your feedback. -- assignee: docs@python - eric.araujo nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13525 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13537] Namedtuple instances can't be pickled in a daemonized process
Éric Araujo mer...@netwok.org added the comment: Confirmed (3.2): def func(): ... t = collections.namedtuple('t', 'a') ... instance = t(1) ... print(instance) ... return pickle.dumps(instance) func() t(a=1) Traceback (most recent call last): File stdin, line 1, in module File stdin, line 5, in func _pickle.PicklingError: Can't pickle class '__main__.t': attribute lookup __main__.t failed We may open an enhancement request to suggest that the error message include the qualname, but otherwise this is not a bug. -- nosy: +eric.araujo stage: - committed/rejected status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13538] Docstring of str() and/or behavior
Éric Araujo mer...@netwok.org added the comment: A note in the docs (without note/warning directives, just a note) and maybe the docstring would be good. It should better explain that str has two uses: converting anything to a str (using __str__ or __repr__), decode buffer to str (with encoding and errors arguments). str(b'') is a case of the first use, not the second (and likewise %s formatting). -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13538] Improve doc for str(bytesobject)
Changes by Éric Araujo mer...@netwok.org: -- title: Docstring of str() and/or behavior - Improve doc for str(bytesobject) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13521] Make dict.setdefault() atomic
Éric Araujo mer...@netwok.org added the comment: maniram: We try to keep bug reports focused on one thing, and we don’t generally collect votes (we prefer that people vote with patches, tests and messages with content—for example, saying exactly what “more robust” should be). Here I think Antoine and Jesús said +1 to agree that this should be changed even in stable versions. Raymond: I think I could make the patch, but I’m not sure about testing the new behavior. -- nosy: +eric.araujo versions: -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13539] Return value missing in calendar.TimeEncoding.__enter__
Éric Araujo mer...@netwok.org added the comment: Good catch. The code doesn’t break because there is a check for None later on (certainly because getlocale may return None, but here __enter__ always returns None). How did you find this? If you have a code snippet that reproduces the bug we’ll be able to add it to the test suite before fixing the bug. -- nosy: +eric.araujo stage: - test needed title: A return is missing in TimeEncoding of calendar.py - Return value missing in calendar.TimeEncoding.__enter__ versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13540] Document the Action API in argparse
Changes by Éric Araujo mer...@netwok.org: -- nosy: +bethard, eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13540 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13550] Rewrite logging hack of the threading module
Éric Araujo mer...@netwok.org added the comment: On #13550 I asked Guido about the Thing/_Thing function/class indirection and use of _Verbose; the reply: IIRC: The design started out this way because it predates new-style classes. When this was put in one couldn't subclass extension types, and there were plans/hopes to replace some of the lock types with platform-specific built-in versions on some platforms. Since it is now possible to write subclassable extension types the Thing/_Thing design is no longer needed. I'm not sure about the _Verbose hacks, if it is deemed not useful I'm fine with letting it go. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13550 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13551] pulldom doesn't populate DOM tree
Éric Araujo mer...@netwok.org added the comment: So, is there a code or documentation bug in any version? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13551 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3786] _curses, _curses_panel _multiprocessing can't be build in 2.6b3 w/ SunStudio 12
Changes by Éric Araujo mer...@netwok.org: -- versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3786 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13557] exec of list comprehension fails on NameError
Éric Araujo mer...@netwok.org added the comment: Would you like to make a doc patch? -- assignee: - docs@python components: +Documentation keywords: +easy nosy: +docs@python, eric.araujo resolution: invalid - stage: - needs patch versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13557 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13559] Use sendfile where possible in httplib
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13561] os.listdir documentation should mention surrogateescape
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo, haypo, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13562] Notes about module load path
Éric Araujo mer...@netwok.org added the comment: Thanks for the patch, I will make a few wording/markup editions if you don’t mind and post the edited version. -- nosy: +eric.araujo versions: +Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13562 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13564] ftplib and sendfile()
Éric Araujo mer...@netwok.org added the comment: deciding whether using sendfile() should probably be done silently (no explicit argument) As an optimization taking advantage from OS support, I think this should be automatic too. But if there are too many issues, then explicit argument sounds better. the input fd should be a regular file and it's not clear how to determine this beforehand Calling some function like os.stat that only works with real files? (not sure os.stat is the right function, just giving an idea) in case of disconnection OSError is raised instead of socket.error PEP 3151! socket.error, OSError, IOError (class 'OSError', class 'OSError', class 'OSError') :) -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13564 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13567] HTTPError interface changes / breaks depending on what was passed to constructor
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo, ezio.melotti versions: -Python 2.6, Python 3.1, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13515] Consistent documentation practices for security concerns and considerations
Éric Araujo mer...@netwok.org added the comment: Note sure about icon vs. text (“Warning:”) vs. colors. I think an icon would be as scary as the current big color boxes. I like Ezio’s change + Antoine’s indenting suggestion. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13562] Notes about module load path
Nam Nguyen bits...@gmail.com added the comment: That would be great. Thank you. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13562 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13549] Incorrect nested list comprehension documentation
Ezio Melotti ezio.melo...@gmail.com added the comment: Having both is fine. I just noticed that the 3.2 docs are different[0], so I tried to merge them: 3.2 says: List comprehensions provide a concise way to create lists from sequences. Common applications are to make lists where each element is the result of some operations applied to each member of the sequence, or to create a subsequence of those elements that satisfy a certain condition. I kept this, changing a few minor things. In 3.2 the examples are divided and each one has a short description. I reworked them a bit to make them more clear, and added the description inline as a comment. The section about nested listcomps is the same, so I didn't change it (but it's now a subsection of the list comprehension section). This is hopefully the final version. [0]: http://docs.python.org/py3k/tutorial/datastructures.html#list-comprehensions -- Added file: http://bugs.python.org/file23900/issue13549-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13549 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13549] Incorrect nested list comprehension documentation
Changes by Ezio Melotti ezio.melo...@gmail.com: Added file: http://bugs.python.org/file23901/issue13549-3-py32.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13549 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13515] Consistent documentation practices for security concerns and considerations
Ezio Melotti ezio.melo...@gmail.com added the comment: I think an icon would be as scary as the current big color boxes. Especially if I design it. Georg, is the patch ok if I add a bit of indentation as suggested by Antoine? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13569] Loggers cannot be pickled
Antoine Pitrou pit...@free.fr added the comment: One thing, however, that this would mean that I would have to declare logger in any method outside of __init__, like in shutdown() for example. If you only use the logger from the child process, you can declare and store it in the run() method. That said, this still can be a feature request: allow loggers to be pickled (and unpickled). -- nosy: +vinay.sajip title: multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock - Loggers cannot be pickled type: behavior - feature request versions: -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13569] Loggers cannot be pickled
Nikita Pchelin nikita.pche...@gmail.com added the comment: Fair enough. Thanks for help with investigating this issue! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13515] Consistent documentation practices for security concerns and considerations
Antoine Pitrou pit...@free.fr added the comment: Note sure about icon vs. text (“Warning:”) vs. colors. I think an icon would be as scary as the current big color boxes. I like Ezio’s change + Antoine’s indenting suggestion. An icon will only be scary if you chopse a scary one. A warning icon can simply be an exclamation mark or something (*). It would be less prominent than a box with a red background, while still clearly separating the warning from the rest of the text (something which a too small indentation does not). Icons or drawings also make text documents less austere, which is a good thing. There are lots of free icon sets out there, so Ezio doesn't have to train his art skills ;) (*) to get an idea, search exclamation mark icon with Google Images -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13515] Consistent documentation practices for security concerns and considerations
Georg Brandl ge...@python.org added the comment: I don't really like the combination of the left bar and the background color. What about making the left bar thicker, and leaving out the background color? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13573] csv.writer uses str() for floats instead of repr()
New submission from Raymond Hettinger raymond.hettin...@gmail.com: The csv.writer needs a special case for floats to print them to full precision. See http://stackoverflow.com/a/8455313/1001643 In Py2.7, the csv.writer converts floats to strings using str(). This will store 1323494016.8556759 as '1323494016.86' and unnecessarily throw away precision. In Py3.2, this isn't a problem because float.__str__ now returns full precision, the same a float.__repr__. -- assignee: rhettinger messages: 149179 nosy: rhettinger priority: normal severity: normal status: open title: csv.writer uses str() for floats instead of repr() type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13573 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5689] Support xz compression in tarfile module
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 899a8c7b2310 by Lars Gustäbel in branch 'default': Issue #5689: Add support for lzma compression to the tarfile module. http://hg.python.org/cpython/rev/899a8c7b2310 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5689 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5689] Support xz compression in tarfile module
Lars Gustäbel l...@gustaebel.de added the comment: Thanks for the review, guys! I can't close this issue yet because it depends on #6715. -- resolution: - fixed stage: needs patch - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5689 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13574] refresh example in doc for Extending and Embedding
New submission from Florent Xicluna florent.xicl...@gmail.com: The example uses PyInstanceObject which is Python 2 only (old-style classes). http://docs.python.org/dev/extending/newtypes.html#weak-reference-support -- assignee: docs@python components: Documentation, Extension Modules messages: 149183 nosy: docs@python, flox priority: normal severity: normal stage: needs patch status: open title: refresh example in doc for Extending and Embedding type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13574 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5689] Support xz compression in tarfile module
Nadeem Vawda nadeem.va...@gmail.com added the comment: Great stuff! I'll close this issue along with issue 6715 once the buildbot stuff is all sorted out. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5689 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13563] Make use of with statement in ftplib
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 6cd736239b8a by Giampaolo Rodola' in branch 'default': fix #13563: make use of with statement in ftplib.py where needed http://hg.python.org/cpython/rev/6cd736239b8a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13563] Make use of with statement in ftplib
Giampaolo Rodola' g.rod...@gmail.com added the comment: That's why I nosyed you. Thanks. ;) -- assignee: - giampaolo.rodola components: +Library (Lib) keywords: +easy -patch resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)
Florent Xicluna florent.xicl...@gmail.com added the comment: Of course it's better to have someone else to review the patch. However in this case, I'm not sure it is a major feature. BTW, I noticed that effbot is currently marked as *inactive* maintainer http://docs.python.org/devguide/experts.html#stdlib If it is not an oversight, it means that this issue might wait an extended period before receiving a response. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13378 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13575] old style classes still alive
New submission from Florent Xicluna florent.xicl...@gmail.com: there are still some leftovers of Python 2 old-style classes. See attached patch. -- components: Interpreter Core, Library (Lib) files: oldstyle_leftovers.diff keywords: patch messages: 149188 nosy: flox priority: low severity: normal stage: patch review status: open title: old style classes still alive type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file23902/oldstyle_leftovers.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13575] old style classes still alive
Florent Xicluna florent.xicl...@gmail.com added the comment: Off course the leftovers are mainly in comments and documentation. See also issue #13574. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13575] old style classes still alive
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- priority: low - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8684] improvements to sched.py
Giampaolo Rodola' g.rod...@gmail.com added the comment: Updated patch adding a synchronized argument to scheduler class and updating doc is in attachment. -- Added file: http://bugs.python.org/file23903/sched-thread-safe.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8684 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8931] '#' has no affect with 'c' type
Torsten Landschoff t.landsch...@gmx.net added the comment: Attached patch makes Python throw an exception in the case above. It also adds a test case for that case. -- keywords: +patch nosy: +torsten Added file: http://bugs.python.org/file23904/issue_8931.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13248] deprecated in 3.2, should be removed in 3.3
Florent Xicluna florent.xicl...@gmail.com added the comment: I know it won't be committed as-is, but this is the patch with most of the deprecated things removed. I skipped all the modules where a veto has been pronounced explicitly. -- keywords: +patch Added file: http://bugs.python.org/file23905/issue13248_obsolescence.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13248 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13544] Add __qualname__ to functools.WRAPPER_ASSIGNMENTS
Filip Gruszczyński grusz...@gmail.com added the comment: Patch with tests. -- keywords: +patch nosy: +gruszczy Added file: http://bugs.python.org/file23906/13544.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13544 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13568] sqlite3 convert_date error with DATE type
Filip Gruszczyński grusz...@gmail.com added the comment: c.execute(insert into testdate values ('now')) This works, but you actually are putting string now into a field with DATE type. When conversion occurs after retrieving data, there is an error. Also if you use datetime() function c.execute(insert into testdate values (datetime())) you'll get an error later during conversion, because python expects date string and will get datetime string. This should work for you: c.execute(insert into testdate values (date())) x = c.execute(select * from testdate) for a in x: ... print(a) ... (datetime.date(2011, 12, 10),) -- nosy: +gruszczy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13568 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13521] Make dict.setdefault() atomic
Jesús Cea Avión j...@jcea.es added the comment: Eric, overload __hash__() and check that is only called once, while now would be called twice. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13575] old style classes still alive
Jesús Cea Avión j...@jcea.es added the comment: Changes look good. -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13574] refresh example in doc for Extending and Embedding
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13574 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13505] Bytes objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x
Meador Inge mead...@gmail.com added the comment: I don't really know that much about pickle, but Antoine mentioned that 'bytearray' works fine going from 3.2 to 2.7. Given that, can't we just compose 'bytes' with 'bytearray'? Something like: Python 3.3.0a0 (default:aab45b904141+, Dec 10 2011, 13:34:41) [GCC 4.6.2 20111027 (Red Hat 4.6.2-1)] on linux Type help, copyright, credits or license for more information. ... class Bytes(bytes): ...def __reduce__(self): ... return bytes, (bytearray(self),) ... pickletools.dis(pickle.dumps(Bytes(b'abc'), protocol=2)) 0: \x80 PROTO 2 2: cGLOBAL '__builtin__ bytes' 21: qBINPUT 0 23: cGLOBAL '__builtin__ bytearray' 46: qBINPUT 1 48: XBINUNICODE 'abc' 56: qBINPUT 2 58: XBINUNICODE 'latin-1' 70: qBINPUT 3 72: \x86 TUPLE2 73: qBINPUT 4 75: RREDUCE 76: qBINPUT 5 78: \x85 TUPLE1 79: qBINPUT 6 81: RREDUCE 82: qBINPUT 7 84: .STOP highest protocol among opcodes = 2 pickle.dumps(Bytes(b'abc'), protocol=2) b'\x80\x02c__builtin__\nbytes\nq\x00c__builtin__\nbytearray\nq\x01X\x03\x00\x00\x00abcq\x02X\x07\x00\x00\x00latin-1q\x03\x86q\x04Rq\x05\x85q\x06Rq\x07.' [meadori@motherbrain cpython]$ python Python 2.7.2 (default, Oct 27 2011, 01:40:22) [GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2 Type help, copyright, credits or license for more information. ... pickle.loads(b'\x80\x02c__builtin__\nbytes\nq\x00c__builtin__\nbytearray\nq\x01X\x03\x00\x00\x00abcq\x02X\x07\x00\x00\x00latin-1q\x03\x86q\x04Rq\x05\x85q\x06Rq\x07.') 'abc' If this method is OK, then the patch is pretty simple. See attached. -- keywords: +patch Added file: http://bugs.python.org/file23907/issue13505-0.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11822] Improve disassembly to show embedded code objects
Torsten Landschoff t.landsch...@gmx.net added the comment: I offer the attached patch as a starting point to fulfill this feature request. The patch changes the output to insert the disassembly of local code objects on the referencing line. As that made the output unreadable to me, I added indentation for the nested code (by 4 spaces, hoping that nobody will nest code 10 levels deep :-) This results in the following output for the original example: from dis import dis dis('[x**2 for x in range(3)]') 1 0 LOAD_CONST 0 (code object listcomp at 0x7f24a67dde40, file dis, line 1) 1 0 BUILD_LIST 0 3 LOAD_FAST0 (.0) 6 FOR_ITER16 (to 25) 9 STORE_FAST 1 (x) 12 LOAD_FAST1 (x) 15 LOAD_CONST 0 (2) 18 BINARY_POWER 19 LIST_APPEND 2 22 JUMP_ABSOLUTE6 25 RETURN_VALUE 3 LOAD_CONST 1 ('listcomp') 6 MAKE_FUNCTION0 9 LOAD_NAME0 (range) 12 LOAD_CONST 2 (3) 15 CALL_FUNCTION1 18 GET_ITER 19 CALL_FUNCTION1 22 RETURN_VALUE -- keywords: +patch nosy: +torsten Added file: http://bugs.python.org/file23908/issue11822.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11822 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11822] Improve disassembly to show embedded code objects
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thank you :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11822 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13569] Loggers cannot be pickled
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: You shouldn't need to pickle loggers, because loggers just represent where in your application something happens (that being determined by the logger name). The logger name is just a string, and if you need to communicate that across e.g. a process boundary, just sending the name should be enough. Ideally in a multiprocessing application, logging initialisation should happen after the fork() or CreateProcess() which creates the child process. It's best if loggers are named after the module which logs events (using __name__, which means you don't need to pass the name around - but even if you need to for some reason, you still don't need to pickle a logger or pass it around as a parameter). You *can* use logging safely in terms of the locks it creates to serialise access to I/O resources and to protect shared data structures, but you still need to understand what's happening and allow for it in your own coding. To summarise, I don't quite see from the information in this issue why it is desirable to pickle loggers, and the GitHub link doesn't work, so I can't look at Nikita's example, either. So if a better justification isn't available, I would like to close the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13572] import _curses fails because of UnicodeDecodeError('utf8' codec can't decode byte 0xb5 ...') on ARM Ubuntu 3.x
Barry A. Warsaw ba...@python.org added the comment: Fails in exactly the same way when built from my shell account using current hg head. Does not fail on same version of OS on amd64. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13572 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13569] Loggers cannot be pickled
Nikita Pchelin nikita.pche...@gmail.com added the comment: Here is a link for example in question: https://github.com/jango/calculon/blob/master/calculon/calculon.py Previously, I would pass logger instance from Calculon class to _Producer and _Consumer classes. In the current revision, I removed the logging completely since I don't feel like it was serving much purpose anyway. On 11-12-10 06:52 PM, Vinay Sajip wrote: Vinay Sajipvinay_sa...@yahoo.co.uk added the comment: You shouldn't need to pickle loggers, because loggers just represent where in your application something happens (that being determined by the logger name). The logger name is just a string, and if you need to communicate that across e.g. a process boundary, just sending the name should be enough. Ideally in a multiprocessing application, logging initialisation should happen after the fork() or CreateProcess() which creates the child process. It's best if loggers are named after the module which logs events (using __name__, which means you don't need to pass the name around - but even if you need to for some reason, you still don't need to pickle a logger or pass it around as a parameter). You *can* use logging safely in terms of the locks it creates to serialise access to I/O resources and to protect shared data structures, but you still need to understand what's happening and allow for it in your own coding. To summarise, I don't quite see from the information in this issue why it is desirable to pickle loggers, and the GitHub link doesn't work, so I can't look at Nikita's example, either. So if a better justification isn't available, I would like to close the issue. -- ___ Python trackerrep...@bugs.python.org http://bugs.python.org/issue13569 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13569 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13448] PEP 3155 implementation
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13448 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11564] pickle not 64-bit ready
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11564 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9269] Cannot pickle self-referencing sets
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9269 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4727] pickle/copyreg doesn't support keyword only arguments in __new__
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4331] Can't use _functools.partial() created function as method
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1398] Can't pickle partial functions
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1398 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13448] PEP 3155 implementation
Jesús Cea Avión j...@jcea.es added the comment: I am evaluating the use of __qualname__ in my dtrace probes (issue #13405) and I see things like this: def a() : ... class b() : ... pass ... return b() ... c=a() c __main__.a.locals.b object at 0xfe37f3ac c.__qualname__ Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'b' object has no attribute '__qualname__' a function a at 0xfe3800bc a.__qualname__ 'a' I guess the class should have a __qualname__ too, haven't it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13448 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13576] Handling of broken condcoms in HTMLParser
New submission from Ezio Melotti ezio.melo...@gmail.com: The attached patch adds a few tests about the handling of broken conditional comments (condcoms). A valid condcom looks like !--[if ie 6]...![endif]--. An invalid one looks like ![if ie 6]...![endif]. This seems a common mistake, and it's found even on popular sites like adobe, linkedin, deviantart. Currently, HTMLParser calls unknown_decl() passing e.g. 'if ie 6', and if strict=True an error is raised. With strict=False no error is raised and the unknown declaration is ignored. The HTML5 specs say: [After '!',] If the next two characters are both U+002D HYPHEN-MINUS characters (-), consume those two characters, [...] Otherwise, this is a parse error. Switch to the bogus comment state.[0] [Once in the bogus comment state,] Consume every character up to and including the first U+003E GREATER-THAN SIGN character () or the end of the file (EOF), whichever comes first. Emit a comment token whose data is the concatenation of all the characters starting from and including the character that caused the state machine to switch into the bogus comment state, up to and including the character immediately before the last consumed character (i.e. up to the character just before the U+003E or EOF character), but with any U+ NULL characters replaced by U+FFFD REPLACEMENT CHARACTER characters. (If the comment was started by the end of the file (EOF), the token is empty.)[1] So, IIUC, '![if ie 6]...![endif]' should emit a '[if ie 6]' comment, parse the '...' normally, and emit a '[endif]' comment. However I think it's fine to leave the current behavior for the following reasons: 1) backward compatibility; 2) handling broken condcoms in unknown_decl is easier than doing it in handle_comment, where all the other comments are sent; 3) no one probably cares about them anyway; [0]: http://www.w3.org/TR/html5/tokenization.html#markup-declaration-open-state [1]: http://www.w3.org/TR/html5/tokenization.html#bogus-comment-state -- assignee: ezio.melotti components: Library (Lib) files: issue13576.diff keywords: patch messages: 149204 nosy: eric.araujo, ezio.melotti priority: normal severity: normal stage: commit review status: open title: Handling of broken condcoms in HTMLParser type: behavior versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23909/issue13576.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13576 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13448] PEP 3155 implementation
Nick Coghlan ncogh...@gmail.com added the comment: No, it's only class objects that have __name__ and __qualname__, not class instances. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13448 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13568] sqlite3 convert_date error with DATE type
Gianluigi Tiesi sher...@gmail.com added the comment: I've made a simplified testcase, my problem is importing from a sql dump with dates in the format '10-OCT-11', so if I understand 'DATE' in sqlite is fake and really a string? I have no way to control this behavior if my dump is text? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13568 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13568] sqlite3 convert_date error with DATE type
Gianluigi Tiesi sher...@gmail.com added the comment: So I suppose I have to blame sqlite3 and not fill a bug here -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13568 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13544] Add __qualname__ to functools.WRAPPER_ASSIGNMENTS
Meador Inge mead...@gmail.com added the comment: Filip, with the exception of some minor whitespace problems (remember to run 'make patchcheck') and a missed testcase in 'TestWraps.test_default_update', this looks good to me. I was just about to attach a similar patch. Here is an updated patch with those minor fixes. Nick, does this look OK to you? -- nosy: +meador.inge Added file: http://bugs.python.org/file23910/issue13544-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13544 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13577] __qualname__ is not present on builtin methods and functions
New submission from Meador Inge mead...@gmail.com: I was recently experimenting with the new PEP 3155 '__qualname__ implementation and noticed that '__qualname__' is not present on builtin methods and functions: [meadori@motherbrain cpython]$ ./python Python 3.3.0a0 (default:aab45b904141+, Dec 10 2011, 14:53:54) [GCC 4.6.2 20111027 (Red Hat 4.6.2-1)] on linux Type help, copyright, credits or license for more information. max.__qualname__ Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'builtin_function_or_method' object has no attribute '__qualname__' str.strip.__qualname__ Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'method_descriptor' object has no attribute '__qualname__' I will work up a patch. -- components: Interpreter Core messages: 149209 nosy: meador.inge, pitrou priority: high severity: normal stage: needs patch status: open title: __qualname__ is not present on builtin methods and functions type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13577 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13578] Add subprocess.iter_output() convenience function
New submission from Nick Coghlan ncogh...@gmail.com: subprocess.check_output() is nice, but doesn't help if you want to process the piped data line-by-line. Currently, that means you have to do the full Popen dance if you want access to each line of output as it becomes available. This RFE is for a subprocess.iter_output() module level helper that: 1. Starts the subprocess 2. Yield the individual lines of output as they are produced by the subprocess 3. Cleans up (including checking for errors) at the end This biggest challenge I have noticed so far in exploring this is how to handle timeouts on Windows - on Unix, select.select() can do the job, but that won't handle pipes in the Windows case. -- components: Library (Lib) messages: 149210 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add subprocess.iter_output() convenience function type: feature request versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13578 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13578] Add subprocess.iter_output() convenience function
Changes by Ross Lagerwall rosslagerw...@gmail.com: -- nosy: +rosslagerwall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13578 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Jesús Cea Avión j...@jcea.es added the comment: Alan, I would open a new issue tracking this one and posting a patch there, if I were you. Previous DTRACE attempts failed because trying to make everybody happy. I don't want to repeat the mistake. I am open to modify this code to satisfy systemtap *AFTER* this feature is committed. Same with DTRACE particularities in FreeBSD, MacOS X, etc. You can be sure about my support. Feel free to clone my mercurial repository and track my code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6698] IDLE no longer opens only an edit window when configured to do so
Roger Serwy roger.se...@gmail.com added the comment: Attached is a patch to correct the existing bug as-is. Should the behavior of IDLE be changed as Tal suggests? -- keywords: +patch nosy: +serwy Added file: http://bugs.python.org/file23911/issue6698.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6698 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Jesús Cea Avión j...@jcea.es added the comment: Pending work yet: (documented to avoid forgeting it) - Performance hit because trying to determine the source line in each function call. To be solved with ¿tolerable? memory overhead. Would be acceptable to sacrifice x2/x4 time the pyc filesize (in memory) in order to avoid any runtime performance hit?. That is, a million bytecodes (not a bad program size) could need 2/4 MB. I think it is a good investment if DTRACE becomes performance-transparent. - Build procedure is flaky. I am asking DTrace developers. - DTRACE/GCC offset/bitmasks doesn't coincide. Instead of wiring offsets manually, they should be detected at compile time, automatically. - Add new probes. Suggestions?. What do you want to instrumentalize?. I am thinking about the GIL, module import - Try the code with clang instead of GCC. - Address pending review comments done by Martin v. Löwis. - Use PEP 3155. - Trace C function calls/returns, not only Python ones. The problem here is to know the name of the function, because we can call it in a million different ways. Memorizing the last attribute lookuped is not enough. It seems necessary to memorize some extra metadata at C import. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13579] string.Formatter doesn't understand the !a conversion specifier
New submission from Nick Coghlan ncogh...@gmail.com: As the subject line says: fmt = {0!a} fmt.format(10) '10' import string string.Formatter().format(fmt, 10) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.2/string.py, line 180, in format return self.vformat(format_string, args, kwargs) File /usr/lib/python3.2/string.py, line 184, in vformat result = self._vformat(format_string, args, kwargs, used_args, 2) File /usr/lib/python3.2/string.py, line 210, in _vformat obj = self.convert_field(obj, conversion) File /usr/lib/python3.2/string.py, line 245, in convert_field raise ValueError(Unknown conversion specifier {0!s}.format(conversion)) ValueError: Unknown conversion specifier a -- messages: 149214 nosy: ncoghlan priority: normal severity: normal status: open title: string.Formatter doesn't understand the !a conversion specifier ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13578] Add subprocess.iter_output() convenience function
Nick Coghlan ncogh...@gmail.com added the comment: You can see a version of this here: https://bitbucket.org/ncoghlan/shell_command/src/2b1988b072aa/shell_command.py#cl-157 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13578 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13238] Add shell command helpers to subprocess module
Nick Coghlan ncogh...@gmail.com added the comment: The PyPI package to prototype the API details is now available: http://pypi.python.org/pypi/shell_command http://shell-command.readthedocs.org https://bitbucket.org/ncoghlan/shell_command/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13238 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com