[issue14501] Error initialising BaseManager class with 'authkey' argument of string type.
New submission from Максим Цыпкин drauger...@gmail.com: The following code: class TestServer(BaseManager):pass Server_1=TestServer(address=(127.0.0.1,5),authkey=passkey) produces following error in python 3.2 : TypeError: string argument without an encoding The cause is in BaseManager constructor implementation (Python32\Lib\multiprocessing\managers.py): self._authkey = AuthenticationString(authkey) The AuthenticationString class is a substitute of bytes class, and bytes class requires second encoding argument, if first argument is a string. I've solved this problem, changing the code in Python32\Lib\multiprocessing\managers.py to following: if isinstance(authkey,str): self._authkey = AuthenticationString(authkey,'utf-8') else: self._authkey = AuthenticationString(authkey) This works for me. Please consider to fix this issue in release. -- components: Extension Modules messages: 157539 nosy: Drauger priority: normal severity: normal status: open title: Error initialising BaseManager class with 'authkey' argument of string type. type: crash versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14492] pdeps.py has_key
Georg Brandl ge...@python.org added the comment: Should be x not in y BTW to be idiomatic, not not x in y. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14492 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14497] Invalid syntax Python files in Python sources tree
Georg Brandl ge...@python.org added the comment: Yes, Sphinx is still 2.x, although we could switch to a Python 3 version since now all necessary dependencies are ported. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14497 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14489] repr() function link on the built-in function documentation is incorrect
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4416efeb0163 by Georg Brandl in branch '2.7': Closes #14489: correct link target. http://hg.python.org/cpython/rev/4416efeb0163 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14489] repr() function link on the built-in function documentation is incorrect
Georg Brandl ge...@python.org added the comment: Shows how it's a bad thing to have a builtin function and a module of the same name :) -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
New submission from Georg Brandl ge...@python.org: From d...@python.org: I recently ran into a situation where I could not be certain that a lock was currently in the acquired state. I checked the documentation to determine what would happen if I attempted to release a lock that was already released, and saw an ominous warning of Do not call this method when the lock is unlocked. Needing to know what would happen, I cautiously tested it out. I half expected my computer to explode as I released a lock for the second time, but was pleased to see it raise a 'thread.error' exception which could be caught and handled. I generally expect the documentation to tell me what will happen if I do something invalid. In this case the documentation should indicate that a thread.error will be raised if you release an unlocked lock. I agree: if we know that a ThreadError will always be raised in this instance, we should document it as such. -- assignee: docs@python components: Documentation messages: 157544 nosy: docs@python, georg.brandl, pitrou priority: normal severity: normal status: open title: Document better what happens on releasing an unacquired lock versions: Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14486] Add some versionchanged notes in threading docs
Georg Brandl ge...@python.org added the comment: +1. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14486 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14492] pdeps.py has_key
Popa Claudiu pcmantic...@gmail.com added the comment: Hello. Here is the new patch. There was a few more problems: 1. in process, fp wasn't closed 2. in process, m_import.match(line) = 0 could fail if the regular expression didn't matched on that line I've included the tests, too. -- Added file: http://bugs.python.org/file25128/pdeps2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14492 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Sandro Tosi sandro.t...@gmail.com added the comment: On Thu, Apr 5, 2012 at 09:06, Georg Brandl rep...@bugs.python.org wrote: I agree: if we know that a ThreadError will always be raised in this instance, we should document it as such. I've already prepared a small patch for that (every supported release has a different exception raised..) I'll be fixing it this evening at home. -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Georg Brandl ge...@python.org added the comment: What different exceptions are they? Note that thread.error == _thread.error == threading.ThreadError. The docs should always use the last one (ThreadError). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Georg Brandl ge...@python.org added the comment: Ah, and I missed that apparently on 3.3, _thread.Error is aliased to RuntimeError. In that case you should use RuntimeError of course :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant
Rik Poggi poggi.ri...@gmail.com added the comment: Hi, I'd like to contribute to this bug if it's possible. I would've directly started, but it seems the situation has moved/changed a bit, so I'm not sure where the tests are needed. There's a try/except, like the one mentioned above, in pypi/dist.py. Was that a consequence of this bug? Are tests needed for that conversion? The sdist command seems to be not complaining about any kind of irrational/invalid version. Should this be fixed? Should sdist check for a valid version number and do something like what Éric Araujo mentioned in the last comment? -- nosy: +rik.poggi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
New submission from Ramchandra Apte maniandra...@gmail.com: In http://docs.python.org/dev/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator , two code samples -- assignee: docs@python components: Documentation messages: 157551 nosy: docs@python, ramchandra.apte priority: normal severity: normal status: open title: docs:Code not highlighted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
Ramchandra Apte maniandra...@gmail.com added the comment: Whoops - In http://docs.python.org/dev/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator , two code samples are not highlighted. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14478] Decimal hashing very slow, could be cached
Ramchandra Apte maniandra...@gmail.com added the comment: I recommend that __hash__ should use functools.lru_cache for caching. -- nosy: +ramchandra.apte ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14478 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14321] Do not run pgen during the build if files are up to date
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- resolution: - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14321 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14504] Suggestion to improve argparse's help messages for store_const
New submission from Amnon Harel amnon.ha...@cern.ch: argparse's help messages for variables that use store_const can probably be improved: - propagate the default to all the options - mark the default option as such explicitly - group the keywords that have the same destination together (?) - place the default option first (?) For example, wouldn't the attached .py be better served with a help message that looks like: ... optional arguments: -h, --help show this help message and exit -w, --wrench use a wrench (default) -H, --hammer use a hammer (default: wrench) -s, --screwdriver use a screwdriver (default: wrench) -T, --tnt just blow the whole thing up (default: wrench) --foo FOO foo bar (default: None) ? -- components: Library (Lib) files: demo.py messages: 157554 nosy: Amnon.Harel priority: normal severity: normal status: open title: Suggestion to improve argparse's help messages for store_const type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file25129/demo.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14504 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
New submission from Matthias Klose d...@debian.org: [forwarded from http://bugs.debian.org/664529] seen with 2.7.3 rc2 File descriptors opened by PyFile_FromString don't get closed when the reference count is decreased. Here's my test program, pythony.c: #include Python.h int main() { int i = 0; PyObject *obj; Py_Initialize(); while (i++ 5) { obj = PyFile_FromString(hello.py, r); assert(obj); Py_DECREF(obj); } Py_Finalize(); } hello.py is 'print(hello world)'. I'm compiling it with both Python 2.6 and 2.7. $ gcc pythony.c -lpython2.6 -L/usr/lib/python2.6/config -I/usr/include/python2.6/ -o pythony-2.6 $ gcc pythony.c -lpython2.7 -L/usr/lib/python2.7/config -I/usr/include/python2.7/ -o pythony-2.7 $ strace ./pythony-2.6 21 | tail -n 20 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffb1d097b0) = -1 EINVAL (Invalid argument) ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffb1d097b0) = -1 EINVAL (Invalid argument) open(hello.py, O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 close(3)= 0 open(hello.py, O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 close(3)= 0 open(hello.py, O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 close(3)= 0 open(hello.py, O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 close(3)= 0 open(hello.py, O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 close(3)= 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7f1e1a0224f0}, {0x7f1e1a49a160, [], SA_RESTORER, 0x7f1e1a0224f0}, 8) = 0 exit_group(0) = ? $ strace ./pythony-2.7 21 | tail -n 20 fstat(4, {st_mode=S_IFREG|0644, st_size=1950, ...}) = 0 read(4, , 4096) = 0 close(4)= 0 munmap(0x7fa41f10f000, 4096)= 0 close(3)= 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x77bd33f0) = -1 EINVAL (Invalid argument) ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x77bd33f0) = -1 EINVAL (Invalid argument) open(hello.py, O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 open(hello.py, O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 open(hello.py, O_RDONLY) = 5 fstat(5, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 open(hello.py, O_RDONLY) = 6 fstat(6, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 open(hello.py, O_RDONLY) = 7 fstat(7, {st_mode=S_IFREG|0644, st_size=21, ...}) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7fa4206e24f0}, {0x7fa420b8dd50, [], SA_RESTORER, 0x7fa4206e24f0}, 8) = 0 exit_group(0) = ? The Python 2.7 version never calls close, not even at Py_Finalize(). On #d-d, jwilk suspected that this change might be the cause: http://hg.python.org/cpython/rev/0f5b64630fda/#l4.46 -- components: Interpreter Core messages: 157555 nosy: doko priority: high severity: normal status: open title: PyFile_FromString leaks file descriptors in python 2.7 versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
Changes by Matthias Klose d...@debian.org: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3033] tkFont added displayof where necessary
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 774c2afa6665 by Andrew Svetlov in branch 'default': Issue #3033: Add displayof parameter to tkinter font. http://hg.python.org/cpython/rev/774c2afa6665 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3033 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3033] tkFont added displayof where necessary
Andrew Svetlov andrew.svet...@gmail.com added the comment: Closing as fixed -- assignee: - asvetlov resolution: - fixed stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3033 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3033] tkFont added displayof where necessary
Andrew Svetlov andrew.svet...@gmail.com added the comment: Thanks to Guilherme Polo. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3033 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6225] Fixing several minor bugs in Tkinter.Canvas and one in Misc._configure
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6225 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6167] Tkinter.Scrollbar: the activate method needs to return a value, and set should take only two args
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6167 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
STINNER Victor victor.stin...@gmail.com added the comment: File descriptors opened by PyFile_FromString don't get closed when the reference count is decreased. Correct, PyFile_FromString() doesn't close the file descriptor, even if you call its close() method. You have to call manually fclose(file-f_fp). Or you can use PyFile_FromFile: fp = fopen(name, mode); if (fp == NULL) ... obj = PyFile_FromFile(fp, name, mode, fclose); if (obj == NULL) { /* no need to call fclose(fp) here, it's done by PyFile_FromFile() */ ... } ... Py_DECREF(obj); Would you like to write a patch for the documentation? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
Antoine Pitrou pit...@free.fr added the comment: Victor, that sounds like a strange behaviour to me. PyFile_FromString is a public API and maybe it shouldn't have changed between 2.6 and 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
STINNER Victor victor.stin...@gmail.com added the comment: Victor, that sounds like a strange behaviour to me. We may change PyFile_FromString() to call fclose() when the file is closed explicitly (call its close() method), but it may break backward compatibility. I prefer to document the behaviour instead. PyFile_FromString is a public API and maybe it shouldn't have changed between 2.6 and 2.7. PyFile_FromString() didn't change in Python 2.7. I changed PyFile_FromFile() in Python 2.7 to fix the issue #7732. changeset: 72456:0f5b64630fda branch: 2.7 parent: 72450:c02e790c4535 user:Victor Stinner victor.stin...@haypocalc.com date:Fri Sep 23 19:37:03 2011 +0200 files: Doc/c-api/file.rst Lib/test/test_import.py Misc/NEWS Objects/fileobject.c Python/import.c description: Issue #7732: Fix a crash on importing a module if a directory has the same name than a Python module (e.g. __init__.py): don't close the file twice. PyFile_FromFile() does also close the file if PyString_FromString() failed. It did already close the file on fill_file_fields() error (e.g. if the file is a directory). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14417] dict RuntimeError workaround
STINNER Victor victor.stin...@gmail.com added the comment: A counter can be added to dictobject.c.patch to avoid an infinite loop. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
Antoine Pitrou pit...@free.fr added the comment: Victor, what exactly are you talking about? http://hg.python.org/cpython/rev/0f5b64630fda/ *does* change PyFile_FromString. And Matthias mentioned that the problem didn't occur with 2.6. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14222] Use time.steady() to implement timeout
STINNER Victor victor.stin...@gmail.com added the comment: Why do you think monotonic time is needed for the Queue module? The duration of a timeout of N seconds should be N seconds even if the system clock is updated (e.g. a daylight saving time (DST) change). This feature is checked by an unit test in the patch attached to the isuse #14428 (implementation of the PEP 418): +def test_monotonic_settime(self): +t1 = time.monotonic() +realtime = time.clock_gettime(time.CLOCK_REALTIME) +# jump backward with an offset of 1 hour +time.clock_settime(time.CLOCK_REALTIME, realtime - 3600) +t2 = time.monotonic() +time.clock_settime(time.CLOCK_REALTIME, realtime) +# monotonic must not be affected by system clock updates +self.assertGreaterEqual(t2, t1) You can imagine a similar patch for Queue timeout. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14222] Use time.steady() to implement timeout
STINNER Victor victor.stin...@gmail.com added the comment: You can imagine a similar patch for Queue timeout. Oops: You can imagine a similar *test* for Queue timeout. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 2c514c382a2a by Victor Stinner in branch 'default': Close #14249: Use an union instead of a long to short pointer to avoid aliasing http://hg.python.org/cpython/rev/2c514c382a2a -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
STINNER Victor victor.stin...@gmail.com added the comment: Result of the benchmark before/after my commit. I prefer an unit over manually manipulate long as short or bytes, because I think that the compiler knows better how to optimize operations on integers. unpatched: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 4.64 usec per loop $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = (\u263A * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 5.87 usec per loop patched: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 3.53 usec per loop $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = (\u263A * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 4.85 usec per loop -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14227] console w/ cp65001 displays extra characters for non-ascii strings.
STINNER Victor victor.stin...@gmail.com added the comment: I'm quite sure that this issue is a duplicate of #1602. -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14227 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print or input Unicode
STINNER Victor victor.stin...@gmail.com added the comment: The issue #14227 has been marked as a duplicate of this issue. Copy of msg155149: This is on Windows 7 SP1. Run 'chcp 65001' then Python from a console. Note the extra characters when non-ASCII characters are in the string. At a guess it appears to be using the UTF-8 byte length of the internal representation instead of the character count. Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. print('hello') hello print('p\u012bny\u012bn') pīnyīn n print('\u012b'*10) īī � �ī -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14506] HTMLParser can't handle erronous end tags with additional tags in it
New submission from Olaf Tomalka olaf.toma...@gmail.com: While this is wrongly formated html, I've spotted such an example on real website on the web, and all browsers handle the bad tag gracefully, while the python html parser throws an exception with bad end tag, I think additional info in end tag should be ignored, no exception thrown and rest of the page parsed. I'm including minimal example. -- components: Library (Lib) files: minimal.py messages: 157570 nosy: ritave priority: normal severity: normal status: open title: HTMLParser can't handle erronous end tags with additional tags in it type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file25130/minimal.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14506 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9141] Allow objects to decide if they can be collected by GC
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a completely new patch. This approach uses the already existing tp_is_gc enquiry slot to signal garbage collection. The patch modifies the generator object to use this new mechanism. The patch keeps the old PyGen_NeedsFinalizing() API, but this can now go away, unless people think it might be used in extension modules (why do we always expose all those internal apis from the dll? I wonder.) -- Added file: http://bugs.python.org/file25131/ob_is_gc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14452] SysLogHandler sends invalid messages when using unicode
marko kreen mark...@gmail.com added the comment: The 'msg' in SysLogHandler does not correspond to MSG in RFC. Nor to %(message)s in log record. RFC: SYSLOG-MSG = HEADER SP STRUCTURED-DATA [SP MSG] HEADER = PRI VERSION SP TIMESTAMP SP HOSTNAME SP APP-NAME SP PROCID SP MSGID PRI = PRIVAL [...] MSG = MSG-ANY / MSG-UTF8 MSG-ANY = *OCTET ; not starting with BOM MSG-UTF8= BOM UTF-8-STRING BOM = %xEF.BB.BF logging: The SysLogHandler does not provide any fields after PRI. Which is OK, those can be added via format string. We are using following formatter to get RFC-like structure to message: [formatter_syslog] format=%(hostname)s %(service_name)s %(job_name)s %(message)s That's not fully compliant, but that's beside the point. The problem is that SysLogHandler puts BOM before hostname not before %(message)s. In Python 2.6 it put it even before PRI, which was even more annoying. I see 2 solutions to this: 1) Stop putting BOM at all, its not necessary. 2) Put the BOM into %(message)s somehow, thus working with whatever format is given. -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14452 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14386] Expose dict_proxy internal type as types.MappingProxyType
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Expose dict_proxy internal type as types.MappingViewType - Expose dict_proxy internal type as types.MappingProxyType ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9141] Allow objects to decide if they can be collected by GC
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14385] Support other types than dict for __builtins__
STINNER Victor victor.stin...@gmail.com added the comment: New version: - if __build_class__ is missing, raise a NameError instead of surprising ImportError - add tests - if PyObject_GetItem on __builtins__ or globals fail, only raise NameError if the exception is a KeyError Before my patch, a new dict was created for builtins if __builtins__ exists in global but is not a dict. With my patch, the __builtins__ is kept and the type is checked at runtime. If __builtins__ is not a mapping, an exception is raised on lookup in ceval.c. We may check __builtins__ type in PyFrame_New() using: PyDict_Check(builtins) || (PyMapping_Check(mapping) !PyList_Check(mapping) !PyTuple_Check(mapping)) (PyDict_Check(builtins) is checked first for performance) -- Added file: http://bugs.python.org/file25132/builtins-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14385 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 8258e5fa4a19 by Antoine Pitrou in branch '2.7': Issue #14505: Fix file descriptor leak when deallocating file objects created with PyFile_FromString(). http://hg.python.org/cpython/rev/8258e5fa4a19 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
Antoine Pitrou pit...@free.fr added the comment: Matthias, this should be fixed now. -- resolution: - fixed stage: - committed/rejected status: open - closed type: - resource usage ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14506] HTMLParser can't handle erronous end tags with additional info in them
Changes by Olaf Tomalka olaf.toma...@gmail.com: -- title: HTMLParser can't handle erronous end tags with additional tags in it - HTMLParser can't handle erronous end tags with additional info in them ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14506 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14507] Segfault with starmap and izip combo
New submission from Per Myren progr...@gmail.com: The following code crashes with a segfault on Python 2.7.2: from operator import add from itertools import izip, starmap a = b = [1] for i in xrange(10): a = starmap(add, izip(a, b)) list(a) It also crashes with Python 3.2.2: from operator import add from itertools import starmap a = b = [1] for i in range(10): a = starmap(add, zip(a, b)) list(a) -- components: Library (Lib) messages: 157576 nosy: progrper priority: normal severity: normal status: open title: Segfault with starmap and izip combo type: crash versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14507 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14501] Error initialising BaseManager class with 'authkey' argument of string type.
R. David Murray rdmur...@bitdance.com added the comment: Thanks for the report. I'm not familiar with multiprocessing, so I'll have to leave it to someone else to judge the fix. We use 'crash' to indicate a segfault in the Python interpreter, so I'm changing the type to 'behavior' (that is, a normal bug). -- nosy: +asksol, r.david.murray type: crash - behavior versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14507] Segfault with starmap and izip combo
Antoine Pitrou pit...@free.fr added the comment: Apparently it's a stack overflow between zip_next and starmap_next. -- nosy: +pitrou, rhettinger versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14507 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
R. David Murray rdmur...@bitdance.com added the comment: I'm not seeing any unhighlighted examples in that section. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14504] Suggestion to improve argparse's help messages for store_const
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +bethard versions: +Python 3.3 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14504 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14508] gprof2html is broken
New submission from Popa Claudiu pcmantic...@gmail.com: Tools/gprof2html.py uses file to open a file. Also, the opened file passed to add_escapes was never closed. There's a test included in the patch. -- components: Demos and Tools files: gprof.patch keywords: patch messages: 157580 nosy: Popa.Claudiu priority: normal severity: normal status: open title: gprof2html is broken type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file25133/gprof.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14508 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant
Rik Poggi poggi.ri...@gmail.com added the comment: Strictly related or not to this bug, a bit more test coverage shouldn't hurt. So while waiting for a reply I started writing a couple of tests for pypi/dist.py, hope they look good. -- Added file: http://bugs.python.org/file25134/test_pypi_dist.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14506] HTMLParser can't handle erronous end tags with additional info in them
R. David Murray rdmur...@bitdance.com added the comment: Which version of python did you test with? There have been several improvements html parsing recently. -- nosy: +ezio.melotti, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14506 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14506] HTMLParser can't handle erronous end tags with additional info in them
Olaf Tomalka olaf.toma...@gmail.com added the comment: Python 3.2.2, which is latest on arch linux -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14506 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
Berker Peksag berker.pek...@gmail.com added the comment: I can reproduce. See screenshot.png. -- nosy: +berker.peksag Added file: http://bugs.python.org/file25135/screenshot.png ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14506] HTMLParser can't handle erronous end tags with additional info in them
R. David Murray rdmur...@bitdance.com added the comment: I just tested your script on 3.2.3a2+, and it raises an error. Ezio made the other parsing changes, I'll leave it to him to evaluate what if anything should be done here. -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14506 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14509] Build failures in non-pydebug builds without NDEBUG.
New submission from Thomas Wouters tho...@python.org: The hash randomization change conflates 'pydebug' builds (which define the 'Py_DEBUG' preprocessor symbol) and asserts (which use 'NDEBUG' instead.) While Py_DEBUG automatically unsets NDEBUG, the inverse is not true (and should not be true.) In random.c (and Include/object.h), _Py_HashSecret_Initialized is defined as static or global depending on the value of Py_DEBUG. But in (at least) Objects/stringobject.c and Objects/unicodeobject.c, unguarded asserts are used that check the value of _Py_HashSecret_Initialized. This causes builds that define neither NDEBUG nor Py_DEBUG to fail. Either the guard used around the declaration and definition should be '#ifndef NDEBUG' instead of '#ifdef Py_DEBUG', or there should be a Py_DEBUG guard around the two assert statements. (I would submit a patch but my development environment died during a nasty power outage yesterday.) -- components: Interpreter Core messages: 157586 nosy: benjamin.peterson, twouters priority: release blocker severity: normal status: open title: Build failures in non-pydebug builds without NDEBUG. type: compile error versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14509 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
R. David Murray rdmur...@bitdance.com added the comment: Berker: you can reproduce the bug, or the fact that they are highlighted? The png looks like they are highlighted, so I assume the latter. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14510] Regular Expression + perform wrong repeat
New submission from YunJian tld...@yahoo.com.cn: Regular expression perform wrong result, I use regular expression r'(\$.)+' try to match $B$b or something like that, but the script only give back $b, r'(\$.){1,}', r'(\$.){2}' performed the same, you can take the file I attached for reference and run it, I try to solve it myself but failed, now I must use other ways to realize my aim, so appreciate for you help, thank you! -- components: Regular Expressions files: CheckInconsistency.py messages: 157588 nosy: ezio.melotti, mrabarnett, tld5yj priority: normal severity: normal status: open title: Regular Expression + perform wrong repeat type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file25136/CheckInconsistency.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14510 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: they are highlighted No. Keywords normally appear in bold font, and with another color. This is not the case in these blocks. Probably because the language detection does not work with the new yield from construct. Sphinx should always use the latest Python... -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14496] Wrong name in idlelib/tabbedpages.py
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f2dfe0ca6c21 by Andrew Svetlov in branch '3.2': Issue #14496: Fix wrong name in idlelib/tabbedpages.py. http://hg.python.org/cpython/rev/f2dfe0ca6c21 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14496 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14496] Wrong name in idlelib/tabbedpages.py
Andrew Svetlov andrew.svet...@gmail.com added the comment: Fixed. Thanks. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14496 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1542677] IDLE shell gives different len() of unicode strings compared to Python shell
Andrew Svetlov andrew.svet...@gmail.com added the comment: Closing as won't fix. -- assignee: kbk - asvetlov nosy: +asvetlov resolution: - wont fix stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1542677 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
R. David Murray rdmur...@bitdance.com added the comment: Ah, you mean they are not *syntax* highlighted. Now I understand. Sorry for missing that. My understanding is that Sphinx does not use Python directly to parse the code and highlight it, it uses pygments, which uses regexes. So this basically amounts to a feature request for pygments. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1047540] Turtle.py hangs Idle
Andrew Svetlov andrew.svet...@gmail.com added the comment: Closing as not reproducible for 3.3. The bug is too minor to worry about 2.7 and 3.2 even if it present (all works for me by the way). Please reopen if you will get described issue. -- assignee: - asvetlov nosy: +asvetlov resolution: - out of date stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1047540 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Not exactly. Sphinx first tries to see if the block is a Python script, and to do so it uses the Python compiler: https://bitbucket.org/birkenfeld/sphinx/src/164f59b2d946/sphinx/highlighting.py#cl-117 In case of SyntaxError, it treats the whole block as plain text and does not try to use pygmentq at all. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14503] docs:Code not highlighted
R. David Murray rdmur...@bitdance.com added the comment: Huh. Well, in another issue Georg said it was now possible to upgrade the doc build toolchain to Python3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14503 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14452] SysLogHandler sends invalid messages when using unicode
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Ok, I see what the problem is. I could go for option 1 - leave the BOM out, encode the string as UTF-8 but send it as just a bunch of bytes, i.e. the MSG-ANY variant of the spec. However, this could break any existing code that doesn't use structured data before the message, as you are doing, and relies on the MSG-UTF8 variant. So while agreeing with you that the situation isn't ideal, I don't see how I can change things while preserving backward compatibility, other than: Introduce a class-level _insert_BOM attribute, defaulting to True but which can be set to False on a per-instance level. The BOM would only be inserted if this were True, so the current behaviour is preserved, but you could set the attribute to False and leave the BOM out. However, isn't ideal either, as it requires you to be sensitive to the exact version of Python in use - not easy if you're developing a library rather than an application. I will consider a different approach in 3.3, e.g. provide one or more overridable methods to construct the message sent across the socket. Thoughts? If these methods won't suffice, you can always resort to subclassing the handler and overriding the emit method (not that that's ideal, either). -- resolution: invalid - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14452 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14452] SysLogHandler sends invalid messages when using unicode
marko kreen mark...@gmail.com added the comment: Note additional brokenness in BOM addition: * It does add BOM even when msg is ascii, just because it was in unicode() string. * It does not add BOM to UTF8 string if it is already encoded to str(). So highly doubt anybody actually relies on it. And keeping such addition just increases chance that anybody starts to rely on it, so it would be good to just drop it. For 3.3, I think it would be best to move syslog packet formatting out from emit(), because emit() already contains noticeable amount of unrelated code, so full override it is annoying. I suggested changing BOM addition so that it only adds it to %(message)s, but such change could cause backwards incompatibility. So it does not look like good idea. But dropping BOM even in old Python *does* look like good idea, as anybody using SysLoghandler needs to deal with BOM-less UTF8 anyway, so dropping it will not create backwards incompatibility. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14452 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14511] _static/opensearch.xml for Python 3.2 docs directs searches to 3.3 docs
New submission from Zachary Ware zachary.w...@gmail.com: Adding the search plugin for the 3.2 docs to Firefox and then searching from it returns results from the 3.3 dev docs, despite everything saying it should be for searching Python v3.2.2 documentation. If my understanding of how it all works is correct, the attached patch should fix the issue. It simply removes 'dev/' from the html_use_opensearch assignment in Doc\conf.py in the 3.2 branch. Thanks, Zach -- assignee: docs@python components: Documentation files: 3.2 conf.py opensearch.diff keywords: patch messages: 157599 nosy: docs@python, eric.araujo, ezio.melotti, georg.brandl, zach.ware priority: normal severity: normal status: open title: _static/opensearch.xml for Python 3.2 docs directs searches to 3.3 docs type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file25137/3.2 conf.py opensearch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14510] Regular Expression + perform wrong repeat
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: If a capture group is repeated, as in r'(\$.)+', only its last match is returned. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14510 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14506] HTMLParser can't handle erronous end tags with additional info in them
Ezio Melotti ezio.melo...@gmail.com added the comment: This is already fixed, but only in non-strict mode (and 3.2.3 iirc). You should always use HTMLParser(strict=False). The non-strict mode will probably become the default and strict=True will be deprecated. Thanks anyway for the report, and please report any failure that you might find with strict=False. -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14506 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant
Éric Araujo mer...@netwok.org added the comment: Thanks for the tests! I should have some time this week-end to review them and explain clearly what this bug is about and where tests should go. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14478] Decimal hashing very slow, could be cached
James Hutchison jamesghutchi...@gmail.com added the comment: I presume you mean in 3.2? Have you looked at the source code for that decorator? It's fundamentally a try/except but with a lot more unnecessary bloat than is needed for caching a single int result from a function with no arguments. Its actually a lot slower. If this is likely going to see use in 3.3 then it would probably just be a long int since 3.3 uses C. 0 would indicate uncalculated. Hash function would have to be set up to never return 0. Also every function would need to be tested to make sure there isn't any in-place modification of the Decimal object that could alter the hash value. I like how the cached hash in 3.3 is faster than int for hashing. Shouldn't an int just return itself? Why would it be slower? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14478 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14417] dict RuntimeError workaround
Guido van Rossum gu...@python.org added the comment: A counter can be added to dictobject.c.patch to avoid an infinite loop. But why bother? There was no counter originally -- it would continue until it ran out of stack. Since this can only be triggered if there is Python code in the __eq__, that means that it is still interruptable with ^C. Does this mean I should just check it in? But I asked, and never got an answer, whether the original stress test had been converted into a unittest. I'd like that to happen before I check this in. Also there are probably docs I've missed. Somebody please help! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14417] dict RuntimeError workaround
Antoine Pitrou pit...@free.fr added the comment: Does this mean I should just check it in? But I asked, and never got an answer, whether the original stress test had been converted into a unittest. I'd like that to happen before I check this in. Also there are probably docs I've missed. Somebody please help! I think your approach is fine. As far as I can tell, the original crasher hasn't been converted into an unit test, since Victor's test in 934aaf2191d0 doesn't seem prone to triggering an infinite loop. As far as doc changes go, you should probably remove the what's new entry from a428f85de29c, and the doc addition from 0255bafbccf2. Besides, does the test suite pass with your patch? It looks like Victor's test, which checks that RuntimeError is raised, should now fail. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14512] Pydocs module docs server not working on Windows.
New submission from Terry J. Reedy tjre...@udel.edu: 3.2.3rc2 and 3.3.0a2, freshly downloaded and installed, Win7, 64 bit Start Menue/Pythonxx/Module Docs Brings up tkinter pydoc box. [open browser] brings up *empty* localhost:7464 window. Search 'tkinter' and double-click tkinter entry or select and [go to selected] opens empty localhost:7464/tkinter.html window. This worked sometime last year on earlier 3.2, maybe on xp box. I thought there might be an issue already, but I searched for 'pydoc' and 'modole docs' and found nothing. -- assignee: docs@python components: Documentation, Installation, Library (Lib) messages: 157606 nosy: docs@python, georg.brandl, loewis, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Pydocs module docs server not working on Windows. type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14512 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14505] PyFile_FromString leaks file descriptors in python 2.7
STINNER Victor victor.stin...@gmail.com added the comment: Victor, what exactly are you talking about? http://hg.python.org/cpython/rev/0f5b64630fda/ *does* change PyFile_FromString. Oh. I don't know (remember) why I did this change!? I suppose that I changed it to test something and then forget to remove the temporary hack :-/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True
Andrew Svetlov andrew.svet...@gmail.com added the comment: What's about test which pass bytes to Popen? Should it be deprecated and should Popen accept only unicode strings only — I mean `str` type? As I know the trend of py3k to get rid of bytes in filesystem names. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7839 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8515] idle Run Module (F5) does not set __file__ variable
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 2c276d0553ff by Andrew Svetlov in branch 'default': Issue #8515: Set __file__ when run file in IDLE. http://hg.python.org/cpython/rev/2c276d0553ff -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8515] idle Run Module (F5) does not set __file__ variable
Andrew Svetlov andrew.svet...@gmail.com added the comment: Thanks to all. Bruce Frederiksen, you are mentioned in Misc/ACK Tal Einat, if you want to make a patch which will use `execfile` instead of current approach — you are welcome. Please file new issue. -- assignee: - asvetlov resolution: - fixed stage: - committed/rejected status: open - closed versions: -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14509] Build failures in non-pydebug builds without NDEBUG.
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14509 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14513] IDLE icon switched and switches on Windows taskbar
New submission from Terry J. Reedy tjre...@udel.edu: IDLE has an icon that is, appropriately, a white page with text overlaid with the Python logo on lower right. (Module docs uses the same icon.) For a long time, this has been used everywhere for IDLE -- start menu, desktop, taskbar. In the latest 3.2.3rc2 and 3.3.0a2 releases, the Windows 7 taskbar icon for IDLE is the red Tk icon. If IDLE is pinned to the taskbar, the icon changes to the command-prompt + logo python-pythonw icon. This seems to be new in these releases and is confusing and annoying. Otherwise, the IDLE icon is as it was. -- components: Installation, Windows messages: 157611 nosy: georg.brandl, loewis, terry.reedy priority: normal severity: normal status: open title: IDLE icon switched and switches on Windows taskbar versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14513 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
Serhiy Storchaka storch...@gmail.com added the comment: What compiler are you using? With gcc 4.4 on 32-bit Linux netbook I get: unpatched union shift utf-16le *1 129 126109 utf-16le \u263A*1208 203160 utf-16be *1 153 147114 utf-16be \u263A*1226 227167 The difference is that for shift the compiler stores block in register, and for the union the compiler stores block in memory, so that it can get address. May be more recent compilers learned to do this more effectively? Besides, shifts are more pronounced for CPython code, searching shows very few uses of union in the source code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True
R. David Murray rdmur...@bitdance.com added the comment: No, you need to be able to pass bytes to Popen, just like you do to the os.exec[xx] functions. When the OS doesn't fully support unicode, that is sometimes the only option. As for filenames; again, as long as the underlying systems use bytes filenames we need to support it. Currently we encode them when received using surrogateescape and decode them back to bytes when used. I am not sure what os.exec[xx] does with strings containing non-ascii. Presumably it uses some default encoding or other, which seems to be utf-8 on my system. (It doesn't seem to be explicitly documented where those functions are discussed in the os module.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7839 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
Stefan Krah stefan-use...@bytereef.org added the comment: On 64-bit Linux with gcc-4.4 I get: Unpatched: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 4.1 usec per loop $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = (\u263A * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 5.87 usec per loop 2c514c382a2a: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 3.68 usec per loop $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = (\u263A * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 4.72 usec per loop utf16_decoder_shift_3.patch: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 2.23 usec per loop $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = (\u263A * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 3.11 usec per loop -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
Antoine Pitrou pit...@free.fr added the comment: Linux, 64-bit, Intel Core i5 2500: - unpatched: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 2.99 usec per loop - Victor's commit: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 10 loops, best of 3: 2.83 usec per loop - utf16_decoder_shift_3.patch: $ ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ( * 1000).encode(utf-16be)' 'd(x)' 100 loops, best of 3: 1.88 usec per loop It seems that the wrong patch was committed. -- assignee: - haypo resolution: fixed - stage: committed/rejected - commit review status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14417] dict RuntimeError workaround
Jim Jewett jimjjew...@gmail.com added the comment: A counter can be added to dictobject.c.patch to avoid an infinite loop. But why bother? Without a termination condition, how is this different from just reverting the original change? Is it just the slightly improvement in efficiency? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14417] dict RuntimeError workaround
Antoine Pitrou pit...@free.fr added the comment: Without a termination condition, how is this different from just reverting the original change? The difference is that it's a (presumably interruptible) infinite loop, not a stack overflow. There's no crash and therefore no security issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14386] Expose dict_proxy internal type as types.MappingProxyType
Raymond Hettinger raymond.hettin...@gmail.com added the comment: [Victor] '''Oh, collections.abc contains also the mappingview type exposed with the name dict_proxy: dict_proxy = type(type.__dict__) It was exposed as _abcoll.dict_proxy in Python 3.2. It is not documented. Should we keep it for backward compatibility, or can it be removed? _abcoll was a private module and I didn't find dict_proxy in Python 3.2 doc. ''' You can ignore those. As you saw, these are undocumented and not listed in __all__. If we ever expose these, it will likely be through the types module (or less likely through the collections.abc module which is public in 3.3). Probably, they won't get exposed at all because they are awkward to access directly and because they have implementation specific details (i.e. other implementations have their choice of how to implement various iterators and whatnot). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14386] Expose dict_proxy internal type as types.MappingProxyType
STINNER Victor victor.stin...@gmail.com added the comment: You can ignore those. You mean that I can remove it? It's a little bit surprising to find a concrete class in collections.abc. So I think that it's better to expose dict_proxy in types than in collections.abc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7057] tkinter doc: more 3.x updates
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- assignee: gpolo - asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 489f252b1f8b by Victor Stinner in branch 'default': Close #14249: Use bit shifts instead of an union, it's more efficient. http://hg.python.org/cpython/rev/489f252b1f8b -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9141] Allow objects to decide if they can be collected by GC
Jim Jewett jimjjew...@gmail.com added the comment: I think the second patch is a fairly straightforward enhancement to the existing situation. It still feels a bit like an awkward half-measure, though. (1) If a class does have a finalizer, instances should still be able to say Go ahead and collect me, I don't happen to be in the problematic state. (In other words, there should be a return value that means not to bother checking for the existence of a tp_del / __del__ method.) (2) It should be explicit whether or not this is: (2a) just an inquiry (If you were in a cycle, could I collect you?), (2b) a statement plus inquiry (You are in a cycle. Can I collect you?), or (2c) a request (You are in a cycle, and I would like to collect you. Clean up if you can, then tell me whether you are still uncollectable.) (3) It may be worth adding an additional slot for safe idempotent finalizers. (Earlier suggestions called this __close__, but I suppose __finalize__ might be more general.) Once a garbage cycle is detected, go ahead and call that slot's method before giving up and sticking the whole thing in garbage. If python classes could also fill this slot, it would look a lot like (2c). -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
STINNER Victor victor.stin...@gmail.com added the comment: Ok, benchmarks have spoken, amen. I applied Serhiy Storchaka's patch (version 3). I just replaced expressions in calls to Py_MAX by variables: Py_MAX is a macro and it may have to compute each expression twice. I didn't check if it's more or less efficient. Thanks Serhiy for your contribution! I added your name to Misc/ACKS. We may change Py_MIN/Py_MAX to something more efficient using typeof(): #define max(a,b) \ ({ typeof (a) _a = (a); \ typeof (b) _b = (b); \ _a _b ? _a : _b; }) I don't know which C compilers support it, but gcc does, at least. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset efeca6ff2751 by Sandro Tosi in branch '2.7': Issue #14502: release() and unlocked lock generates a ThreadError http://hg.python.org/cpython/rev/efeca6ff2751 New changeset acea9d95a6d8 by Sandro Tosi in branch '3.2': Issue #14502: release() and unlocked lock generates a ThreadError http://hg.python.org/cpython/rev/acea9d95a6d8 New changeset c10a0f93544e by Sandro Tosi in branch 'default': Issue #14502: merge with 3.2 http://hg.python.org/cpython/rev/c10a0f93544e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Changes by Sandro Tosi sandro.t...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14249] unicodeobject.c: aliasing warnings
Serhiy Storchaka storch...@gmail.com added the comment: I just replaced expressions in calls to Py_MAX by variables: Py_MAX is a macro and it may have to compute each expression twice. gcc computes those values only once. It even caches them for use in PyUnicode_WRITE. But other compilers may not be so smart. Instead of Py_MAX(a,b) here you can use a|b. In theory this should be more efficient, but I couldn't see the difference even with microscope. However, all this does not matter, soon I will submit complex patch, which speeds up the utf-16 decoder in 2-5 times. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Jim Jewett jimjjew...@gmail.com added the comment: At least put the information inside some disclaimers about normally; even the stdlib has some fake locks that let you release a lock someone else holds. (I think I found them in in workarounds for threading not being available, such as the dummy_* modules, but still, it is possible.) -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Antoine Pitrou pit...@free.fr added the comment: At least put the information inside some disclaimers about normally; even the stdlib has some fake locks that let you release a lock someone else holds. Not sure what you're talking about. The doc patch is about unacquired locks, not locks that someone else (another thread) holds. Indeed the standard Lock object (but not the RLock) does allow releasing from another thread. It's a feature (which makes it serve as a binary semaphore). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12567] curses implementation of Unicode is wrong in Python 3
Nicholas Cole nicholas.c...@gmail.com added the comment: Testing the Python3.3a2 build on OS X - the exception AttributeError: '_curses.curses window' object has no attribute 'get_wch' is still being raised. I don't have a Linux build I can easily test with. Is this a particular problem with the OS X build? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com