[issue14591] Value returned by random.random() out of valid range

2012-04-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a modification of Serhiy's patch that assures that the new state is nonzero. (Just to clarify the nonzero requirement: the MT state is formed from bit 31 of mt[0] together with all the bits of mt[i], 1 = i 624. At least one of

[issue14591] Value returned by random.random() out of valid range

2012-04-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The latest patch has the disadvantage that it'll often change the behaviour of jumpahead for people on 32-bit platforms, which may lead to unnecessary breakage. Here's a better version that only fixes mt[0] in the unlikely (but possible)

[issue14590] ConfigParser doesn't strip inline comment when delimiter occurs earlier without preceding space.

2012-04-19 Thread Łukasz Langa
Łukasz Langa luk...@langa.pl added the comment: INI files won't go away and there will come a time where 3.3 is old. Since 3.2 inline comments are turned off by default which mitigates the problem. Fixing this parser bug for the 3.3 release seems safe enough for me as long as you clearly

[issue14619] Enhanced variable substitution for databases

2012-04-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I agree this would be very handy, but the database engines I know which accept bind variables (Oracle, MySQL, JDBC) only accept simple types. So to handle ?? it would be necessary to modify the SQL statement passed to the database

[issue13959] Re-implement parts of imp in pure Python

2012-04-19 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: Looking it over, I'm confident that tokenizer.detect_encoding() does not raise a SyntaxError where PyTokenizer_FindEncodingFilename() does. I've run out of time tonight, but I'll look at it more tomorrow. Once find_module() is done,

[issue14601] PEP sources not available as documented

2012-04-19 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Not sure how it was supposed to be fixed in the past, as the docutils formatter would happily use whatever URL the docutils release had in place. I now fixed it for real (I hope) in 34076bfed420 --

[issue14620] Fatal Python error: Cannot recover from stack overflow.

2012-04-19 Thread Florian Bruhin
New submission from Florian Bruhin python@the-compiler.org: Hey, I just got the error message in the title when trying to run a script with python. You can find the coredump, stacktrace, and the scripts I ran at http://the-compiler.org/tmp/pythoncrash/ The command line I ran: python -u

[issue14619] Enhanced variable substitution for databases

2012-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Raymond, the variable substitution is normally done by the database and not the Python database modules, so you'd have to ask the database maintainers for assistance. The qmark ('?') parameter style is part of the ODBC standard, so it's

[issue7980] time.strptime not thread safe

2012-04-19 Thread Cédric Krier
Changes by Cédric Krier cedric.kr...@b2ck.com: -- nosy: +ced ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7980 ___ ___ Python-bugs-list mailing

[issue14611] inspect.getargs fails on some anonymous tuples

2012-04-19 Thread Stefano Taschini
Stefano Taschini tasch...@ieee.org added the comment: I think this should do. inspect.getargs is now looking for STORE_DEREF besides STORE_FAST, and is making sure that the appropriate namespace (locals vs cell + free vars) is selected depending on the opcode. The only changes to the test

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Why do you think it isn't safe, Antoine? It violates C's strict aliasing rules; Google for 'C strict aliasing' or 'C type punning' for more information. This isn't just a theoretical concern: gcc is known to make optimizations based on

[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-19 Thread Esben Agerbæk Black
Esben Agerbæk Black esbe...@gmail.com added the comment: 2) I get errors for all my test when I build my python and run ./python.exe -m test.datetimetester -j3 I asume this is because I have yet to implement the c version in Modules/_datetimemodule.c is this the correct assumption?

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-19 Thread sbt
sbt shibt...@gmail.com added the comment: Up to date patch. -- Added file: http://bugs.python.org/file25270/mp_pickle_conn.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4892 ___

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: We only support IEEE platforms. I don't think that's true, BTW. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381 ___

[issue11618] Locks broken wrt timeouts on Windows

2012-04-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new patch. This uses critical sections and condition variables to avoid kernel mode switches for locks. Windows mutexes are expensive and for uncontented locks, this offers a big win. It also adds an internal set of

[issue4892] Sending Connection-objects over multiprocessing connections fails

2012-04-19 Thread sbt
sbt shibt...@gmail.com added the comment: A couple of minor changes based on Antoine's earlier review (which I did not notice till now). -- Added file: http://bugs.python.org/file25272/mp_pickle_conn.patch ___ Python tracker rep...@bugs.python.org

[issue14428] Implementation of the PEP 418

