[issue13761] Add flush keyword to print()

2012-01-12 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com 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

[issue13703] Hash collision security issue

2012-01-12 Thread Frank Sievertsen
Frank Sievertsen pyt...@sievertsen.de 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

[issue13703] Hash collision security issue

2012-01-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com 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

[issue13703] Hash collision security issue

2012-01-12 Thread Graham Dumpleton
Graham Dumpleton graham.dumple...@gmail.com 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

[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 amaur...@gmail.com added the comment: Here is a patch -- nosy: +amaury.forgeotdarc stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13774 ___

[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 amaur...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file24212/json_badencoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13774

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

2012-01-12 Thread Mads Kiilerich
Mads Kiilerich m...@kiilerich.com 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

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

2012-01-12 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6774 ___ ___ Python-bugs-list mailing

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: Added file: http://bugs.python.org/file24213/494c976c41c4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: Removed file: http://bugs.python.org/file23774/0d1d76f68750.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: Removed file: http://bugs.python.org/file24213/494c976c41c4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: Added file: http://bugs.python.org/file24214/f8349cbc1b26.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

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

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

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

2012-01-12 Thread Mads Kiilerich
Mads Kiilerich m...@kiilerich.com 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

[issue13776] formatter_unicode.c still assumes ASCII

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

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

2012-01-12 Thread Michele Orrù
Michele Orrù maker...@gmail.com 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 Eric V. Smith
Eric V. Smith e...@trueblade.com added the comment: This is a duplicate of issue 13706. -- nosy: +eric.smith resolution: - duplicate stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

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

2012-01-12 Thread Mads Kiilerich
Mads Kiilerich m...@kiilerich.com 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

[issue13761] Add flush keyword to print()

2012-01-12 Thread Guido van Rossum
Guido van Rossum gu...@python.org added the comment: Anatoly, duly noted, and disagreed with. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___

[issue9253] argparse: optional subparsers

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- hgrepos: +102 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs-list mailing

[issue9253] argparse: optional subparsers

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

[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 mer...@netwok.org 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

[issue13761] Add flush keyword to print()

2012-01-12 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Patch LGTM. (s/assertEquals/assertEqual/ though, or you’ll get a warning) -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761

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

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +michael.foord resolution: accepted - fixed stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6095 ___

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

2012-01-12 Thread Vadim Fint
Changes by Vadim Fint mocks...@gmail.com: -- nosy: +Vadim.Fint ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11397 ___ ___ Python-bugs-list

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

2012-01-12 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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

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

2012-01-12 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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 rep...@bugs.python.org

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

2012-01-12 Thread Konstantin Nikitin
Changes by Konstantin Nikitin n...@ya.ru: -- nosy: +stromsund ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11397 ___ ___ Python-bugs-list mailing

[issue12409] Moving Documenting Python to Devguide

2012-01-12 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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

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

2012-01-12 Thread Eric V. Smith
Eric V. Smith e...@trueblade.com 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

[issue13645] import machinery vulnerable to timestamp collisions

2012-01-12 Thread Brett Cannon
Brett Cannon br...@python.org 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

[issue11633] Document that print may need explicit flushing

2012-01-12 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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 :)

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

2012-01-12 Thread Jim Jewett
Jim Jewett jimjjew...@gmail.com 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

[issue12409] Moving Documenting Python to Devguide

2012-01-12 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com 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

[issue12409] Moving Documenting Python to Devguide

2012-01-12 Thread Sandro Tosi
Changes by Sandro Tosi sandro.t...@gmail.com: Added file: http://bugs.python.org/file24219/doc2devguide-cpython.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12409 ___

[issue2292] Missing *-unpacking generalizations

2012-01-12 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl 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

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Zbyszek Szmek
Changes by Zbyszek Szmek zbys...@in.waw.pl: -- hgrepos: -66 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___ ___ Python-bugs-list mailing

[issue11682] PEP 380 reference implementation for 3.3

2012-01-12 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: Some minor comments in http://bugs.python.org/review/11682/show. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___

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

2012-01-12 Thread Michael Goderbauer
New submission from Michael Goderbauer cont...@m-goderbauer.de: 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

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

2012-01-12 Thread Jan Kratochvil
Jan Kratochvil jan.kratoch...@redhat.com 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

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

2012-01-12 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10112 ___ ___ Python-bugs-list

[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 mar...@v.loewis.de 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

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

2012-01-12 Thread Ross Lagerwall
Changes by Ross Lagerwall rosslagerw...@gmail.com: -- nosy: +ned.deily, ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13777 ___ ___

[issue13709] Capitalization mistakes in the documentation for ctypes

2012-01-12 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- components: +ctypes nosy: +meador.inge stage: - needs patch type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13709 ___

[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 neolo...@free.fr 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

[issue11633] Document that print may need explicit flushing

2012-01-12 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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':

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

2012-01-12 Thread Nicolas Dumazet
Nicolas Dumazet nicd...@gmail.com 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

[issue13763] rm obsolete reference in devguide

2012-01-12 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: On Thu, Jan 12, 2012 at 00:12, Sandro Tosi rep...@bugs.python.org wrote: Sandro Tosi sandro.t...@gmail.com added the comment: But we may explain what's behind: after the mercury chemical element symbol - what do you think? Good

[issue13763] rm obsolete reference in devguide

2012-01-12 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: Ezio Melotti ezio.melo...@gmail.com 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

[issue13748] Allow rb literals as an equivalent to br

2012-01-12 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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:

[issue13748] Allow rb literals as an equivalent to br

2012-01-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed, thanks. -- resolution: - fixed stage: patch review - commit review status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13748

[issue6210] Exception Chaining missing method for suppressing context

2012-01-12 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us 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:

[issue6210] Exception Chaining missing method for suppressing context

2012-01-12 Thread Patrick Westerhoff
Patrick Westerhoff patrickwesterh...@gmail.com 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

[issue13703] Hash collision security issue

2012-01-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[issue13703] Hash collision security issue

2012-01-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[issue13703] Hash collision security issue

2012-01-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[issue13752] add a str.casefold() method

2012-01-12 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org 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

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

2012-01-12 Thread Meador Inge
Meador Inge mead...@gmail.com 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

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

2012-01-12 Thread Meador Inge
Meador Inge mead...@gmail.com 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,

[issue13752] add a str.casefold() method

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