[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-11 Thread Charles-François Natali
Changes by Charles-François Natali : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-11 Thread Graham Dumpleton
Graham Dumpleton added the comment: Whoops. Missed the error. The fatal error that occurs is: Fatal Python error: Couldn't create autoTLSkey mapping -- ___ Python tracker ___ _

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-11 Thread Graham Dumpleton
New submission from Graham Dumpleton : This is a followup bug report to fix wrong implementation of _PyGILState_Reinit() introduced by http://bugs.python.org/issue10517. I don't have a standalone test case yet. Problem occurs under mod_wsgi with Python 2.7.2 and thus similarly 3.2 where _PyGIL

[issue3902] Packages containing only extension modules have to contain __init__.py

2011-10-11 Thread Mike Hoy
Mike Hoy added the comment: setupscript did not have the changes that were made in apiref. v4 is now consistent and line wrapping at 80 chars. -- Added file: http://bugs.python.org/file23384/apiref-setupscript-v4.diff ___ Python tracker

[issue12555] PEP 3151 implementation

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks everyone for the reviews! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker _

[issue12555] PEP 3151 implementation

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 41a1de81ef2b by Antoine Pitrou in branch 'default': PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy. http://hg.python.org/cpython/rev/41a1de81ef2b -- nosy: +python-dev ___ Python tra

[issue12807] Move strip() to stringlib

2011-10-11 Thread John O'Connor
Changes by John O'Connor : -- title: Optimization/refactoring for {bytearray, bytes, unicode}.strip() -> Move strip() to stringlib ___ Python tracker ___ ___

[issue12807] Optimization/refactoring for {bytearray, bytes, unicode}.strip()

2011-10-11 Thread John O'Connor
John O'Connor added the comment: New patch. Please double check the removal of _PyUnicode_XStrip. -- Added file: http://bugs.python.org/file23383/stringlib_strip2.patch ___ Python tracker

[issue12641] Remove -mno-cygwin from distutils

2011-10-11 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue13155] Optimize finding the max character width

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Ok, updated patch. > > "ret = ~mask + 1;" looks wrong: (~0xFF80+1) gives 128, not 127. That's on purpose, since the mask has just matched. If 0xFF80 matches, then the max char can't be 127, it has to be at least 128. > I don't see why you need: >

[issue13155] Optimize finding the max character width

2011-10-11 Thread STINNER Victor
STINNER Victor added the comment: > Ok, updated patch. "ret = ~mask + 1;" looks wrong: (~0xFF80+1) gives 128, not 127. I don't see why you need: +if (ret < 128) +return 127; +if (ret < 256) +return 255; #undef ASCII_CHAR_MASK should be #undef UCS1_ASCII_CHAR_MASK

[issue13155] Optimize finding the max character width

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, updated patch. -- Added file: http://bugs.python.org/file23382/find_max_char4.patch ___ Python tracker ___

[issue13155] Optimize finding the max character width

