[issue13754] str.ljust and str.rjust do not exactly describes original string return
Terry J. Reedy tjre...@udel.edu added the comment: The short doc strings do not mention the issue either way. I think it ok to leave them as they are. While the claim is how the functions *should* operate, I verified that it is how they *do* operate in all three branches. -- assignee: docs@python - terry.reedy keywords: +easy, patch nosy: +terry.reedy stage: - needs patch versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13754 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13753] str.join description contains an incorrect reference to argument
Changes by Terry J. Reedy tjre...@udel.edu: -- assignee: docs@python - terry.reedy keywords: +easy, patch nosy: +terry.reedy versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13753 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13748] Allow rb literals as an equivalent to br
Georg Brandl ge...@python.org added the comment: +1 for raw bytes, which reads much nicer to me than bytes raw. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13748 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__
Faheem Mitha fah...@faheem.info added the comment: What is the status on this? It contains to be an issue. See http://bugs.python.org/issue13751 and http://bugs.python.org/issue13760 -- nosy: +fmitha ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1692335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13753] str.join description contains an incorrect reference to argument
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13753 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13759] Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode
Ned Deily n...@acm.org added the comment: Can you give the exact steps of what you did to demonstrate the problem? Also, there are two OS X installers for Python 3.2.2. Which one did you install? (The two lines of version information when starting Python is enough to identify which one it is.) -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13759 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13752] add a unicode.casefold() method
Changes by Georg Brandl ge...@python.org: -- stage: - needs patch title: add a casefold() method - add a unicode.casefold() method ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13752 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
New submission from Georg Brandl ge...@python.org: Add a flush keyword argument to print(), defaulting to False. If true, output will be flushed immediately. See http://mail.python.org/pipermail/python-ideas/2012-January/013340.html -- assignee: georg.brandl components: Interpreter Core keywords: easy messages: 151041 nosy: georg.brandl priority: normal severity: normal stage: needs patch status: open title: Add flush keyword to print() type: enhancement versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13754] str.ljust and str.rjust do not exactly describes original string return
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 3aed8787ce5c by Terry Jan Reedy in branch '2.7': Closes #13754 String returned if less than *or equal to* x 3 http://hg.python.org/cpython/rev/3aed8787ce5c New changeset 3f2e5fd17b76 by Terry Jan Reedy in branch '3.2': #13754 String returned if less than *or equal to* x 3 http://hg.python.org/cpython/rev/3f2e5fd17b76 New changeset 0df85a2ebe4d by Terry Jan Reedy in branch 'default': Merge with 3.2 http://hg.python.org/cpython/rev/0df85a2ebe4d -- nosy: +python-dev resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13754 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13753] str.join description contains an incorrect reference to argument
Terry J. Reedy tjre...@udel.edu added the comment: See #13754 for commits (not here because 'close' != 'closes' or closed') -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13753 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13759] Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode
Atsushi Shibata shib...@webcore.co.jp added the comment: The procedure is following. 1. type python in the terminal.app to launch interactive mode. 2. type 'あ' in it. And I use Mac OS X 64-bit/32-bit Installer (3.2.2) for Mac OS X 10.6 and 10.7. Here is the first 2 lines of initial message. Python 3.2.2 (v3.2.2:137e45f15c0b, Sep 3 2011, 17:28:59) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin thanks :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13759 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4630] IDLE no longer respects .Xdefaults insertOffTime
Terry J. Reedy tjre...@udel.edu added the comment: The idea and design look good to me. I will test on Windows when I am able to do so in development builds (unless someone beats me ;-). -- nosy: +terry.reedy versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4630] IDLE: add cursor noblink option
Changes by Terry J. Reedy tjre...@udel.edu: -- title: IDLE no longer respects .Xdefaults insertOffTime - IDLE: add cursor noblink option ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13759] Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode
Ned Deily n...@acm.org added the comment: I am not familiar with the Japanese input methods available in OS X. But using copy and paste with an US UTF-8 locale, it seems to work. Perhaps there is a different locale in effect? Python 3.2.2 (v3.2.2:137e45f15c0b, Sep 3 2011, 17:28:59) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type help, copyright, credits or license for more information. x = 'あ' print(x) あ print(ord(x)) 12354 import unicodedata unicodedata.name(x) 'HIRAGANA LETTER A' print('%x' % ord(x)) 3042 import locale locale.getlocale() ('en_US', 'UTF-8') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13759 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: Patch version 5 fixes test_unicode for 64-bit system. Victor, I don't think the randomization idea is going anywhere. The code has many issues: * it is exceedingly complex * the method would need to be implemented for all hashable Python types * it causes startup time to increase (you need urandom data for every single hashable Python data type) * it causes run-time to increase due to changes in the hash algorithm (more operations in the tight loop) * causes different processes in a multi-process setup to use different hashes for the same object * doesn't appear to work well in embedded interpreters that regularly restarted interpreters (AFAIK, some objects persist across restarts and those will have wrong hash values in the newly started instances) The most important issue, though, is that it doesn't really protect Python against the attack - it only makes it less likely that an adversary will find the init vector (or a way around having to find it via crypt analysis). OTOH, the collision counting patch is very simple, doesn't have the performance issues and provides real protection against the attack. Even better still, it can detect programming errors in hash method implementations. IMO, it would be better to put efforts into refining the collision detection patch (perhaps adding support for the universal hash method slot I mentioned) and run some real life tests with it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13472] devguide doesn’t list all build dependencies
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13472 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13440] Explain the status quo wins a stalemate principle in the devguide
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13440 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12907] Update test coverage devguide page
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12907 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
STINNER Victor victor.stin...@haypocalc.com added the comment: * it is exceedingly complex Which part exactly? For hash(str), it just add two extra XOR. * the method would need to be implemented for all hashable Python types It was already discussed, and it was said that only hash(str) need to be modified. * it causes startup time to increase (you need urandom data for every single hashable Python data type) My patch reads 8 or 16 bytes from /dev/urandom which doesn't block. Do you have a benchmark showing a difference? I didn't try my patch on Windows yet. * it causes run-time to increase due to changes in the hash algorithm (more operations in the tight loop) I posted a micro-benchmark on hash(str) on python-dev: the overhead is nul. Did you have numbers showing that the overhead is not nul? * causes different processes in a multi-process setup to use different hashes for the same object Correct. If you need to get the same hash, you can disable the randomized hash (PYTHONHASHSEED=0) or use a fixed seed (e.g. PYTHONHASHSEED=42). * doesn't appear to work well in embedded interpreters that regularly restarted interpreters (AFAIK, some objects persist across restarts and those will have wrong hash values in the newly started instances) test_capi runs _testembed which restarts a embedded interpreters 3 times, and the test pass (with my patch version 5). Can you write a script showing the problem if there is a real problem? In an older version of my patch, the hash secret was recreated at each initiliazation. I changed my patch to only generate the secret once. The most important issue, though, is that it doesn't really protect Python against the attack - it only makes it less likely that an adversary will find the init vector (or a way around having to find it via crypt analysis). I agree that the patch is not perfect. As written in the patch, it just makes the attack more complex. I consider that it is enough. Perl has a simpler protection than the one proposed in my patch. Is Perl vulnerable to the hash collision vulnerability? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12296] Minor clarification in devguide
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12296 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13762] missing section: how to contribute to devguide
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: I struggled to find how to contribute to the devguide. I even struggled to find where the VCS is. I think it would be kool if there was a section for this info (it's not always fun to search the intertubes). -- components: Devguide messages: 151049 nosy: ezio.melotti, tshepang priority: normal severity: normal status: open title: missing section: how to contribute to devguide type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13762 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13124] Add Running a Build Slave page to the devguide
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13124 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12409] Moving Documenting Python to Devguide
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12409 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13275] Recommend xml.etree for XML processing
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13275 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13275] Recommend xml.etree for XML processing
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: @Araujo bit offtopic, but which XML library have you found most elegant? Is it available in the stdlib? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13275 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13763] rm obsolete reference in devguide
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: this line: commonly abbreviated svn, after the program name was once changed to: commonly abbreviated hg, after the program name and it no longer makes sense -- components: Devguide files: rm-obsolete-reference.patch keywords: patch messages: 151051 nosy: ezio.melotti, tshepang priority: normal severity: normal status: open title: rm obsolete reference in devguide Added file: http://bugs.python.org/file24200/rm-obsolete-reference.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13764] Misc/build.sh is outdated... talks about svn
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: I am wondering what else is outdated in that file. Is it still useful? -- components: Build messages: 151052 nosy: tshepang priority: normal severity: normal status: open title: Misc/build.sh is outdated... talks about svn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13764 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13759] Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode
Atsushi Shibata shib...@webcore.co.jp added the comment: Thank you for testing on your environment :-). I'll make sure the difference that caused the issue. I changed the status to pending. I'll come back to this issue when I find the crue. Thanks anyway ! -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13759 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13765] Distutils does not put quotes around paths that contain spaces when compiling with MSVC
New submission from Almar Klein almar.kl...@gmail.com: I found an easy to solve bug in distutils, which is causing problems with compiling Cython code on Windows. I have reproduced this on Python 2.6 and Python 3.2 (32 bit). The problem occurs with the native msvc compiler. Using gcc (MinGW) works fine. The problem is that the command to link the libraries does not put double quotes around paths that have spaces in them. Unfortunately, the path where I have Python installed has spaces in it (c:/program files/python26). Small example of part of a link command: /LIBPATH:C:\Program Files (x86)\python32\libs. Note that the include_dirs DO have double quotes around them. The problem is easily solved (I confirmed this) by a small change in msvc9compiler.py and msvccompiler.py (see also the patch): def library_dir_option(self, dir): # OLD VERSION return /LIBPATH: + dir def library_dir_option(self, dir): # FIXED VERSION if ' ' in dir and not dir.startswith(''): dir = '%s' % dir return /LIBPATH: + dir I tried to see if it would be nicer to apply a change elsewhere, e.g. where library_dir_option() is called. However, it is called nowhere from within the distutils package. In my case I suspect numpy.distutils or a part of Cython calls it. Anyway, in my opinion you should be able to pass this function a dirname that has a space in it, and get the right (partial) command. For the record, this change is quite safe because it checks whether quotes are already present. = Below follows a minimal Cython example and traceback = = test_.pyx def foo(): print('hello') = setup.py import os, sys from Cython.Distutils import build_ext from distutils.core import setup from distutils.extension import Extension from numpy.distutils.misc_util import get_numpy_include_dirs # Ugly hack so I can run setup.py in my IDE sys.argv = ['setup.py', 'build_ext', '--inplace'] # Init include dirs include_dirs = ['.'] include_dirs.extend(get_numpy_include_dirs()) # Creat Extensions ext_modules = [ Extension('test_', ['test_.pyx'], include_dirs=include_dirs, ), ] # Compile setup( cmdclass = {'build_ext': build_ext}, ext_modules = ext_modules, ) print('Successfully compiled cython file: test_') = output when running setup.py running build_ext No module named msvccompiler in numpy.distutils; trying from distutils cythoning test_.pyx to test_.c building 'test_' extension C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I. -IC:\Program Files (x86)\python32\lib\site-packages\numpy\core\include -IC:\Program Files (x86)\python32\include -IC:\Program Files (x86)\python32\PC /Tctest_.c /Fobuild\temp.win32-3.2\Release\test_.obj Found executable C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Program Files (x86)\python32\libs /LIBPATH:C:\Program Files (x86)\python32\PCbuild /EXPORT:PyInit_test_ build\temp.win32-3.2\Release\test_.obj /OUT:C:\almar\projects\py\cmu1394\test_.pyd /IMPLIB:build\temp.win32-3.2\Release\test_.lib /MANIFESTFILE:build\temp.win32-3.2\Release\test_.pyd.manifest Found executable C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe LINK : fatal error LNK1181: cannot open input file 'Files.obj' -- assignee: tarek components: Distutils files: distutils_spaces_in_libdir.patch keywords: patch messages: 151054 nosy: almar, eric.araujo, mhammond, tarek priority: normal severity: normal status: open title: Distutils does not put quotes around paths that contain spaces when compiling with MSVC type: behavior versions: Python 2.6, Python 3.2 Added file: http://bugs.python.org/file24201/distutils_spaces_in_libdir.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13765 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13766] explain the relationship between Lib/lib2to3/Grammar.txt and Grammar/Grammar
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: Lib/lib2to3/Grammar.txt seems like a modified copy of Grammar/Grammar. Can you state so somewhere, maybe in the beginning of Lib/lib2to3/Grammar.txt (the Note section). One problem with the way it is now, is that there are changes done to Grammar/Grammar that are not put into Lib/lib2to3/Grammar.txt. Maybe they are minor, but I think we don't want them diverging too much. Another problem is that the Note on Lib/lib2to3/Grammar.txt maybe irrelevant, since this is not the authoritative Grammar file. -- assignee: docs@python components: Documentation messages: 151055 nosy: docs@python, tshepang priority: normal severity: normal status: open title: explain the relationship between Lib/lib2to3/Grammar.txt and Grammar/Grammar type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13766 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13762] missing section: how to contribute to devguide
Sandro Tosi sandro.t...@gmail.com added the comment: Hello Tshepang, The current section is at: http://docs.python.org/devguide/docquality.html#helping-with-the-developer-s-guide reachable from the mainpage looking for helping with documentation. it may be a little to condense but it is a good start (and it seems to cover the points you made in the issue): do you find it useful as it is? would you like to add something? -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13762 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13762] missing section: how to contribute to devguide
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: I guess I should have looked more carefully. Thanks and sorry for the noise. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13762 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2175] Expat sax parser silently ignores the InputSource protocol
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2175 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12779] Update packaging documentation
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12779 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1975 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13767] Would be nice to have a future import that turned off old except style
New submission from Zaheer Merali zaheermer...@gmail.com: It would be nice to have a future import to be able to prevent people in code doing: try: except Exception, e: and make people do: try: except Exception as e: -- components: Interpreter Core messages: 151058 nosy: Zaheer.Merali priority: normal severity: normal status: open title: Would be nice to have a future import that turned off old except style type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13762] missing section: how to contribute to devguide
Changes by Sandro Tosi sandro.t...@gmail.com: -- resolution: - invalid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13762 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13767] Would be nice to have a future import that turned off old except style
Ezio Melotti ezio.melo...@gmail.com added the comment: If you run python with the -3 flag you should get a warning about that. If you combine it with -We you should be able to get an error instead of a warning. Note however that both the flags are not specific for the except but also generate/affect other warnings as well. -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13767] Would be nice to have a future import that turned off old except style
Benjamin Peterson benja...@python.org added the comment: Unfortunately, that would be a new feature, so it is not acceptable to Python 2.7. -- nosy: +benjamin.peterson resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: * it is exceedingly complex Which part exactly? For hash(str), it just add two extra XOR. I'm not talking specifically about your patch, but the whole idea and the needed changes in general. * the method would need to be implemented for all hashable Python types It was already discussed, and it was said that only hash(str) need to be modified. Really ? What about the much simpler attack on integer hash values ? You only have to send a specially crafted JSON dictionary with integer keys to a Python web server providing JSON interfaces in order to trigger the integer hash attack. The same goes for the other Python data types. * it causes startup time to increase (you need urandom data for every single hashable Python data type) My patch reads 8 or 16 bytes from /dev/urandom which doesn't block. Do you have a benchmark showing a difference? I didn't try my patch on Windows yet. Your patch only implements the simple idea of adding an init vector and a fixed suffix vector (which you don't need since it doesn't prevent hash collisions). I don't think that's good enough, since it doesn't change how the hash algorithm works on the actual data, but instead just shifts the algorithm to a different sequence. If you apply the same logic to the integer hash function, you'll see that more clearly. Paul's algorithm is much more secure in this respect, but it requires more random startup data. * it causes run-time to increase due to changes in the hash algorithm (more operations in the tight loop) I posted a micro-benchmark on hash(str) on python-dev: the overhead is nul. Did you have numbers showing that the overhead is not nul? For the simple solution, that's an expected result, but if you want more safety, then you'll see a hit due to the random data getting XOR'ed in every single loop. * causes different processes in a multi-process setup to use different hashes for the same object Correct. If you need to get the same hash, you can disable the randomized hash (PYTHONHASHSEED=0) or use a fixed seed (e.g. PYTHONHASHSEED=42). So you have the choice of being able to work in a multi-process environment and be vulnerable to the attack or not. I think we can do better :-) Note that web servers written in Python tend to be long running processes, so an attacker has lots of time to test various seeds. * doesn't appear to work well in embedded interpreters that regularly restarted interpreters (AFAIK, some objects persist across restarts and those will have wrong hash values in the newly started instances) test_capi runs _testembed which restarts a embedded interpreters 3 times, and the test pass (with my patch version 5). Can you write a script showing the problem if there is a real problem? In an older version of my patch, the hash secret was recreated at each initiliazation. I changed my patch to only generate the secret once. Ok, that should fix the case. Two more issue that I forgot: * enabling randomized hashing can make debugging a lot harder, since it's rather difficult to reproduce the same state in a controlled way (unless you record the hash seed somewhere in the logs) and even though applications should not rely on the order of dict repr()s or str()s, they do often enough: * randomized hashing will result in repr() and str() of dictionaries to be random as well The most important issue, though, is that it doesn't really protect Python against the attack - it only makes it less likely that an adversary will find the init vector (or a way around having to find it via crypt analysis). I agree that the patch is not perfect. As written in the patch, it just makes the attack more complex. I consider that it is enough. Wouldn't you rather see a fix that works for all hash functions and Python objects ? One that doesn't cause performance issues ? The collision counting idea has this potential. Perl has a simpler protection than the one proposed in my patch. Is Perl vulnerable to the hash collision vulnerability? I don't know what Perl did or how hashing works in Perl, so cannot comment on the effect of their fix. FWIW, I don't think that we should use Perl or Java as reference here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Antoine Pitrou pit...@free.fr added the comment: OTOH, the collision counting patch is very simple, doesn't have the performance issues and provides real protection against the attack. I don't know about real protection: you can still slow down dict construction by 1000x (the number of allowed collisions per lookup), which can be enough combined with a brute-force DOS. Also, how about false positives? Having legitimate programs break because of legitimate data would be a disaster. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Mark Shannon m...@hotpy.org added the comment: * the method would need to be implemented for all hashable Python types It was already discussed, and it was said that only hash(str) need to be modified. Really ? What about the much simpler attack on integer hash values ? You only have to send a specially crafted JSON dictionary with integer keys to a Python web server providing JSON interfaces in order to trigger the integer hash attack. JSON objects are decoded as dicts with string keys, integers keys are not possible. json.loads(json.dumps({1:2})) {'1': 2} -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13768] Doc/tools/dailybuild.py available only on 2.7 branch
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: tshepang priority: normal severity: normal status: open title: Doc/tools/dailybuild.py available only on 2.7 branch versions: Python 2.6, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13768 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Marc-Andre Lemburg m...@egenix.com added the comment: Mark Shannon wrote: Mark Shannon m...@hotpy.org added the comment: * the method would need to be implemented for all hashable Python types It was already discussed, and it was said that only hash(str) need to be modified. Really ? What about the much simpler attack on integer hash values ? You only have to send a specially crafted JSON dictionary with integer keys to a Python web server providing JSON interfaces in order to trigger the integer hash attack. JSON objects are decoded as dicts with string keys, integers keys are not possible. json.loads(json.dumps({1:2})) {'1': 2} Thanks for the correction. Looks like XML-RPC also doesn't accept integers as dict keys. That's good :-) However, as Paul already noted, such attacks can also occur in other places or parsers in an application, e.g. when decoding FORM parameters that use integers to signal a line or parameter position (example: value_1=2value_2=3...) which are then converted into a dictionary mapping the position integer to the data. marshal and pickle are vulnerable, but then you normally don't expose those to untrusted data. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Marc-Andre Lemburg m...@egenix.com added the comment: Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: OTOH, the collision counting patch is very simple, doesn't have the performance issues and provides real protection against the attack. I don't know about real protection: you can still slow down dict construction by 1000x (the number of allowed collisions per lookup), which can be enough combined with a brute-force DOS. On my slow dev machine 1000 collisions run in around 22ms: python2.7 -m timeit -n 100 dict((x*(2**64 - 1), 1) for x in xrange(1, 1000)) 100 loops, best of 3: 22.4 msec per loop Using this for a DOS attack would be rather noisy, much unlike sending a single POST. Note that the choice of 1000 as limit is rather arbitrary. I just chose it because it's high enough because it's very unlikely to be hit by an application that is not written to trigger it and it's low enough to still provide a good run-time behavior. Perhaps an even lower figure would be better. Also, how about false positives? Having legitimate programs break because of legitimate data would be a disaster. Yes, which is why the patch should be disabled by default (using an env var) in dot-releases. It's probably also a good idea to make the limit configurable to adjust to ones needs. Still, it is *very* unlikely that you run into real data causing more than 1000 collisions for a single insert. For full protection the universal hash method idea would have to be implemented (adding a parameter to the hash methods, so that they can be parametrized). This would then allow switching the dict to an alternative hash implementation resolving the collision problem, in case the implementation detects high number of collisions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13769] json.dump(ensure_ascii=False) return str instead of unicode
New submission from Марк Коренберг socketp...@gmail.com: $ ipython In [1]: type(json.dumps({'a':'b'}, ensure_ascii=False)) Out[1]: type 'str' In [2]: type(json.dumps({'a':u'b'}, ensure_ascii=False)) Out[2]: type 'unicode' --- Documentation: If ensure_ascii is False, then the return value will be a unicode instance. Not applicable to python3 -- assignee: docs@python components: Documentation, Library (Lib) messages: 151066 nosy: docs@python, mmarkk priority: normal severity: normal status: open title: json.dump(ensure_ascii=False) return str instead of unicode type: behavior versions: Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13769 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13770] python3 json: add ensure_ascii documentation
New submission from Марк Коренберг socketp...@gmail.com: Please fix documentation about ensure_ascii. Does it have any meaning in python3? -- assignee: docs@python components: Documentation messages: 151067 nosy: docs@python, mmarkk priority: normal severity: normal status: open title: python3 json: add ensure_ascii documentation versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13770 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13770] python3 json: add ensure_ascii documentation
Changes by Марк Коренберг socketp...@gmail.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13770 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__
Tal Einat talei...@gmail.com added the comment: I'd just like to weigh in and say that this is a major issue for me at the moment. Not being able to indiscriminately pickle/unpickle exceptions is making my parallel-processing work very painful, because of problematic stdlib exceptions. I'm surprised this hasn't been fixed way back in 2.x. FWIW, for my project having this fixed in 3.x could be a significant incentive to finally ditch 2.x. -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1692335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Antoine Pitrou pit...@free.fr added the comment: On my slow dev machine 1000 collisions run in around 22ms: python2.7 -m timeit -n 100 dict((x*(2**64 - 1), 1) for x in xrange(1, 1000)) 100 loops, best of 3: 22.4 msec per loop Using this for a DOS attack would be rather noisy, much unlike sending a single POST. Note that sending one POST is not enough, unless the attacker is content with blocking *one* worker process for a couple of seconds or minutes (which is a rather tiny attack if you ask me :-)). Also, you can combine many dicts in a single JSON list, so that the 1000 limit isn't overreached for any of the dicts. So in all cases the attacker would have to send many of these POST requests in order to overwhelm the target machine. That's how DOS attacks work AFAIK. Yes, which is why the patch should be disabled by default (using an env var) in dot-releases. It's probably also a good idea to make the limit configurable to adjust to ones needs. Agreed if it's disabled by default then it's not a problem, but then Python is vulnerable by default... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Mark Dickinson dicki...@gmail.com added the comment: [Antoine] Also, how about false positives? Having legitimate programs break because of legitimate data would be a disaster. This worries me, too. [MAL] Yes, which is why the patch should be disabled by default (using an env var) in dot-releases. Are you proposing having it enabled by default in Python 3.3? -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Marc-Andre Lemburg m...@egenix.com added the comment: Mark Dickinson wrote: Mark Dickinson dicki...@gmail.com added the comment: [Antoine] Also, how about false positives? Having legitimate programs break because of legitimate data would be a disaster. This worries me, too. [MAL] Yes, which is why the patch should be disabled by default (using an env var) in dot-releases. Are you proposing having it enabled by default in Python 3.3? Possibly, yes. Depends on whether anyone comes up with a problem in the alpha, beta, RC release cycle. It would be great to have the universal hash method approach for Python 3.3. That way Python could self-heal itself in case it finds too many collisions. My guess is that it's still better to raise an exception, though, since it would uncover either attacks or programming errors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13771] HTTPSConnection __init__ super implementation causes recursion error
New submission from Michael Mulich michael.mul...@gmail.com: While working on porting wsgi_intercept to Python 3 I came across a recursion issue with http.client.HTTPSConnection. The following is an lesser extraction of the traceback: Traceback (most recent call last): File .../wsgi_intercept/test/test_httplib.py, line 28, in test_success http = self.make_one(self.domain) File .../wsgi_intercept/test/test_httplib.py, line 40, in make_one return http.client.HTTPSConnection(*args) File .../lib/python3.2/http/client.py, line 1075, in __init__ source_address) ... File .../lib/python3.2/http/client.py, line 1075, in __init__ source_address) File .../lib/python3.2/http/client.py, line 1074, in __init__ super(HTTPSConnection, self).__init__(host, port, strict, timeout, RuntimeError: maximum recursion depth exceeded while calling a Python object Some background information is necessary to explain what is happening here. One, this is a traceback from a test method (make_one) which makes and https connection. Two, wsgi_intercept has overridden http.client.HTTPSConnection with a class that subclasses HTTPSConnection and overrides a few methonds. For more general information, see the PyPI page (http://pypi.python.org/pypi/wsgi_intercept). After the wsgi_intercept behavior is invoked the __mro__ of http.client.HTTPSConnection becomes: (class 'wsgi_intercept.WSGI_HTTPSConnection', class 'http.client.HTTPSConnection', class 'http.client.HTTPConnection', class 'object'). Because of this we end up recursively running the __init__. Possible solutions: 1) Fix the issue in http/client.py:1074 by replacing super(HTTPSConnection, self) with super(), which if I'm not mistaken is the recommended usage of super in Python 3. 2) Fix the issue in the wsgi_intercept package. I was successful with both approaches, but applying the second fix would make the maintenance of wsgi_intercept slightly harder because of the code duplication and round-about-way of calling its parent classes. -- components: None messages: 151072 nosy: michael.mulich priority: normal severity: normal status: open title: HTTPSConnection __init__ super implementation causes recursion error type: behavior versions: Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13771 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13771] HTTPSConnection __init__ super implementation causes recursion error
Changes by Antoine Pitrou pit...@free.fr: -- components: +Library (Lib) -None nosy: +orsenthil versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13771 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Marc-Andre Lemburg m...@egenix.com added the comment: Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: On my slow dev machine 1000 collisions run in around 22ms: python2.7 -m timeit -n 100 dict((x*(2**64 - 1), 1) for x in xrange(1, 1000)) 100 loops, best of 3: 22.4 msec per loop Using this for a DOS attack would be rather noisy, much unlike sending a single POST. Note that sending one POST is not enough, unless the attacker is content with blocking *one* worker process for a couple of seconds or minutes (which is a rather tiny attack if you ask me :-)). Also, you can combine many dicts in a single JSON list, so that the 1000 limit isn't overreached for any of the dicts. Right, but such an approach only scales linearly and doesn't exhibit the quadric nature of the collision resolution. The above with 1 items takes 5 seconds on my machine. The same with 10 items is still running after 16 minutes. So in all cases the attacker would have to send many of these POST requests in order to overwhelm the target machine. That's how DOS attacks work AFAIK. Depends :-) Hiding a few tens of such requests in the input stream of a busy server is easy. Doing the same with thousands of requests is a lot harder. FWIW: The above dict string version just has some 263kB for the 10 case, 114kB if gzip compressed. Yes, which is why the patch should be disabled by default (using an env var) in dot-releases. It's probably also a good idea to make the limit configurable to adjust to ones needs. Agreed if it's disabled by default then it's not a problem, but then Python is vulnerable by default... Yes, but at least the user has an option to switch on the added protection. We'd need some field data to come to a decision. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Antoine Pitrou pit...@free.fr added the comment: [MAL] Yes, which is why the patch should be disabled by default (using an env var) in dot-releases. Are you proposing having it enabled by default in Python 3.3? I would personally prefer 3.3 and even 3.2 to have proper randomization (either Paul's or Victor's or another proposal). Victor's proposal makes fixing other hash functions very simple (there could even be helper macros). The only serious concern IMO is startup time under Windows; someone with Windows-fu should investigate that. 2.x maintainers might want to be more conservative, although disabling a fix (the collision counter) by default doesn't sound very wise or helpful to me. (for completeness, the collision counter must also be added to sets, btw) It would be nice to hear from distro maintainers here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Guido van Rossum gu...@python.org added the comment: In the python-ideas discussion people have argued that flush=False should or could be interpreted as definitely do not flush which is unimplementable (the buffer may be full, or the stream may be unbuffered, and there is no way to tell a write() call to skip the flushing if the stream's policy would be to flush). Sticklers have proposed to name the flag force_flush to avoid this ambiguity, or to pass None instead of False. I think that's all being hypercorrect -- first of all, nobody is going to explicitly write flush=False since that is the default, and second of all, who could possibly care about not flushing on a per-call basis? The flag should have a short name and simple semantics. flush=True/False does this: if flush is true, an explicit flush() call is made, if it is false, flush() is not called. What the stream does is its business. -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13758] compile() should not encode 'filename' (at least on Windows)
Terry J. Reedy tjre...@udel.edu added the comment: My supposition that compile() rejects some real file names appears correct: from python-list ME: Is this a filename that could be an actual, valid filename on your system? OP: Yes it is. open works on that file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13758 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13734] Add a generic directory walker method to avoid symlink attacks
Charles-François Natali neolo...@free.fr added the comment: Here's an updated version. Note that I'm not pushing towards changing the current behavior pertaining to symlinks to directories, because if we change this, this will break code. For example to count the number of lines of all the files under a directory, a code could go like this: for root, dirs, files in os.walk(top): for file in files: f = open(file) for n, l in enumerate(f, 1): pass print(file, n) If, suddently, a symlink to a directory appeared in files, this will break. So I'm not convinced it's worth changing this. A symlink to a directory is not much closer to a file than to a directory, it really depends on the use case. I'm also fine with keeping fdwalk() consistent with this to make porting easier (and also because it makes it easy to test, I just have to compare fdwlak()'s output to walk()'s output). -- Added file: http://bugs.python.org/file24202/fdwalk-1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13734 ___diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2240,6 +2240,58 @@ os.rmdir(os.path.join(root, name)) +.. function:: fdwalk(top, topdown=True, onerror=None, followlinks=False) + + .. index:: + single: directory; walking + single: directory; traversal + +This behaves exactly like :func:`walk`, except that it yields a 4-tuple +``(dirpath, dirnames, filenames, dirfd)``. + + *dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, + and *dirfd* is a file descriptor referring to the directory *dirpath*. + + .. note:: + + Since :func:`fdwalk` yields file descriptors, those are only valid until + the next iteration step, so you should duplicate them (e.g. with + :func:`dup`) if you want to keep them longer. + + .. note:: + + Contrarily to :func:`walk`, modifying the dirnames list in-place won't + affect the directories traversed. + + This example displays the number of bytes taken by non-directory files in each + directory under the starting directory:: + + import os + for root, dirs, files, rootfd in os.fdwalk('python/Lib/email'): + print(root, consumes, end=) + print(sum([os.fstatat(rootfd, name).st_size for name in files]), +end=) + print(bytes in, len(files), non-directory files) + + In the next example, walking the tree bottom-up is essential: + :func:`unlinkat` doesn't allow deleting a directory before the directory is + empty:: + + # Delete everything reachable from the directory named in top, + # assuming there are no symbolic links. + # CAUTION: This is dangerous! For example, if top == '/', it + # could delete all your disk files. + import os + for root, dirs, files, rootfd in os.fdwalk(top, topdown=False): + for name in files: + os.unlinkat(rootfd, name) + for name in dirs: + os.unlinkat(rootfd, name, os.AT_REMOVEDIR) + + Availability: Unix. + + .. versionadded:: 3.3 + .. _os-process: Process Management diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -478,6 +478,10 @@ (Patch submitted by Giampaolo Rodolà in :issue:`10784`.) +* The :mod:`os` module has a new :func:`~os.fdwalk` function similar to + :func:`~os.walk` except that it also yields file descriptors referring to the + directories visited. This is especially useful to avoid symlink races. + * at functions (:issue:`4761`): * :func:`~os.faccessat` diff --git a/Lib/os.py b/Lib/os.py --- a/Lib/os.py +++ b/Lib/os.py @@ -24,6 +24,7 @@ #' import sys, errno +import stat as st _names = sys.builtin_module_names @@ -32,6 +33,9 @@ defpath, name, path, devnull, SEEK_SET, SEEK_CUR, SEEK_END] +def _exists(name): +return name in globals() + def _get_exports_list(module): try: return list(module.__all__) @@ -120,7 +124,13 @@ umask(mask) return mode ~mask -#' +def _are_same_file(stat1, stat2): +Helper function that checks whether two stat results refer to the same +file. + +return (stat1.st_mode == stat2.st_mode and stat1.st_ino == stat2.st_ino and +stat1.st_dev == stat2.st_dev) +# # Super directory utilities. # (Inspired by Eric Raymond; the doc strings are mostly his) @@ -151,7 +161,6 @@ try: mkdir(name, mode) except OSError as e: -import stat as st if not (e.errno == errno.EEXIST and exist_ok and path.isdir(name) and st.S_IMODE(lstat(name).st_mode) == _get_masked_mode(mode)): raise @@ -298,6 +307,94 @@ __all__.append(walk) +if _exists(openat): + +def fdwalk(top, topdown=True,
[issue8184] multiprocessing.managers will not fail if listening ocket already in use
Antoine Pitrou pit...@free.fr added the comment: I noticed that if bind() fails (in this case with EADDRINUSE), the socket isn't closed (FD leak). Well it would probably be closed when the connection object is destroyed, but the patch looks ok anyway. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8184 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11633] Document that print may need explicit flushing
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset bc043cef94f2 by Terry Jan Reedy in branch '3.2': Closes #11633 Clarify print buffering. http://hg.python.org/cpython/rev/bc043cef94f2 New changeset fb0d61fd1753 by Terry Jan Reedy in branch 'default': Merge with 3.2 http://hg.python.org/cpython/rev/fb0d61fd1753 -- nosy: +python-dev resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11633] Document that print may need explicit flushing
Terry J. Reedy tjre...@udel.edu added the comment: #13761 proposes to add flush=False param with option for True. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13769] json.dump(ensure_ascii=False) return str instead of unicode
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13769 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Terry J. Reedy tjre...@udel.edu added the comment: I added a couple of lines to the 3.2, 3.3 print doc in #11633. When a change is made here, they could be updated to something like: Output buffering is normally determined by *file*. Use flush=True to force immediate output to a device such as a screen. Unless there is a good reason, I prefer, unlike the other params, *not* allowing flush=None as a synonym for flush=the default, ie False. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Georg Brandl ge...@python.org added the comment: There is a reason: we don't usually check the type of flag arguments; just their truth value is used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Georg Brandl ge...@python.org added the comment: Here is a patch. One open question is whether failure in flush() should be reraised (as implemented in the patch), or ignored (as in input()). -- keywords: +patch Added file: http://bugs.python.org/file24203/flush.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11418] Method's global scope is module containing function definition, not class.
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 10a5165103f9 by Terry Jan Reedy in branch '2.7': Minor correction. Closes #11418 http://hg.python.org/cpython/rev/10a5165103f9 New changeset 32ea3675fba2 by Terry Jan Reedy in branch '3.2': Minor correction. #11418 http://hg.python.org/cpython/rev/32ea3675fba2 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11418 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12409] Moving Documenting Python to Devguide
Sandro Tosi sandro.t...@gmail.com added the comment: Hi, i'm at last back with some work to show; I've integrated all the Documenting python doc into devguide, and the commits are in this sandbox: http://hg.python.org/sandbox/morph-devguide/shortlog/a92d431ef749 (`documenting` branch). I took the files from default branch and merged all of them in a single page. It might be a bit log, but it has the advantage (at least for me) that there you can find all the info you need for documenting python, a ctrl+f works and you don't need to follow tons of links to find what you're looking for. then I've removed all the info from default branch (here: http://hg.python.org/sandbox/morph/shortlog/e9a4276b19d4 in default-documenting branch) which left only documenting/index.rst as mainly a reference to the devguide. I don't know what would be the best way to handle this transition on the python doc side, maybe converting that to a simple Doc/documenting.rst as it's now index.rst? but what text to left? Comments are very welcome! -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12409 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13772] listdir() doesn't work with non-trivial symlinks
New submission from Antoine Pitrou pit...@free.fr: Note how _getfinalpathname works and calling listdir on the final path name also works: os.symlink(.\\test, Lib\\bar) os.listdir(Lib\\bar)[:4] Traceback (most recent call last): File stdin, line 1, in module NotADirectoryError: [Error 267] The directory name is invalid: 'Lib\\bar\\*.*' nt._getfinalpathname(Lib\\bar) '?\\C:\\t\\pathlib\\Lib\\test' os.listdir(nt._getfinalpathname(Lib\\bar))[:4] ['185test.db', 'audiotest.au', 'autotest.py', 'badcert.pem'] Calling listdir on the non-final extended path doesn't work: os.listdir('?\\C:\\t\\pathlib\\Lib\\bar')[:4] Traceback (most recent call last): File stdin, line 1, in module NotADirectoryError: [Error 267] The directory name is invalid: '?\\C:\\t\\pa thlib\\Lib\\bar\\*.*' But open() works: open('Lib\\bar\\regrtest.py') _io.TextIOWrapper name='Lib\\bar\\regrtest.py' mode='r' encoding='cp1252' -- components: Library (Lib), Windows messages: 151087 nosy: amaury.forgeotdarc, brian.curtin, pitrou, tim.golden priority: normal severity: normal status: open title: listdir() doesn't work with non-trivial symlinks type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13772 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation
Benjamin Peterson benja...@python.org added the comment: New patch with title casing mappings added. -- Added file: http://bugs.python.org/file24204/full-casemapping.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12736 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13773] Support sqlite3 uri filenames
New submission from poq p...@gmx.com: URIs are an extensible way to pass options to SQLite. See: http://www.sqlite.org/uri.html Patch adds a keyword argument uri to sqlite3.connect which causes the filename to be parsed as a URI if set to True. -- components: Extension Modules files: sqlite-uri.patch keywords: patch messages: 151089 nosy: poq priority: normal severity: normal status: open title: Support sqlite3 uri filenames type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24205/sqlite-uri.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13773] Support sqlite3 uri filenames
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Hi, I will let others discuss the feature itself, here are already some comments about your patch: - In module_connect(), the ability to pass factory as a positional argument is broken, please restore the previous code; I'm afraid there is no better implementation, even if it's a copy of connection.__init__. - I suggest to allow uri in all builds, and fail only when it's True on a non supported platform. - In general, try to wrap C code in 80 columns (except for the .. function:: directive in .rst files) - IIRC a correct URI is file:///path/to/file but sqlite probably allows file:/path/to/file as well. - The test function should use from test.support import TESTFN to get a temporary file name (but I agree that sqlite tests don't seem to follow Python standards) -- nosy: +amaury.forgeotdarc stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Guido van Rossum gu...@python.org added the comment: I'd ignore the failure. It could easily mask some other more interesting error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Charles-François Natali neolo...@free.fr added the comment: I must be missing something, but how is raising an exception when a collision threshold is reached a good thing? Basically, we're just exchanging a DoS for another (just feed the server process with ad-hoc data and he'll commit suicide). Sure, the caller can catch the exception to detect this, but what for? Restart the process, so that the attacker can just try again? Also, there's the potential of perfectly legit applications breaking. IMHO, randomization is the way to go, so that an attacker cannot generate a set of colliding values beforehand, which renders the attack impracticle. The same idea is behind ASLR used in modern kernels, and AFAICT, has been chosen by other implementations. If a such patch has a negligible performance impact, then it should definitely be enabled by default. People who want deterministic hashing (maybe to bypass an application bug, or just because the want determinism) can disable it if they really want to. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)
Ronald Oussoren ronaldousso...@mac.com added the comment: I've found a bug in the curses module that is causing problems: diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2056,7 +2056,8 @@ {encoding, (getter)PyCursesWindow_get_encoding, (setter)PyCursesWindow_set_encoding, - the typecode character used to create the array} + the typecode character used to create the array}, +{NULL, NULL, NULL, NULL} }; /* ---*/ That is, there is no sentinel in the PyCursesWindow_getsets list. Shouldn't this cause failures on more platforms than just OSX? With this patch I can build python 3.3 with clang (as included in Xcode 4.2.1). BTW. clang as included with Xcode 4.2.1 seems to build the attached copy of unicode.c without problems, the gcc command still fails though. I did run into problems when building outside of the source directory, but that seems to be an unrelated issue. -- keywords: +needs review, patch Added file: http://bugs.python.org/file24206/issue13241.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13241 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13681] Aifc read compressed frames fix
Sandro Tosi sandro.t...@gmail.com added the comment: Hi Oleg, thanks for your interest in aifc module! I think that if the fix for audioop has a reason for itself to exists, then another issue (for that only) has to be filed and set the accordingly dependency on this one. -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13681 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13763] rm obsolete reference in devguide
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? -- nosy: +sandro.tosi stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13763] rm obsolete reference in devguide
Ezio Melotti ezio.melo...@gmail.com added the comment: If 'program' refers to the executable, the sentence is still valid. -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13773] Support sqlite3 uri filenames
poq p...@gmx.com added the comment: Thanks for your comments. You're right, I didn't consider positional arguments. Here's a patch that addresses your comments. Should I also rewrap modified lines that were already much too long? I also noticed fixed an unrelated typo in Lib/sqlite3/test/hooks.py... -- Added file: http://bugs.python.org/file24207/sqlite-uri.v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f7e05d205a52 by Benjamin Peterson in branch 'default': use full unicode mappings for upper/lower/title case (#12736) http://hg.python.org/cpython/rev/f7e05d205a52 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12736 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12736] Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation
Changes by Benjamin Peterson benja...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12736 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Changes by Cameron Simpson c...@zip.com.au: -- nosy: +cameron ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13772] listdir() doesn't work with non-trivial symlinks
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13772 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)
Nam Nguyen bits...@gmail.com added the comment: Ronald's patch does fix the segmentation fault with clang-compiled Python. But this bug report seems to be about LLVM-GCC not compiling correctly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13241 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2
New submission from Julian Berman julian+python@grayvines.com: import json json.loads({}, [1, 2, 3]) Traceback (most recent call last): File input, line 1, in module File /usr/local/Cellar/python/2.7.2/lib/python2.7/json/__init__.py, line 339, in loads return cls(encoding=encoding, **kw).decode(s) File /usr/local/Cellar/python/2.7.2/lib/python2.7/json/decoder.py, line 359, in __init__ self.scan_once = scanner.make_scanner(self) SystemError: NULL result without error in PyObject_Call Python 3.2 and 2.6 are not affected it'd seem, so it looks to be 2.7 only. -- components: Library (Lib) messages: 151100 nosy: Julian priority: normal severity: normal status: open title: json.loads raises a SystemError for invalid encoding on 2.7.2 versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13774 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13775] Access Denied message on symlink creation misleading for an existing file/directory target.
New submission from Santoso Wijaya santoso.wij...@gmail.com: Consider: os.symlink('.\\test', 'Lib\\bar') Traceback (most recent call last): File stdin, line 1, in module WindowsError: [Error 5] Access is denied: '.\\test' Where Lib\\bar is previously created. The symlink creation is rightly rejected, but with a misleading message. The failure is because 'Lib\\bar' already exists, not because of '.\\test'. -- components: Windows messages: 151101 nosy: santa4nt priority: normal severity: normal status: open title: Access Denied message on symlink creation misleading for an existing file/directory target. type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13775 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13775] Access Denied message on symlink creation misleading for an existing file/directory target.
Santoso Wijaya santoso.wij...@gmail.com added the comment: Simple patch. -- keywords: +patch Added file: http://bugs.python.org/file24208/issue13775_py33.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13775 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13772] listdir() doesn't work with non-trivial symlinks
Santoso Wijaya santoso.wij...@gmail.com added the comment: I think this is because Lib\\bar is NOT being created as a directory symlink, but rather as a regular one. As such, the documentation for symlink where it states the optional `target_is_directory=False` argument should be automatically detect whether the source is a file or directory does not hold true. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13772 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Cameron Simpson c...@zip.com.au added the comment: I'm against ignoring a flush failure. What happened to errors should never pass silently? IMO, if we get as far as calling flush and having an exception occur, a more interesting error hasn't yet occurred. I really dislike things that fail silently. If the caller asks print to flush, and the flush fails, the caller's request has not been met. The caller needs to know or incorrect behaviour can ensue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13772] listdir() doesn't work with non-trivial symlinks
Santoso Wijaya santoso.wij...@gmail.com added the comment: Confirmed (on latest py33 build): os.listdir('Lib\\bar')[:4] Traceback (most recent call last): File stdin, line 1, in module NotADirectoryError: [Error 267] The directory name is invalid: 'Lib\\bar\\*.*' [61658 refs] ... after manually deleting the file-symlink `bar` ... os.symlink('.\\test', 'Lib\\bar', target_is_directory=True) [61658 refs] os.listdir('Lib\\bar')[:4] ['185test.db', 'audiotest.au', 'autotest.py', 'badcert.pem'] [61666 refs] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13772 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11633] Document that print may need explicit flushing
Changes by Cameron Simpson c...@zip.com.au: -- nosy: +cameron ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13772] listdir() doesn't work with non-trivial symlinks
Antoine Pitrou pit...@free.fr added the comment: I think this is because Lib\\bar is NOT being created as a directory symlink, but rather as a regular one. Ha! I didn't even know about that option. Thanks for noticing. As such, the documentation for symlink where it states the optional `target_is_directory=False` argument should be automatically detect whether the source is a file or directory does not hold true. I don't know if auto-detection is a good idea. Of a course, from a Unix user's perspective, Windows' behaviour doesn't make a lot of sense. Especially when functions other than listdir() work fine anyway. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13772 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Antoine Pitrou pit...@free.fr added the comment: I think it should be re-raised (or rather, let pass through as in the patch). If you are asking for a flush you want to know why it failed. (it shouldn't ever fail on normal files, anyway) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Cameron Simpson c...@zip.com.au added the comment: Flush can fail of disc full or any number of low level things that prevent the OS getting the data into the on-disc file. Speaking for myself, I certainly want to know if that happens. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Guido van Rossum gu...@python.org added the comment: Ok, I'm fine with passing through the exception from flush(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13761] Add flush keyword to print()
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13761 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4806 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11944] Function call with * and generator hide exception raised by generator.
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11944 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator
Martin Panter vadmium...@gmail.com added the comment: I haven’t tried to understand what the patches do, but Issue 5218 looks like a very similar problem with a patch including a test case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4806 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com