[issue13752] add a str.casefold() method

2012-01-12 Thread Benjamin Peterson
Changes by Benjamin Peterson : Added file: http://bugs.python.org/file24226/casefolding.patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue13746] ast.Tuple's have an inconsistent "col_offset" value

2012-01-12 Thread Meador Inge
Meador Inge added the comment: I can reproduce this in tip as well: >>> ast.dump(ast.parse('a = (1,2)'), include_attributes=True) "Module(body=[Assign(targets=[Name(id='a', ctx=Store(), lineno=1, col_offset=0)], value=Tuple(elts=[Num(n=1, lineno=1, col_offset=5), Num(n=2, lineno=1, col_offset

[issue13629] _PyParser_TokenNames does not match up with the token.h numbers

2012-01-12 Thread Meador Inge
Meador Inge added the comment: Here is a patch that renumber the tokens. I also regenerated token.py. -- nosy: +georg.brandl Added file: http://bugs.python.org/file24225/renumber-tokens.patch ___ Python tracker _

[issue13752] add a str.casefold() method

2012-01-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: Patch for review. -- keywords: +patch title: add a unicode.casefold() method -> add a str.casefold() method Added file: http://bugs.python.org/file24224/casefolding.patch ___ Python tracker

[issue13703] Hash collision security issue

2012-01-12 Thread STINNER Victor
STINNER Victor added the comment: SafeDict.py: with this solution, the hash of key has to be recomputed at each access to the dict (creation, get, set), the hash is not cached in the string object. -- ___ Python tracker

[issue13703] Hash collision security issue

2012-01-12 Thread STINNER Victor
STINNER Victor added the comment: I wrote bench_startup.py to measure the startup time on Windows. The precision of the script is quite bad because Windows timer has a bad resolution (e.g. 15.6 ms on Windows 7) :-/ In release mode, the best startup time is 45.2 ms without random, 50.9 ms with

[issue13703] Hash collision security issue

2012-01-12 Thread STINNER Victor
STINNER Victor added the comment: Patch version 6: - remove a debug code in dev_urandom() (did always raise an exception for testing) - dev_urandom() raises an exception if open() fails - os.urandom() uses again the right exception type and message (instead of a generic exception) - os.ur

[issue6210] Exception Chaining missing method for suppressing context

2012-01-12 Thread Patrick Westerhoff
Patrick Westerhoff added the comment: Yeah, I would really like that solution, especially as it separates from the `from X` syntax that sets the exception’s cause. Also I would prefer a syntax solution over a class method simply because the exception context is something that is implicitely s

[issue6210] Exception Chaining missing method for suppressing context

2012-01-12 Thread Ethan Furman
Ethan Furman added the comment: Okay, I like Matthew Barnett's idea of except SomeError [as e]: raise as SomeOtherError('...') This would require a change to the grammer as well, yes? From: raise_stmt: 'raise' [test ['from' test]] to raise_stmt: 'raise' [test ['from' t

[issue13748] Allow rb"" literals as an equivalent to br""

2012-01-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed, thanks. -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker ___

[issue13748] Allow rb"" literals as an equivalent to br""

2012-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset bbed36370b08 by Antoine Pitrou in branch 'default': Issue #13748: Raw bytes literals can now be written with the `rb` prefix as well as `br`. http://hg.python.org/cpython/rev/bbed36370b08 -- nosy: +python-dev _

[issue13763] rm obsolete reference in devguide

2012-01-12 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Ezio Melotti added the comment: > > If 'program' refers to the executable, the sentence is still valid. Interesting. It didn't appear like that until you mentioned it. It was far more clear with subversion:svn than mercurial:hg. Sandro's suggestion rem

[issue13763] rm obsolete reference in devguide

2012-01-12 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: On Thu, Jan 12, 2012 at 00:12, Sandro Tosi wrote: > > Sandro Tosi added the comment: > > But we may explain what's behind: "after the mercury chemical element symbol" > - what do you think? Good idea. That's actually what I thought it meant initially b