2011-10-11 Thread STINNER Victor
STINNER Victor added the comment: find_max_char() returns 0x1 instead of 0x10, which may be wrong (or at least, surprising). You may add a max_char variable using other macros like MAX_CHAR_ASCII, MAX_CHAR_UCS1, ..., which will be set at the same time than mask. Or restore your if (re

[issue13155] Optimize finding the max character width

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Slightly cleaned up patch after Victor's comments in private. -- Added file: http://bugs.python.org/file23381/find_max_char3.patch ___ Python tracker _

[issue13155] Optimize finding the max character width

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I hadn't noticed the STRINGLIB_SIZEOF_CHAR constant. Reuse it instead of adding STRINGLIB_CHAR_SIZE. -- Added file: http://bugs.python.org/file23380/find_max_char2.patch ___ Python tracker

[issue13155] Optimize finding the max character width

2011-10-11 Thread Antoine Pitrou
New submission from Antoine Pitrou : This patch optimizes scanning for the max character width in an unicode buffer. Micro-benchmarking some worst case situations: $ ./python -m timeit -s "x='é'+'x'*10" "x[1:]" -> before: 1 loops, best of 3: 74.9 usec per loop -> after: 10 loops, be

[issue13146] Writing a pyc file is not atomic

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So if a process replaces the PYC file whereas another is reading the > PYC, the reader may read corrupted data? No, this is the whole point of the patch. -- ___ Python tracker

[issue13154] pep-0000.txt doesn't build anymore

2011-10-11 Thread Antoine Pitrou
New submission from Antoine Pitrou : $ make make: Dépendance circulaire pep-.txt <- pep-.txt abandonnée. python genpepindex.py . Traceback (most recent call last): File "genpepindex.py", line 67, in main(sys.argv) File "genpepindex.py", line 64, in main write_pep0(peps, pep0_

[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-11 Thread João Bernardo
João Bernardo added the comment: @Ned That looks like a bit different case. IDLE *can* print the char after you entered the '\U' version of it. It doesn't accept you to paste those caracters... -- ___ Python tracker

[issue13146] Writing a pyc file is not atomic

2011-10-11 Thread STINNER Victor
STINNER Victor added the comment: So if a process replaces the PYC file whereas another is reading the PYC, the reader may read corrupted data? The ideal fix is maybe to use a file lock? -- nosy: +haypo ___ Python tracker

[issue13134] speed up finding of one-character strings

2011-10-11 Thread STINNER Victor
STINNER Victor added the comment: changeset: 72874:bfd3fcfb02f3 user:Victor Stinner date:Tue Oct 11 23:22:22 2011 +0200 files: Objects/stringlib/asciilib.h Objects/stringlib/fastsearch.h Objects/stringlib/stringdefs.h Objects/stringlib/ucs1lib.h Objects/stri description

[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-11 Thread Ned Deily
Ned Deily added the comment: This is related to Issue12342. The problem is that Tcl/Tk 8.5 (and earlier) do not support Unicode code points outside the BMP range as in this example. So IDLE will be unable to display such characters but it should not crash either. -- assignee: -> ne

[issue10881] test_site and macframework builds fails

2011-10-11 Thread Ned Deily
Ned Deily added the comment: I forgot to mention that one advantage of using another framework and root location, say, under your home directory somewhere, is that it is unnecessary to use sudo. And you don't need to use the special target in any case, simply "make install". -- ___

[issue10881] test_site and macframework builds fails

2011-10-11 Thread Ned Deily
Ned Deily added the comment: > sudo make frameworkinstall While that shouldn't affect the Apple-supplied system Pythons, be aware that with default ./configure settings this will overwrite any third-party Python installs (like from the python.org installers) of the version in question in /

[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-11 Thread João Bernardo
New submission from João Bernardo : I was playing with some unicode chars on Python 3.2 (x64 on Windows 7), but when pasted a char bigger than 0x, IDLE crashes without any error message. Example (works fine): >>> '\U000104a2' '𐒢' But, if I try to paste the above char, the window will insta

[issue13146] Writing a pyc file is not atomic

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: This new patch also fixes importlib. -- stage: -> patch review versions: -Python 2.7 Added file: http://bugs.python.org/file23378/importrename2.patch ___ Python tracker

[issue13136] speed-up conversion between unicode widths

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed. It is of course still not as fast as memcpy, but it's a small step towards improving performance. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python

[issue13136] speed-up conversion between unicode widths

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5b077c962a16 by Antoine Pitrou in branch 'default': Issue #13136: speed up conversion between different character widths. http://hg.python.org/cpython/rev/5b077c962a16 -- nosy: +python-dev ___ Python tra

[issue13134] speed up finding of one-character strings

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I went ahead and committed. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Ross Lagerwall
Ross Lagerwall added the comment: #11454 is another case where pre-parsing and pickling the regular expressions in the email module may improve import time considerably. -- nosy: +rosslagerwall ___ Python tracker

[issue13134] speed up finding of one-character strings

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset af4a89f4f466 by Antoine Pitrou in branch 'default': Issue #13134: optimize finding single-character strings using memchr http://hg.python.org/cpython/rev/af4a89f4f466 -- nosy: +python-dev ___ Python trac

[issue10881] test_site and macframework builds fails

2011-10-11 Thread Vinay Sajip
Vinay Sajip added the comment: IIRC what I did was clone the repo, configure and build, then sudo make frameworkinstall For me (on Leopard), this installed Python 3.3 in /Library/Frameworks/Python.framework, leaving my system Python (2.5.1) alone. Then you can just invoke the regression test

[issue10881] test_site and macframework builds fails

2011-10-11 Thread Bryce Verdier
Bryce Verdier added the comment: I would like to help by reviewing the patch, however I'm unsure about how to do the framework aspect of this. Can someone send me instructions or a link on how I would set this up to test? Thanks in advance, -- nosy: +louiscipher

[issue10517] test_concurrent_futures crashes with "--with-pydebug" on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

2011-10-11 Thread Charles-François Natali
Charles-François Natali added the comment: I did a quick test (calling fork() from a subinterpreter), and as expected, I couldn't reproduce the problem. So I still favor an OOM condition making pthread_setspecific bail out with ENOMEM, othe other option being a nasty libc bug. If the problem per

[issue13145] Documentation of PyNumber_ToBase() wrong

2011-10-11 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: docs@python -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue13145] Documentation of PyNumber_ToBase() wrong

2011-10-11 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed. Thanks for the report! -- nosy: +mark.dickinson resolution: -> fixed status: open -> closed versions: +Python 3.2, Python 3.3 ___ Python tracker _

[issue13145] Documentation of PyNumber_ToBase() wrong

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset a644e2c43c4b by Mark Dickinson in branch 'default': Merge issue #13145 fix. http://hg.python.org/cpython/rev/a644e2c43c4b -- ___ Python tracker __

[issue13145] Documentation of PyNumber_ToBase() wrong

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 61eb59516b55 by Mark Dickinson in branch '3.2': Issue #13145. Fix incorrect documentation for PyNumber_ToBase. Thanks Sven Marnach. http://hg.python.org/cpython/rev/61eb59516b55 -- nosy: +python-dev __

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Pre-parsing and building a cached module of built-time variables (from Makefile and pyconfig.h) under POSIX also removes more than 15% of startup time. Patch attached. -- keywords: +patch Added file: http://bugs.python.org/file23377/sysconfigdata.patc

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Arg damn roundup e-mail gateway. I wanted to paste: >>> pickle.dumps(re.compile('')) b'\x80\x03cre\n_compile\nq\x00X\x00\x00\x00\x00q\x01K \x86q\x02Rq\x03.' -- ___ Python tracker

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I am curious: wouldn't be a way of keeping the compiled expressions in > a static cache somewhere, so we would compile them just once and have > both import time and runtime fast ? Runtime shouldn't be affected. The re module has its own LRU caching. That sa

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset ed0bc92fed68 by Antoine Pitrou in branch 'default': Use a dict for faster sysconfig startup (issue #13150) http://hg.python.org/cpython/rev/ed0bc92fed68 -- ___ Python tracker

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Tarek Ziadé
Tarek Ziadé added the comment: I am curious: wouldn't be a way of keeping the compiled expressions in a static cache somewhere, so we would compile them just once and have both import time and runtime fast ? -- ___ Python tracker

[issue10976] json.loads() throws TypeError on bytes object

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'll just mention that the elimination of bytes handling is a bit > unfortunate, since this idiom which works in Python 2 no longer works: > > fp = urlopen(url) > json_data = json.load(fp) What if the returned JSON uses a charset other than utf-8 ?

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset df950158dc33 by Antoine Pitrou in branch 'default': Issue #13150: The tokenize module doesn't compile large regular expressions at startup anymore. http://hg.python.org/cpython/rev/df950158dc33 -- nosy: +python-dev ___

[issue10976] json.loads() throws TypeError on bytes object

2011-10-11 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'll just mention that the elimination of bytes handling is a bit unfortunate, since this idiom which works in Python 2 no longer works: fp = urlopen(url) json_data = json.load(fp) /me sad -- nosy: +barry ___ Pyt

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, a big part of that is compiling some regexes in the tokenize module. Just relying on the re module's internal caching shaves off 20% of total startup time. Before: $ time ./python -S -c 'import tokenize' real0m0.034s user0m0.030s sys 0

[issue13152] textwrap: support custom tabsize

2011-10-11 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +needs review nosy: +georg.brandl stage: -> patch review ___ Python tracker ___ ___ Python-bug

[issue13152] textwrap: support custom tabsize

2011-10-11 Thread John Feuerstein
New submission from John Feuerstein : The textwrap module calls .expandtabs() to expand tabs to spaces. This patch adds support for a custom tabsize, so that .expandtabs(tabsize) is called instead. Includes test case. -- components: Library (Lib) files: textwrap_tabsize.diff keywords:

[issue6715] xz compressor support

2011-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: > >> Modules/_lzmamodule.c:115: return _PyBytes_Resize(buf, size + BIGCHUNK); > > This has quadratic performance. > > Correct. I copied the algorithm from _io.FileIO, under the assumption > that there was a reason for not using a simpler O(n log n) doubling > s

[issue13151] pysetup3 run bdist_wininst fails

2011-10-11 Thread Vinay Sajip
New submission from Vinay Sajip : When you run pysetup3 run bdist_wininst in a project directory with a valid setup.cfg, it fails with error: Invalid command install after the build, build_py and build_scripts steps. For info, pysetup3 run bdist_dumb runs without error. -- assignee:

[issue1673007] urllib2 requests history + HEAD support

2011-10-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: Patrick, Lots of valid points. I had not looked at the RFC spec when I mentioned about data over request (GET) method, but was trying to derive the current functionality of module (so that users can have a seamless experience) with additional method="GET"

[issue6715] xz compressor support

2011-10-11 Thread Nadeem Vawda
Nadeem Vawda added the comment: Awesome stuff! I'll post an updated patch during the course of the day. Martin: I've been having problems with Rietveld lately, so I'm posting my replies to your comments here instead. >> Modules/_lzmamodule.c:115: return _PyBytes_Resize(buf, size + BIGCHUNK); >

[issue13150] Most of Python's startup time is sysconfig

2011-10-11 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue13148] simple bug in mmap size check

2011-10-11 Thread Maxim Yanchenko
Maxim Yanchenko added the comment: > You got lucky, since the offset must be a multiple of the page size. That's why our header is exactly the page size :) > Here's what POSIX says Then it's just another discrepancy between POSIX and Linux, as I received ENOMEM instead of EINVAL (RHEL6 on 2.6.

[issue1673007] urllib2 requests history + HEAD support

2011-10-11 Thread Patrick Westerhoff
Patrick Westerhoff added the comment: Senthil, I highly disagree with what you said: > The next problem comes when a user has specified both data and method="GET". > This becomes an invalid scenario, but a decision has been to taken as what > should be given preference? That is incorrect, RFC26

[issue13148] simple bug in mmap size check

2011-10-11 Thread Charles-François Natali
Charles-François Natali added the comment: > The condition contradicts the exception text: Why? The offset is zero-based, so 0 <= offset < size is a valid check. > First of all, it doesn't fail (at least on Linux), I tested it before > posting. Hmmm. You got lucky, since the offset must be a