2012-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@gmail.com added the comment: Please leave the pybench default timers unchanged in case the new APIs are not available. Ok, done in the new patch: perf_counter_process_time-2.patch.

[issue5118] '%.2f' % 2.545 doesn't round correctly

2012-04-19 Thread Zeev Rotshtein
Zeev Rotshtein zee...@gmail.com added the comment: Well this IS a bug. There is a certain globally accepted manner in which rounding work and python does something else. P.S.: A bug is when something doesn't do what it's supposed to do the way it's supposed to do it. This definition does not

[issue5118] '%.2f' % 2.545 doesn't round correctly

2012-04-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Well this IS a bug. I assume that you're referring to behaviour like this: Python 2.7.2 (default, Jan 13 2012, 17:11:09) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type help, copyright, credits or license for more information.

[issue14538] HTMLParser: parsing error

2012-04-19 Thread Michel Leunen
Michel Leunen michel.leu...@gmail.com added the comment: Thanks guys for your comments and for solving this issue. Great work! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14538 ___

[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-04-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset c4c67c2d8ffc by Nick Coghlan in branch '3.2': Close #14032: fix incorrect variable reference in test_cmd_line_script http://hg.python.org/cpython/rev/c4c67c2d8ffc -- nosy: +python-dev resolution: - fixed

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-04-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 9fdec1354af4 by Martin v. Löwis in branch 'default': Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo. http://hg.python.org/cpython/rev/9fdec1354af4 -- nosy: +python-dev

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-04-19 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Thanks for the patch! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14098 ___

[issue11618] Locks broken wrt timeouts on Windows

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This uses critical sections and condition variables to avoid kernel mode switches for locks. Windows mutexes are expensive and for uncontented locks, this offers a big win. Can you post some numbers? --

[issue13903] New shared-keys dictionary implementation

2012-04-19 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Mark, can you please submit a contributor form? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13903 ___

[issue2470] Need fixer for dl (removed) - ctypes module

2012-04-19 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Being open for four years, this is hardly critical. -- priority: critical - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2470

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ok, could you try applying the following patch to threading.py? diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -887,7 +887,7 @@ def _after_fork(): ident = _get_ident()

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file25274/dummythreadafterfork.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14308 ___

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a complete patch + tests for 2.7. -- Added file: http://bugs.python.org/file25273/dummythreadafterfork.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14308

[issue14601] PEP sources not available as documented

2012-04-19 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Confirmed, thanks! -- components: -Documentation stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14601 ___

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file25273/dummythreadafterfork.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14308 ___

[issue14601] PEP sources not available as documented

2012-04-19 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: Martin I now fixed it for real (I hope) in 34076bfed420 Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14601 ___

[issue8536] Support new features of ZLIB 1.2.6

2012-04-19 Thread Jason Killen
Jason Killen jsnk...@gmail.com added the comment: Given I'm new I wouldn't say I evaluated the usefulness of the new functions but I have given them a look and didn't see anything obvious. If thats good enough great, if not then hopefully someone with a little more experience will take a

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-04-19 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: The documentation does not explain how this new API is different from PyErr_Fetch/PyErr_Restore. In particular the documentation doesn't mention that PyErr_Fetch and PyErr_GetExcInfo access different bits of the error state (curexc_*

[issue14614] PyTuple_SET_ITEM could check bounds in debug mode

2012-04-19 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Should we limit ourselves to bound errors? Couldn't we make the macros aliases for their full-fledged function equivalents (e.g. PyTuple_SetItem()) which trigger Py_FatalError() on error so we also get argument type checking? -- nosy:

[issue12947] Examples in library/doctest.html lack the flags

2012-04-19 Thread Stefano Taschini
Stefano Taschini tasch...@ieee.org added the comment: As far as I can see, Sphinx has a global setting for trim_doctest_flags but lacks the possibility of locally disabling the trimming. A quick workaround would be to have the following sphinx extension added: class ProxyLexer(object):

[issue10941] imaplib: Internaldate2tuple produces wrong result if date is near a DST change

2012-04-19 Thread Alexander Belopolsky
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: Joe, Your changes to the test suit don't apply cleanly anymore. I can probably fix the conflicts, but if you could post an updated patch it will help. Thanks. -- nosy: -Alexander.Belopolsky

[issue13684] httplib tunnel infinite loop

2012-04-19 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- assignee: - orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13684 ___ ___

[issue14588] PEP 3115 compliant dynamic class creation

2012-04-19 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com added the comment: Fair enough. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14588 ___ ___

[issue10769] ast: provide more useful range information

2012-04-19 Thread Michael
Michael kensing...@astralcloak.net added the comment: Hi, Attached is the updated patch by Sven Brauch from the original mailing list thread bringing column offset reporting for attributes in line with everything else. The offsets for bar before the patch: foo[bar] = 4 foo(bar) = 4 foo.bar =

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Vlado Boza
New submission from Vlado Boza us...@ksp.sk: Fix of this http://bugs.python.org/issue13703 is broken. tl;dr: There only 256 different hash functions (compare it to size of _Py_HashSecret prefix and suffix). And whether keys collide or not depends only on the last 8 bits of prefix. Problem

[issue14622] Python http.server is dead slow using gethostbyaddr/getfqdn for each request

2012-04-19 Thread Yuval Greenfield
New submission from Yuval Greenfield ubershme...@gmail.com: This is the line in question: http://hg.python.org/cpython/file/293180d199f2/Lib/http/server.py#l527 I was trying to test out a few html files using python -m http.server and it took 4 seconds for each request, it was completely

[issue14622] Python http.server is dead slow using gethostbyaddr/getfqdn for each request

2012-04-19 Thread Yuval Greenfield
Changes by Yuval Greenfield ubershme...@gmail.com: -- type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14622 ___ ___

[issue14622] Python http.server is dead slow using gethostbyaddr/getfqdn for each request

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Probably a duplicate of issue 6085. -- nosy: +pitrou resolution: - duplicate status: open - closed superseder: - Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag ___ Python tracker

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-04-19 Thread Yuval Greenfield
Yuval Greenfield ubershme...@gmail.com added the comment: I agree with Antoine on this. Though the suggested patch is wrong. I believe we should leave address_string alone. Simply stop the log_message method from using it. Either way we'd be changing the log format but if we don't have to

[issue14371] Add support for bzip2 compression to the zipfile module

2012-04-19 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: What's the status of your contrib form? Oops. I put this off for a detailed study and forgotten. I will send the form, as only get to the printer and the scanner. -- ___ Python tracker

[issue14371] Add support for bzip2 compression to the zipfile module

2012-04-19 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Perhaps because your system's memory allocator is extremely good (or buf is always very small), but b''.join() is far more robust. Another alternative is accumulating in a bytearray, since it uses overallocation for linear time

[issue14579] Possible vulnerability in the utf-16 decoder after error handling

2012-04-19 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: There is the crasher and leaker. When Python is not crashing, there is garbage (i.e. leakage of data) at the end of the decoded string. Indeed, I see an English text in some versions of Python. There are many other errors in utf-16

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Vlado Boza
Vlado Boza us...@ksp.sk added the comment: E.g this strings collide for every prefix ending on 0xcd: 0x27fd5a18, 0x26fe78fa -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Dave Malcolm
Changes by Dave Malcolm dmalc...@redhat.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list

[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-19 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: v3 patch, based on feedback from the review here: http://bugs.python.org/review/14532/show Looks good to me. One last thing (sorry for not bringing this up earlier): I don't like bikeshedding, but at least to me,

[issue14623] Shutdown exception in daemon thread

2012-04-19 Thread Mike Hobbs
New submission from Mike Hobbs mho...@8thbridge.com: This issue is very similar to the issue original reported in issue1722344, except that it occurs in daemon threads. Here's a sample exception: Exception in thread Thread-1 (most likely raised during interpreter shutdown): Traceback (most

[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-19 Thread Jon Oberheide
Jon Oberheide j...@oberheide.org added the comment: I have used the name secure_compare in the past for such a function. That said, I don't have strong feelings either way about the naming, so I'll yield to the others. -- ___ Python tracker

[issue14624] Faster utf-16 decoder

2012-04-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka storch...@gmail.com: I propose a patch, which accelerates the utf-16 decoder. With PEP 393 utf-16 decoder slowed down a few times (3-4x), this patch returns the performance at the level of Python 3.2 and even higher (+10-30% over 3.2). In addition, it

[issue14625] Faster utf-32 decoder

2012-04-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka storch...@gmail.com: I suggest two variants of patch, accelerating the utf-32 decoder. With PEP 393 utf-32 decoder slowed down up to 2x, these patches returns a performance at the level of Python 3.2 and even much higher (2-3x over 3.2). The variant A is

[issue14625] Faster utf-32 decoder

2012-04-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file25279/decode_utf32_b.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14625 ___

[issue14624] Faster utf-16 decoder

2012-04-19 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___ ___ Python-bugs-list

[issue14624] Faster utf-16 decoder

2012-04-19 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___ ___ Python-bugs-list

[issue14625] Faster utf-32 decoder

2012-04-19 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: See also #14624 for UTF-16 decoder. -- nosy: +haypo, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14625 ___

[issue14624] Faster utf-16 decoder

2012-04-19 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: See also #14625 for UTF-32 decoder. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___

[issue14381] Intern certain integral floats for memory savings and performance

2012-04-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: return *(PY_LONG_LONG*)fval == 0; There is no aliasing, because there are no pointer variables in existence. If we did this: double *pfval = fval; PY_LONG_LONG *pl = (PY_LONG_LONG*)pfval return *pfval == 0 Then we would have

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Michal Petrucha
Changes by Michal Petrucha michal.petru...@ksp.sk: -- nosy: +konk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list

[issue14624] Faster utf-16 decoder

2012-04-19 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: See also issue #14579 for utf-16 decoder bugs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Here is a complete patch + tests for 2.7. I like the test. However there's something I find strange with the patch: diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -887,7 +887,7 @@

[issue14623] Shutdown exception in daemon thread

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Would it be correct to terminate daemon threads prior to wiping the globals, since the threads won't be able to accomplish much anyway? Daemon threads are not actually terminated by the Python interpreter, they just keep running in the

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le jeudi 19 avril 2012 à 21:11 +, Charles-François Natali a écrit : IMO it should be _DummyThread's stop() method that does the right thing, either by overriding Thread's stop() method in _DummyThread or by puting the check inside

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: New patch with the hasattr() approach. -- Added file: http://bugs.python.org/file25280/dummythreadafterfork2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14308

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list mailing

[issue14613] time.time can return NaN

2012-04-19 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: time.time can return None or NaN - time.time can return NaN ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14613 ___

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-19 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Here is the bugs in the utf-16 decoder: 1. `aligned_end` is not updated after calling error handler. 2. Possible silent reading of one byte over the bytes array limit when decoding of a surrogate pair. b'\xD8\x00\xDC'.decode('utf-16be')

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com added the comment: Thanks for filing this bug report. I'm not seeing the equal hashes you describe. I'm using this recipe to hardcode a specific prefix and print the hashes using it: $ gdb --eval-command=break _PyRandom_Init --eval-command=run

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-19 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: The proposed patch will fix only the first of these bugs. The patch in issue #14624 fixes all bugs for Python 3.3. For Python 3.2 soon I will make a patch. -- ___ Python tracker

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: New patch with the hasattr() approach. LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14308 ___

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset ab9d6c4907e7 by Antoine Pitrou in branch '2.7': Issue #14308: Fix an exception when a dummy thread is in the threading module's active list after a fork(). http://hg.python.org/cpython/rev/ab9d6c4907e7 New

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I don't think _DummyThread can override __stop(), because of the name mangling of __private methods. However, the hasattr() approach would probably work. Wouldn't a _DummyThread._Thread__stop() method override Thread.__stop()? Like

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Wouldn't a _DummyThread._Thread__stop() method override Thread.__stop()? Probably, but that would be quite ugly IMHO. I've now committed the patch as-is in 2.7. In 3.2 it turned out easier: __stop is now spelt _stop, so can be overriden without

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f554043badec by Larry Hastings in branch 'default': Issue #14127: Add st_{cma}time_ns fields to os.stat() result object. http://hg.python.org/cpython/rev/f554043badec --

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: The patch broke egenix-mx-base, since it relies on the customize_compiler() being available in distutils.ccompiler: https://www.egenix.com/mailman-archives/egenix-users/2012-April/114838.html If you make such changes to dot releases,

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Here's the quote from mxSetup.py: # distutils changed a lot in Python 2.7 due to many # distutils.sysconfig APIs having been moved to the new # (top-level) sysconfig module. from sysconfig import \

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-19 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Sorry for not thinking about this. I’ll be more careful. -- stage: committed/rejected - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13994

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Éric Araujo wrote: Sorry for not thinking about this. I’ll be more careful. No need to be sorry; these things can happen. What I don't understand is this line in the news section: Complete the revert back to only having one in

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-19 Thread Ned Deily
Ned Deily n...@acm.org added the comment: That's unfortunate. But the documented location for customize_compiler is and, AFAIK, had always been in distutils.sysconfig. It was an inadvertent consequence of the bad revert during the 2.7 development cycle that a second copy was made available

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +PaulMcMillan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-19 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Sorry about the delay; laptop died, finally dealt with reviving the data off it. Also: fixed spelling error in title. -- title: add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of

[issue14624] Faster utf-16 decoder

2012-04-19 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Serhiy: can you please submit a contributor form? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14624 ___

[issue14621] Hash function is not randomized properly

2012-04-19 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: I don't understand this issue: can you write a short script to test a collision? E.g this strings collide for every prefix ending on 0xcd Do you mean that prefix 0xff == 0xcd? 0x27fd5a18, 0x26fe78fa Is it a byte string or an

[issue13994] incomplete revert in 2.7 Distutils left two copies of customize_compiler

2012-04-19 Thread Ned Deily
Ned Deily n...@acm.org added the comment: And to recap the history here, there was a change in direction for Distutils during the 2.7 development cycle, as decided at the 2010 language summit, in particular to revert feature changes in Distutils for 2.7 to its 2.6.x state and, going forward,

[issue14613] time.time can return NaN

2012-04-19 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: So NaN is a possible result from time.time()? Oops. I don't know if it is possible. I just know that it cannot return None :-) _PyTime_gettimeofday() fills a structure having two integer fields (tv_sec, tv_usec), and floattime() uses

[issue14386] Expose dict_proxy internal type as types.MappingProxyType

2012-04-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 34af3e74292d by Victor Stinner in branch 'default': Close #14386: Register types.MappingProxyType as a Mapping http://hg.python.org/cpython/rev/34af3e74292d -- resolution: - fixed stage: -

[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-04-19 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: There are some functions in the os module that do much the same thing but differ only in minor ways, like * whether or not they follow symbolic links (stat vs lstat) * taking an extra dir_fd parameter (chmod vs fchmodat(3.3)) It would be

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Vlado Boza
Vlado Boza us...@ksp.sk added the comment: My bad (I checked only function in C++, not result in python). This should work on 32bit: Prefix: anything ending on 0x00 Suffix: anything Strings: \x00\xcf\x0b\x96\x19, \x00\x6d\x29\x45\x18 -- ___ Python

[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-04-19 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14626 ___ ___ Python-bugs-list

[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-04-19 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: storchaka: sorry for the long delay, somehow I missed your reply in python-ideas.) You said you envision this as a big patch. Could I convince you to try and make a series of smaller patches? It should be easy to break up into small

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Vlado Boza
Vlado Boza us...@ksp.sk added the comment: For example take this script (on 32bit): ha = hash(\x00\xcf\x0b\x96\x19) hb = hash(\x00\x6d\x29\x45\x18) if ha == hb: print collision And run following: for i in `seq 0 25`; do echo $i; for j in `seq 0 100`; do ./python -R x.py; done; done; It

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com added the comment: $ gdb --eval-command=break _PyRandom_Init --eval-command=run --eval-command=print _Py_HashSecret --eval-command=set _Py_HashSecret.prefix=0xcdcdcd00 --eval-command=print _Py_HashSecret --eval-command=continue -eval-command=continue --args

[issue14627] Fatal Python Error when Python startup is interrupted by CTRL+c

2012-04-19 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@gmail.com: If you press CTRL+c while Python is starting, you may get such error: ^CFatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File frozen importlib._bootstrap, line 990, in

[issue14621] Hash function is not randomized properly

2012-04-19 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: For example take this script (on 32bit): (...) It gives collison too many times (around 9 out of 2500). I tried this script on Linux 32 bits and Linux 64 bits: I didn't see any collision. What is your operating system and the version

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Michal Petrucha
Michal Petrucha michal.petru...@ksp.sk added the comment: @dmalcolm: As for the gdb example, you need to add --eval-command=set _Py_HashSecret_Initialized=1, otherwise _Py_HashSecret will get overwritten immediately after it is set by gdb, either to 0 if run without the -R switch, or to a

[issue14621] Hash function is not randomized properly

2012-04-19 Thread Vlado Boza
Vlado Boza us...@ksp.sk added the comment: I tried this script on Linux 32 bits and Linux 64 bits: I didn't see any collision. What is your operating system and the version of your operating system please? uname -a Linux 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64

[issue8885] markupbase declaration errors aren't recoverable

2012-04-19 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: HTMLParser shouldn't raise errors anymore, so the error method (and probably the HTMLParseError exception too) should be deprecated along with the non-strict mode on 3.3. -- assignee: - ezio.melotti nosy: +ezio.melotti type:

  1   2   >