[issue6774] socket.shutdown documentation: on some platforms, closing one half closes the other half

2012-01-12 Thread Nicolas Dumazet
Nicolas Dumazet added the comment: > It's the other end which decides to return ENOTCONN upon shutdown(SHUT_RD) on > OS X, which is questionable > (not sure it's against the BSD socket API, since shutdown(SHUT_RD) doesn't > have any counterpart in the TCP layer). Exactly. The same code raises

[issue11633] Document that print may need explicit flushing

2012-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4a767054551b by Terry Jan Reedy in branch '3.2': #11633 At least 2 people prefer earlier revision. http://hg.python.org/cpython/rev/4a767054551b New changeset 22688f5f9d0f by Terry Jan Reedy in branch 'default': Merge #11633 At least 2 people prefe

[issue6774] socket.shutdown documentation: on some platforms, closing one half closes the other half

2012-01-12 Thread Charles-François Natali
Charles-François Natali added the comment: > I was scared by the note in the documentation and wondered if the > socket Python API was completely incapable of handling half-closed > connections cross platform. [...] > It makes it half-closed as it should Indeed. Calling shutdown(SHUT_WR) doesn'

[issue13709] Capitalization mistakes in the documentation for ctypes

2012-01-12 Thread Meador Inge
Changes by Meador Inge : -- components: +ctypes nosy: +meador.inge stage: -> needs patch type: -> enhancement ___ Python tracker ___ ___

[issue13777] socket: communicating with Mac OS X KEXT controls

2012-01-12 Thread Ross Lagerwall
Changes by Ross Lagerwall : -- nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13775] Access Denied message on symlink creation misleading for an existing file/directory target.

2012-01-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: I fail to see the bug. The output is correct, you are just misinterpreting it. It gives you the error code, error message, and original filename. It doesn't *actually* claim that the access to test is denied. Now, changing the file in the message to the dest

[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-01-12 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-01-12 Thread Jan Kratochvil
Jan Kratochvil added the comment: Here is the implementation. Python/getargs.c was modified for: ImportError: /usr/lib64/python2.7/lib-dynload/fcntlmodule.so: undefined symbol: _PyArg_ParseTuple_SizeT but I guess that patch part should be different. There is no need to do #ifdef HAVE_DECLSPE

[issue13777] socket: communicating with Mac OS X KEXT controls

2012-01-12 Thread Michael Goderbauer
New submission from Michael Goderbauer : Mac OS X provides a socket-based API to communicate with Kernel Extensions (KEXTs) called "KEXT Controls". For this, Mac OS X defines PF_SYSTEM as a new socket domain which supports the SYSPROTO_CONTROL protocol. Right now the PF_SYSTEM domain and the S

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: Some minor comments in http://bugs.python.org/review/11682/show. -- ___ Python tracker ___ ___ Pytho

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Zbyszek Szmek
Changes by Zbyszek Szmek : -- hgrepos: -66 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue2292] Missing *-unpacking generalizations

2012-01-12 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: #11682 will likely be merged. The part of this patch about "yielding everything from an iterator" becomes obsolete: >>> def flatten(iterables): ...for it in iterables: ... yield from it ... >>> L = [ [0,1,2], (3, 4), {5}, {6: None}, (i for i in range(7

[issue12409] Moving "Documenting Python" to Devguide

2012-01-12 Thread Sandro Tosi
Changes by Sandro Tosi : Added file: http://bugs.python.org/file24219/doc2devguide-cpython.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue12409] Moving "Documenting Python" to Devguide

2012-01-12 Thread Sandro Tosi
Sandro Tosi added the comment: Sure, sorry I didn't make it before; here attached the 2 patches, one against devguide, the other to default cpython repo. -- keywords: +patch Added file: http://bugs.python.org/file24218/doc2devguide-devguide.patch __

[issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation

2012-01-12 Thread Jim Jewett
Jim Jewett added the comment: The currently applied patch ( http://hg.python.org/cpython/rev/f7e05d205a52 ) left some dead code in unicodeobject.c function fixup ( http://hg.python.org/cpython/file/f7e05d205a52/Objects/unicodeobject.c#l9386 ) has a shortcut for when the fixer doesn't make an

[issue11633] Document that print may need explicit flushing

2012-01-12 Thread Éric Araujo
Éric Araujo added the comment: I agree with the python-ideas message that ``sys.stdout.flush()`` is surprising / possibly misleading and should be ``file.flush()``. If the other bug report about adding a flush argument is rejected, please consider this. Thanks :) -- ___

[issue13645] import machinery vulnerable to timestamp collisions

2012-01-12 Thread Brett Cannon
Brett Cannon added the comment: LGTM (although I didn't run the unit tests and focused mainly on the importlib._bootstrap and abc changes). Only two things I would change. One is possibly deprecating path_mtime() so people don't waste time implementing it (we actually never need to remove it

[issue13706] non-ascii fill characters no longer work in formatting

2012-01-12 Thread Eric V. Smith
Eric V. Smith added the comment: Sorry for the off-the-cuff diagnosis. I had assumed this was the unintended result of the conversion, but of course I'm wrong. I'd like to fix this. -- nosy: +Jim.Jewett ___ Python tracker

[issue12409] Moving "Documenting Python" to Devguide

2012-01-12 Thread Éric Araujo
Éric Araujo added the comment: Could you provide a single patch or publish your version somewhere to help reviews? For the CPython docs, I think just removing the whole of Doc/documenting would be okay, or if we expect that people will go to that URI we may leave a placeholder page with only

[issue11397] os.path.realpath() may produce incorrect results

2012-01-12 Thread Konstantin Nikitin
Changes by Konstantin Nikitin : -- nosy: +stromsund ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue13765] Distutils does not put quotes around paths that contain spaces when compiling with MSVC

2012-01-12 Thread Éric Araujo
Éric Araujo added the comment: Oh and BTW it would be very helpful if you could adapt your test script to be pure-distutils, without Cython or Numpy extensions. -- ___ Python tracker _

[issue13765] Distutils does not put quotes around paths that contain spaces when compiling with MSVC

2012-01-12 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the report and patch. How can we test it? Do we need to install a Python on a path with embedded spaces? -- keywords: +needs review stage: -> patch review versions: +Python 2.7, Python 3.3 -Python 2.6 ___

[issue11397] os.path.realpath() may produce incorrect results

2012-01-12 Thread Vadim Fint
Changes by Vadim Fint : -- nosy: +Vadim.Fint ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue6095] os.curdir as the default argument for os.listdir

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +michael.foord resolution: accepted -> fixed stage: patch review -> committed/rejected ___ Python tracker ___ ___

[issue13761] Add flush keyword to print()

2012-01-12 Thread Éric Araujo
Éric Araujo added the comment: Patch LGTM. (s/assertEquals/assertEqual/ though, or you’ll get a warning) -- nosy: +eric.araujo ___ Python tracker ___ __

[issue13631] readline fails to parse some forms of .editrc under editline (libedit) emulation on Mac OS X

2012-01-12 Thread Éric Araujo
Éric Araujo added the comment: I applied your patch and built the readline module against libreadline and imported it successfully. (I did not try the special parsing feature, but I don’t think it’s needed.) -- ___ Python tracker

[issue9253] argparse: optional subparsers

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo : -- keywords: +patch Added file: http://bugs.python.org/file24217/ed0fce615582.diff ___ Python tracker ___ ___

[issue9253] argparse: optional subparsers

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo : -- hgrepos: +102 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue13761] Add flush keyword to print()

2012-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Anatoly, duly noted, and disagreed with. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue13359] urllib2 doesn't escape spaces in http requests

2012-01-12 Thread Mads Kiilerich
Mads Kiilerich added the comment: Yes, the url sent by urllib2 must not contain spaces. In my opinion the only way to handle that correctly is to not pass urls with spaces to urlopen. Escaping the urls is not a good solution - even if the API was to be designed from scratch. It would be bette

[issue13776] formatter_unicode.c still assumes ASCII

2012-01-12 Thread Eric V. Smith
Eric V. Smith added the comment: This is a duplicate of issue 13706. -- nosy: +eric.smith resolution: -> duplicate stage: -> committed/rejected status: open -> closed ___ Python tracker _

[issue13359] urllib2 doesn't escape spaces in http requests

2012-01-12 Thread Michele Orrù
Michele Orrù added the comment: Here the patch for python2. kiilerix, RFC 1738 explicitly says that the space character shall not be used. -- Added file: http://bugs.python.org/file24216/issue13359_py2.patch ___ Python tracker

[issue13776] formatter_unicode.c still assumes ASCII

2012-01-12 Thread Jim Jewett
New submission from Jim Jewett : http://docs.python.org/library/string.html#format-specification-mini-language defines fill::= and the text also excludes '{'. It does not require that the fill character be ASCII. However, function parse_internal_render_format_spec http://hg.p

[issue13359] urllib2 doesn't escape spaces in http requests

2012-01-12 Thread Mads Kiilerich
Mads Kiilerich added the comment: FWIW, I don't think it is a good idea to escape automatically. It will change the behaviour in a non-backward compatible way for existing applications that pass encoded urls to this function. I think the existing behaviour is better. The documentation and the

[issue13359] urllib2 doesn't escape spaces in http requests

2012-01-12 Thread Michele Orrù
Michele Orrù added the comment: Patch attached for python3, with unit tests. -- nosy: +maker Added file: http://bugs.python.org/file24215/issue13359.patch ___ Python tracker ___

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Nick Coghlan added the comment: Nice milestone this evening: by incorporating doc updates based on Zbysek's efforts and dropping the explicit bytecode generation tests, I now have something that appears ready to commit *without* a dependency on the proposed dis module updates. So, assuming n

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan : Added file: http://bugs.python.org/file24214/f8349cbc1b26.diff ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file24213/494c976c41c4.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file23774/0d1d76f68750.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan : Added file: http://bugs.python.org/file24213/494c976c41c4.diff ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue6774] socket.shutdown documentation: on some platforms, closing one half closes the other half

2012-01-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +neologix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue6774] socket.shutdown documentation: on some platforms, closing one half closes the other half

2012-01-12 Thread Mads Kiilerich
Mads Kiilerich added the comment: I was scared by the note in the documentation and wondered if the socket Python API was completely incapable of handling half-closed connections cross platform. pitrou helped me on IRC to track the note down to this issue. IMO the bug report should have been

[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2

2012-01-12 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- keywords: +patch Added file: http://bugs.python.org/file24212/json_badencoding.patch ___ Python tracker ___ _

[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2

2012-01-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a patch -- nosy: +amaury.forgeotdarc stage: -> patch review ___ Python tracker ___ _

[issue13703] Hash collision security issue

2012-01-12 Thread Graham Dumpleton
Graham Dumpleton added the comment: Right back at the start it was said: """ We haven't agreed whether the randomization should be enabled by default or disabled by default. IMHO it should be disabled for all releases except for the upcoming 3.3 release. The env var PYTHONRANDOMHASH=1 would e

[issue13703] Hash collision security issue

2012-01-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Frank Sievertsen wrote: > > I don't want my software to stop working because someone managed to enter > 1000 bad strings into it. Think of a software that handles names of customers > or filenames. We don't want it to break completely just because someone

[issue13703] Hash collision security issue

2012-01-12 Thread Frank Sievertsen
Frank Sievertsen added the comment: I'd like to add a few notes: 1. both 32-bit and 64-bit python are vulnerable 2. collision-counting will break other things 3. imho, randomization is the way to go, enabled by default. 4. do we need a steady hash-function later again? I created ~500KB of coll

[issue13761] Add flush keyword to print()

2012-01-12 Thread anatoly techtonik
anatoly techtonik added the comment: I am not discussing "printing to file", so my 0.02 is that "flush=True" should be made default for print() with sys.stdout, because it is probably what users expect when calling this function. If somebody needs buffering/cache or more fine-grained control