[issue11397] os.path.realpath() may produce incorrect results
Martin Panter vadmium...@gmail.com added the comment: Another infinite loop that isn't caught in Python 3.2.1: With the symbolic link link = link/inside a readlink(link) call will keep looping. Anyhow, the proposed solution in issue11397_py32_2.patch does not account for paths with multiple independent references to the same link. Example link: here = . Calling readlink(here/here) for me should return /media/disk/home/vadmium (my current directory, containing the here link), but the proposed version returns an /media/disk/home/vadmium/here/here (incompletely resolved). I suggest something similar to realpath_link_stack.py I am attaching. I think the main difference is it pops each link off the cycle-detection stack after it has been resolved. -- nosy: +vadmium Added file: http://bugs.python.org/file22954/realpath_link_stack.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11397 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12791] Yield leaks exception being handled as garbage
New submission from Martin Panter vadmium...@gmail.com: See attached leaky_generator.py demo. Python doesn't appear to delete the exception variable if an exception is thrown back into it (via throw, close or by deleting it). The result is a reference cycle that needs garbage collecting. This even happens when no exception variable is named. The exception variable is not leaked if the generator is called normally (via next or send). The exception variable of an exception handler is usually deleted (according to http://docs.python.org/py3k/reference/compound_stmts.html#the-try-statement) as soon as the handler is exited, even when it is not exited by simply falling through the end. So either this should also happen for yield inside the exception handler, or it should be documented that yield inside except, even without as, should be avoided. I'm guessing this issue is specific to Python 3 because it exists for me in Python 3.2, 3.2.1 (both on Arch Linux) and 3.1.2 (Ubuntu) but not Python 2.7.1, 2.7.2 (Arch) nor 2.6.5 (Ubuntu). -- components: Interpreter Core files: leaky_generator.py messages: 142515 nosy: vadmium priority: normal severity: normal status: open title: Yield leaks exception being handled as garbage type: resource usage versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file22955/leaky_generator.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12791 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12787] xmlrpc.client documentation (MultiCall Objects) points to a broken link
Ezio Melotti ezio.melo...@gmail.com added the comment: AFAIU xmlrpclib.MultiCall implements the technique described on the broken link, and the examples look pretty clear to me, so the user doesn't have to follow the link to understand how to use it. I think it's good to keep a link around, in case the user wants to understand better how it works, but it could also be in a footnote. This is what I would do: 1) write something like The xmlrpc.MultiCall object provides a way to encapsulate multiple calls to a remote server into a single request¹. 2) in the footnote write something like [1]: This approach has been first presented in `a discussion on xmlrpc.com link-to-web.archive.org`_. Possibly you could leave an rst comment explaining that the original link is down and that we are using the web.archive.org one until the page is back up. FWIW http://www.xmlrpc.com/discuss/topics seems to work, and there are a few discussions from last month, but the links are broken. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12787 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12791] Yield leaks exception being handled as garbage
Changes by Georg Brandl ge...@python.org: -- assignee: - pitrou nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12791 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6584] gzip module has no custom exception
Michele Orrù maker...@gmail.com added the comment: The attached patch follows Ezio's hints. -- nosy: +maker Added file: http://bugs.python.org/file22956/6584_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6584 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12713] argparse: allow abbreviation of sub commands by users
Christian Ziemski cz...@gmx.de added the comment: I attached a patch against argparse.py from Python 2.7.1. Subcommmands can now be abbreviated as long as they are unambiguous. Otherwise an error message 'ambigous choice' will be thrown (like the 'invalid choice' one). (It's my first patch, so hopefully I did it right.) BTW: Éric mentioned aliases for argparse. For that I have done a patch too. I'll try to find the appropriate issue number here to post it. -- keywords: +patch Added file: http://bugs.python.org/file22957/abbrev_subcmds.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12789] re.Scanner don't support more then 2 groups on regex
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, mrabarnett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12789 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12713] argparse: allow abbreviation of sub commands by users
Christian Ziemski cz...@gmx.de added the comment: Since there seems to be no means to edit (my last) message a little followup regarding aliases: I found http://bugs.python.org/issue9234 argparse: aliases for positional arguments (subparsers) That one is for version 3.2 and already closed. So I'll stop bugging here with aliases. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6584] gzip module has no custom exception
Changes by Michele Orrù maker...@gmail.com: Added file: http://bugs.python.org/file22958/6584_5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6584 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12792] Document the type field of the tracker in the devguide
New submission from Ezio Melotti ezio.melo...@gmail.com: The attached patch adds documentation for the type field of the tracker to the devguide/triaging page. This is also related to the meta issue #393 [0]. [0]: http://psf.upfronthosting.co.za/roundup/meta/issue393 -- assignee: ezio.melotti components: Devguide files: issue12792.diff keywords: patch messages: 142520 nosy: eric.araujo, ezio.melotti, terry.reedy priority: normal severity: normal stage: patch review status: open title: Document the type field of the tracker in the devguide Added file: http://bugs.python.org/file22959/issue12792.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12792 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4
Michele Orrù maker...@gmail.com added the comment: Would it be better to use TarError as Sridhar suggested, or create a new class BadTarfile(TarError, IOError), following the convention used for gzip and zipfile? -- nosy: +maker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12791] reference cycle with exception state not broken by generator.close()
Antoine Pitrou pit...@free.fr added the comment: The problem is probably that the frame keeps the last execution state around, and since the exception itself has a reference to a frame, a cycle is created. Note that it doesn't happen if you catch the GeneratorExit that gets raised inside the generator at shutdown: def leaky_generator(): try: 1/0 except: # Exception handler with anonymous exception variable try: yield # Yield from exception handler except (GeneratorExit, RuntimeError): pass def throw_leaks(g): try: g.throw(RuntimeError()) except Exception: pass -- nosy: +benjamin.peterson, ncoghlan title: Yield leaks exception being handled as garbage - reference cycle with exception state not broken by generator.close() versions: +Python 3.3 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12791 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12793] allow filters in os.walk
New submission from Jacek Pliszka jacek.plis...@gmail.com: I suggest a small change in os.walk module. Instead of: def walk(top, topdown=True, onerror=None, followlinks=False): I would like to have: def walk(top, topdown=True, onerror=None, skipnames=lambda x : False, skipdirs=islink): Implementation might be as follows: if isdir(join(top, name)): --- fullname=join(top, name) if skipnames(fullname): continue if isdir(fullname): and: if followlinks or not islink(new_path): for x in walk(new_path, topdown, onerror, followlinks): --- if not skipdirs(new_path): for x in walk(new_path, topdown, onerror, skipnames, skipdirs): This is a small change, breaks a bit 'followlinks' option but gives much more flexibility as skipnames and skidirs can be any functions (including ones using regexp and similar). -- components: Library (Lib) files: os.diff keywords: patch messages: 142523 nosy: Jacek.Pliszka priority: normal severity: normal status: open title: allow filters in os.walk type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file22960/os.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12793 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12793] allow filters in os.walk
Changes by Jacek Pliszka jacek.plis...@gmail.com: -- versions: +Python 2.7 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12793 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 800d45e51dd7 by Victor Stinner in branch '3.2': Issue #12326: sys.platform is now always 'linux2' on Linux http://hg.python.org/cpython/rev/800d45e51dd7 New changeset c816479f6aaf by Victor Stinner in branch '2.7': Issue #12326: sys.platform is now always 'linux2' on Linux http://hg.python.org/cpython/rev/c816479f6aaf -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12793] allow filters in os.walk
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12793 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12791] reference cycle with exception state not broken by generator.close()
Antoine Pitrou pit...@free.fr added the comment: Here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file22961/genexcstate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12791 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12791] reference cycle with exception state not broken by generator.close()
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 867ce75b885c by Antoine Pitrou in branch '3.2': Issue #12791: Break reference cycles early when a generator exits with an exception. http://hg.python.org/cpython/rev/867ce75b885c New changeset 7d390c3a83c6 by Antoine Pitrou in branch 'default': Issue #12791: Break reference cycles early when a generator exits with an exception. http://hg.python.org/cpython/rev/7d390c3a83c6 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12791 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12791] reference cycle with exception state not broken by generator.close()
Antoine Pitrou pit...@free.fr added the comment: Thanks for the report, fixed. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12791 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 5330af45f777 by Antoine Pitrou in branch '3.2': Issue #12213: Fix a buffering bug with interleaved reads and writes that http://hg.python.org/cpython/rev/5330af45f777 New changeset d7f6391954cf by Antoine Pitrou in branch 'default': Issue #12213: Fix a buffering bug with interleaved reads and writes that http://hg.python.org/cpython/rev/d7f6391954cf -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom: issues with interlaced read-write
Antoine Pitrou pit...@free.fr added the comment: This should be fixed for BufferedRandom. As I said, I don't think BufferedRWPair is buggy. -- resolution: - fixed stage: patch review - committed/rejected status: open - pending title: BufferedRandom, BufferedRWPair: issues with interlaced read-write - BufferedRandom: issues with interlaced read-write ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write
STINNER Victor victor.stin...@haypocalc.com added the comment: You should not use BufferedRWPair with the same underlying stream (that's the whole point of BufferedRWPair). It might be documented. Something like Warning: don't use the same stream as reader and writer, or the BufferedRWPair becomes inconsistent on interlaced read-write ? -- status: pending - open title: BufferedRandom: issues with interlaced read-write - BufferedRandom, BufferedRWPair: issues with interlaced read-write ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm working on a patch to remove the major version of sys.platform. The patch is much bigger than expected. You will see when it will be done :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset cf2010e9f941 by Antoine Pitrou in branch '2.7': Issue #12213: Fix a buffering bug with interleaved reads and writes that http://hg.python.org/cpython/rev/cf2010e9f941 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12703] Improve error reporting for packaging.util.resolve_name
Rémy HUBSCHER remy.hubsc...@ionyse.com added the comment: Hello, I did the patch, but I have no idea of how to make a test for it. More over, I have seen a similar problem each time there is this code in the Python code (here in distutils.util.Distribution.get_command_class) : try: __import__ (module_name) module = sys.modules[module_name] except ImportError: continue try: klass = getattr(module, klass_name) except AttributeError: raise DistutilsModuleError( invalid command '%s' (no class '%s' in module '%s') % (command, klass_name, module_name)) Maybe it could be better to have a function in cpython to do that ? -- hgrepos: +59 keywords: +patch Added file: http://bugs.python.org/file22962/packaging.util.resolve_name.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12703] Improve error reporting for packaging.util.resolve_name
Rémy HUBSCHER remy.hubsc...@ionyse.com added the comment: Actually it is not the same problem for `distutils.util.Distribution.get_command_class` my mistake. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8713] multiprocessing needs option to eschew fork() under Linux
Changes by Vivek Sekhar vi...@viveksekhar.ca: -- nosy: +vsekhar ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12703] Improve error reporting for packaging.util.resolve_name
Alexis Metaireau ale...@notmyidea.org added the comment: Thanks Rémy, About testing, I would go for modules with errors in it and check that when imported trough this function it does what it is supposed to do. IOW: 1. Create a test python module with errors in their definition (Throw an exception would do the trick) 2a. Try to load this python module, check that the exception is the one thrown in the module 2.b Check that loading a non existing modules still tell us that the module doesn't exist 2.c Check that importing something existing works, trough this function. Hope I'm clear enough, thanks again, Alexis -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12787] xmlrpc.client documentation (MultiCall Objects) points to a broken link
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset e8f878837eae by Sandro Tosi in branch '2.7': #12787: link original MultiCall proposal to webarchive and in a footnote http://hg.python.org/cpython/rev/e8f878837eae New changeset ab11edca2310 by Sandro Tosi in branch '3.2': #12787: link original MultiCall proposal to webarchive and in a footnote http://hg.python.org/cpython/rev/ab11edca2310 New changeset 0fa18bc5427b by Sandro Tosi in branch 'default': #12787: merge with 3.2 http://hg.python.org/cpython/rev/0fa18bc5427b -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12787 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12787] xmlrpc.client documentation (MultiCall Objects) points to a broken link
Sandro Tosi sandro.t...@gmail.com added the comment: Thanks Ezio for the suggestions. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12787 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- title: BufferedRandom, BufferedRWPair: issues with interlaced read-write - BufferedRandom, BufferedRWPair: issues with interlaced read-write ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom: issues with interlaced read-write
Changes by Antoine Pitrou pit...@free.fr: -- title: BufferedRandom, BufferedRWPair: issues with interlaced read-write - BufferedRandom: issues with interlaced read-write ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
New submission from STINNER Victor victor.stin...@haypocalc.com: #12326 proposes to remove the major version from sys.platform. If we remove it, we will need another easy way to get this information. I don't think that we need the version used to build Python, but the version at runtime. That's why the platform is a good candidate to add such information. I propose to add platform.major(): major version of the system, or 0 if we cannot get it. I chose 0 instead of None or raising an error to be consistent with the other functions. Platform functions don't raise error and always return the same type. For example, platform.release() returns an empty string if the release string cannot be read. Each system formats its full version (e.g. (2, 6, 28) for Linux 2.6.28) differently. It is easier and more reliable to only provide the major version. If you would like to get more information (e.g. minor minor), you have to test the system name. See for example platform.mac_ver(), platform.win_ver(), and also test.support.requires_linux_version(). Attached patch implements platform.major(). -- files: platform_major.patch keywords: patch messages: 142538 nosy: haypo, lemburg priority: normal severity: normal status: open title: platform: add a major function to get the system major version versions: Python 3.3 Added file: http://bugs.python.org/file22963/platform_major.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm working on a patch to remove the major version of sys.platform As expected by Marc-Andre: we need this information and so it has to be available somewhere else. I created #12794 to add platform.major(). I prefer to get the major version at runtime, not the major version used to build Python. I need the major version for Python tests: the tests checks features of the running system (kernel), not of the system used to build Python. @Marc-Andre Lemburg: If you still think that we need all information about the system used to build Python, please open another issue (or comment maybe #12794). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12795] Remove the major version from sys.platform
New submission from STINNER Victor victor.stin...@haypocalc.com: sys.platform contains the major system version. If you test the sys.platform value (e.g. sys.platform == 'linux2'), your program doesn't work anymore with the new system major version (e.g. Linux 3). This problem is common with NetBSD, OpenBSD and FreeBSD. You don't have the problem if you test the prefix of sys.platform (e.g. sys.platform.startswith('linux')), but this code pattern is rare. Because of the release of Linux 3, it was proposed in #12326 to remove the major version from sys.platform. It is already done for Cygwin and Darwin. Example of new sys.platform values: 'linux', 'freebsd', 'hp-ux', ... (instead of 'linux2', 'freebsd8', hp-ux11', ...). I don't know if osf1 becomes osf. I don't know if irix646 becomes irix6 or just irix? What about sys.platform==win32? Should it be truncated to win? Many tests use already sys.platform.startswith(win). And what about sys.platform==java? It would be nice to be consistent (e.g. never have digits in sys.platform). Without the major version, it's much easier when you only care of the system name: you can use a dictionary with the name for the key (it's used in regrtest.py with my patch). Another example : if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3', 'Darwin1.2', 'darwin', 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'bsdos2', 'bsdos3', 'bsdos4', 'openbsd', 'openbsd2', 'openbsd3', 'openbsd4'): becomes: if sys.platform in ('netbsd', 'freebsd', 'openbsd', 'bsdos', 'Darwin1.2', 'darwin'): ('Darwin1.2'? WTF?) This issue follows my previous commit 50f1922bc1d5: Issue #12326: don't test the major version of sys.platform Use startswith, instead of ==, when testing sys.platform to support new platforms like Linux 3 or OpenBSD 5. I chose to keep sys.platform in distutils and packaging because these modules are supposed to work on older Python versions (e.g. packaging will be backported to Python 2.4-3.2). Attached patch implements this issue. It requires platform.major(): see issue #12794. The patch require to rerun autoconf. -- files: sys_platform_without_major.patch keywords: patch messages: 142540 nosy: haypo, loewis priority: normal severity: normal status: open title: Remove the major version from sys.platform versions: Python 3.3 Added file: http://bugs.python.org/file22964/sys_platform_without_major.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm working on a patch to remove the major version of sys.platform Done. I created the issue #12795: Remove the major version from sys.platform. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12795] Remove the major version from sys.platform
STINNER Victor victor.stin...@haypocalc.com added the comment: To have an idea of how much code has to be changed for the sys.platform change, there is the diffstat : $ diffstat sys_platform_without_major.patch Lib/ctypes/util.py |6 -- Lib/distutils/command/build_ext.py |3 - Lib/distutils/unixccompiler.py |4 - Lib/distutils/util.py | 12 ++--- Lib/packaging/command/build_ext.py |3 - Lib/packaging/compiler/unixccompiler.py |6 +- Lib/packaging/tests/test_config.py |4 - Lib/sysconfig.py| 12 ++--- Lib/test/fork_wait.py |2 Lib/test/regrtest.py| 71 ++-- Lib/test/support.py |2 Lib/test/test_asyncore.py |2 Lib/test/test_fcntl.py |9 +--- Lib/test/test_locale.py |2 Lib/test/test_logging.py|2 Lib/test/test_multiprocessing.py|2 Lib/test/test_os.py |6 +- Lib/test/test_posix.py |2 Lib/test/test_signal.py | 11 ++-- Lib/test/test_socket.py |7 --- Lib/test/test_tarfile.py|2 Lib/test/test_tempfile.py |2 Lib/test/test_threading.py | 14 +++--- Lib/unittest/test/test_break.py |4 - configure.in| 17 ++- setup.py| 19 26 files changed, 105 insertions(+), 121 deletions(-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12789] re.Scanner don't support more then 2 groups on regex
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: Even if this bug is fixed, it still won't work as you expect, and this s why. The Scanner function accepts a list of 2-tuples. The first item of the tuple is a regex and the second is a function. For example: re.Scanner([(r\d+, number), (r\w+, word)]) The Scanner function then builds a regex, using the given regexes as alternatives, each wrapped as a capture group: r(\d+)|(\w+) When matching, it sees which group captured and uses that to decide which function it should call, so, for example, if group 1 matched, it calls number, and if group 2 matched, it calls word. When you introduce capture groups into the regexes, it gets confused. If your regex matches, it'll see that groups 1 and 2 match, so it'll try to call the second function, but there's isn't one... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12789 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12789] re.Scanner doesn't support more than 2 groups on regex
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- title: re.Scanner don't support more then 2 groups on regex - re.Scanner doesn't support more than 2 groups on regex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12789 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12795] Remove the major version from sys.platform
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12792] Document the type field of the tracker in the devguide
Terry J. Reedy tjre...@udel.edu added the comment: This documents the current list, but ;-) I think the current list should be modified. 1. Put behavior at the top of the list, as it is the most common (a 'human factor' principle). 2. Combine performance and resource usage. Both are extremely rare and largely overlap. Time is a resource and space-hogging is bad performance. There is no difference as far as I know in terms of how we treat issues. 3. Going further: Each category should have a reason for being in terms of how we treat issues. I really think behavior, feature request, security, and other (listed in that order) are sufficient. Compiler errors, for instance, are rare (2% overall and probably less now), are covered by the build component, and are treated like bugs anyway (fixes are applied to current versions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12792 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom: issues with interlaced read-write
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 524896c305ce by Antoine Pitrou in branch '3.2': Issue #12213: make it clear that BufferedRWPair shouldn't be called with the http://hg.python.org/cpython/rev/524896c305ce New changeset a423bd492d6c by Antoine Pitrou in branch 'default': Issue #12213: make it clear that BufferedRWPair shouldn't be called with the http://hg.python.org/cpython/rev/a423bd492d6c New changeset dd4f29e39756 by Antoine Pitrou in branch '2.7': Issue #12213: make it clear that BufferedRWPair shouldn't be called with the http://hg.python.org/cpython/rev/dd4f29e39756 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12213] BufferedRandom: issues with interlaced read-write
Antoine Pitrou pit...@free.fr added the comment: I think it can be closed now. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12678] test_packaging and test_distutils failures under Windows
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4136acaf03de by Éric Araujo in branch 'default': Fix sdist test on Windows (#12678). Patch by Jeremy Kloth. http://hg.python.org/cpython/rev/4136acaf03de -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12678 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] sysconfig.get_config_vars('srcdir') fails in specific cases
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 7d9fa30c5588 by Éric Araujo in branch '3.2': Refactor the copying of xxmodule.c in distutils tests (#12141). http://hg.python.org/cpython/rev/7d9fa30c5588 New changeset 900738175779 by Éric Araujo in branch 'default': Refactor the copying of xxmodule.c in packaging tests (#12141). http://hg.python.org/cpython/rev/900738175779 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12782] Multiple context expressions do not support parentheses for continuation across lines
Éric Araujo mer...@netwok.org added the comment: I agree it’s unfortunate that we have to use backslashes to have multi-line with statements. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12782] Multiple context expressions do not support parentheses for continuation across lines
Georg Brandl ge...@python.org added the comment: is the only other example I can think of One similar example would be raise in Python 2. all compound statements uniformly allowed the same continuation syntax. This is not true: only import-as allows this syntax. All other uses of parentheses for continuation are continuations of *expressions*. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
Martin v. Löwis mar...@v.loewis.de added the comment: Can you please elaborate why we need it? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12795] Remove the major version from sys.platform
Martin v. Löwis mar...@v.loewis.de added the comment: I think this change should be much much smaller in scope. It was (nearly) agreed to drop the major version if the system is Linux. There is no consensus (that I'm aware of) to drop the major OS version for all systems. So I would propose to do this *only* selectively, and *only* if experts of the platform request such a change. For example, hpux9, hpux10, and hpux11 are *very* different operating systems; it's not clear that users are helped if we drop the major version for them. Also, if HP-UX 12 ever gets released, it is probably again different. I'm not sure sure about the BSDs: it is my understanding that they follow the tradition of only adding major changes to major OS releases, which would be in favor of keeping the status quo for them. OTOH, it may also be that the impact of the major version on Python and Python applications is too small so that applications would be better helped with dropping the major version. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12772] fractional day attribute in datetime class
Miguel de Val Borro miguel.de...@gmail.com added the comment: Thanks, I need the fractional day added to the ordinal day of the month. Using the timedelta division it would be: from __future__ import division dt = datetime.datetime(2008, 5, 8, 13, 35, 41, 56) dt.day + (dt-datetime.datetime(dt.year, dt.month, dt.day))/datetime.timedelta(1) 8.566453330752315 Then it simply becomes a one line function so I'm closing this ticket. -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12772 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12795] Remove the major version from sys.platform
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12789] re.Scanner doesn't support more than 2 groups on regex
Ângelo Otávio Nuffer Nunes angelonuf...@gmail.com added the comment: Ah, ok, thanks... Then I think my idea is impossible. I will use the Scanner in normal way. :) -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12789 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param
Charles-François Natali neolo...@free.fr added the comment: Here's a patch skipping this part of the test on FreeBSD (it actually also fails on FreeBSD 7.2). Note that while calling sched_setparam(param) results in EINVAL with SCHED_OTHER processes, calling sched_setscheduler(SCHED_OTHER, param) works just fine... -- keywords: +needs review, patch nosy: +pitrou stage: needs patch - patch review versions: +Python 3.3 Added file: http://bugs.python.org/file22965/test_sched_freebsd.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12783 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12789] re.Scanner doesn't support more than 2 groups on regex
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - invalid stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12789 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12782] Multiple context expressions do not support parentheses for continuation across lines
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12555] PEP 3151 implementation
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file22966/aa9e276a791d.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12555 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12555] PEP 3151 implementation
Antoine Pitrou pit...@free.fr added the comment: New patch incorporating Ezio's comments and synchronized with latest default. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12555 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: New submission from STINNER Victor victor.stin...@haypocalc.com: #12326 proposes to remove the major version from sys.platform. If we remove it, we will need another easy way to get this information. I don't think that we need the version used to build Python, but the version at runtime. That's why the platform is a good candidate to add such information. I propose to add platform.major(): major version of the system, or 0 if we cannot get it. I chose 0 instead of None or raising an error to be consistent with the other functions. Platform functions don't raise error and always return the same type. For example, platform.release() returns an empty string if the release string cannot be read. Each system formats its full version (e.g. (2, 6, 28) for Linux 2.6.28) differently. It is easier and more reliable to only provide the major version. If you would like to get more information (e.g. minor minor), you have to test the system name. See for example platform.mac_ver(), platform.win_ver(), and also test.support.requires_linux_version(). Attached patch implements platform.major(). I'm not sure I understand why platform.release() isn't sufficient for this purpose. Note that some systems return alphanumeric values for platform.release(), e.g. for Windows you get 'NT' or 'XP'. What we could do is add a function that tries to find out the true version number of the OS, e.g. for Windows 7 that would be (6, 1, 7601) instead of the marketing name '7' returned by platform.release(). Still, this won't help with the OS version used for the Python build. When Tarek was working on separating sysconfig from distutils, we briefly discussed parsing the Makefile and pyconfig.h files into a Python module. This would work around the issues with the parsing overhead of using sysconfig and also prevent the problems you currently find on some platforms that choose to place the needed Makefile and pyconfig.h into a Python development package. However, even with those generated modules, access to the build platform version would have to be provided through the sysconfig module, not the platform module, since that's the more appropriate module for such information. That would be the full solution to the problem, but it would have to go on a separate ticket. -- title: platform: add a major function to get the system major version - platform: add a major function to get the system major version ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- title: platform: add a major function to get the system major version - platform: add a major function to get the system major version ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12796] total_ordering goes into infinite recursion when NotImplemented is returned
New submission from Antoine Pitrou pit...@free.fr: This small test file exhibits the issue. When @total_ordering is not applied, the '' operator raises TypeError as expected. When @total_ordering is applied, there is an infinite recursion error. -- components: Library (Lib) files: totbug.py messages: 142558 nosy: ncoghlan, pitrou, rhettinger priority: normal severity: normal status: open title: total_ordering goes into infinite recursion when NotImplemented is returned type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22967/totbug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12786] subprocess wait() hangs when stdin is closed
Idan Kamara idank...@gmail.com added the comment: Thanks for getting on top of this so quickly Charles. Setting close_fds=True worked like a charm. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12786 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12768] docstrings for the threading module
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12768 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
New submission from Antoine Pitrou pit...@free.fr: Right now it is painful to integrate openat() with the normal IO classes. You have to figure out the low-level flags yourself (i.e. replicate the logic and error handling from the FileIO constructor), then replicate the open() logic yourself (because you want to set the name attribute on the FileIO object before wrapping it). Therefore it would be nice if the FileIO constructor and the open() function supported openat natively. I see two possibilities: - allow a (dirfd, name) tuple for the first file argument - allow an optional dirfd argument at the end of the arglist -- components: IO, Library (Lib) messages: 142560 nosy: haypo, neologix, pitrou, rosslagerwall priority: normal severity: normal stage: needs patch status: open title: io.FileIO and io.open should support openat type: feature request versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
Éric Araujo mer...@netwok.org added the comment: That other ticket is #9878. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9878] Avoid parsing pyconfig.h and Makefile by autogenerating extension module
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
STINNER Victor victor.stin...@haypocalc.com added the comment: Can you please elaborate why we need it? platform.major() will be needed if we remove the major version for all platforms from sys.platform (issue #12795). See sys_platform_without_major.patch attached to issue #12795 see how it is used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12792] Document the type field of the tracker in the devguide
Éric Araujo mer...@netwok.org added the comment: I believe you can’t capitalize “behavior” in English. About Terry’s 3): I think the usefulness of having separate types is the same as components, to let people search for what they can help with. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12792 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12795] Remove the major version from sys.platform
STINNER Victor victor.stin...@haypocalc.com added the comment: At the beginning, I thaught that it would be better to remove the major version from sys.platform on all platforms. When I started to write the patch, I expected to change only 2 or 3 files. But the patch is now huge (26 files changed, 105 insertions(+), 121 deletions(-)), which means that it will break most third party projects. I would propose to do this *only* selectively, and *only* if experts of the platform request such a change. Ok, I (now) agree. So let's close this issue. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: A third idea is to find a way to override the low-level open() function (the one that returns a fd). openat() seems to exist only on Linux, so I'm -1 on adding new parameters to support this function only. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm not sure I understand why platform.release() isn't sufficient for this purpose. Note that some systems return alphanumeric values for platform.release(), e.g. for Windows you get 'NT' or 'XP'. It's not easy to get 2 (int) from '2.6.38-8-generic' (str). For Windows, there *is* a major version: * Windows 3.1 : 3 * Windows 95/98, NT 4 : 4 * Windows XP, 2003 : 5 * Vista, Seven : 6 The major version is maybe less revelant for Windows. Anyway... platform.major() will be needed if we remove the major version for all platforms from sys.platform (issue #12795). I just closed the issue #12795, and so I don't think that this issue is still needed and so I close it. Reopen it if you still see an use case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
Antoine Pitrou pit...@free.fr added the comment: A third idea is to find a way to override the low-level open() function (the one that returns a fd). Why not. It would e.g. allow to use CreateFile under Windows (the hg guys do this in order to change the sharing mode to something more laxist). openat() seems to exist only on Linux, so I'm -1 on adding new parameters to support this function only. openat() is POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12713] argparse: allow abbreviation of sub commands by users
Éric Araujo mer...@netwok.org added the comment: Yes, I checked and aliases are already supported. You seem to have overlooked the Versions field on the top of this page: new features don’t go in stable releases, so your patch would have to apply to default, a.k.a. 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12713 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param
Antoine Pitrou pit...@free.fr added the comment: Sounds fine to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12783 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b072e1559d6b by Victor Stinner in branch 'default': Close #12326: sys.platform is now always 'linux' on Linux http://hg.python.org/cpython/rev/b072e1559d6b -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
STINNER Victor victor.stin...@haypocalc.com added the comment: For the sys.build_info, I opened #12794 (platform.major()) but then quickly closed it because it was only useful if the issue #12795 (Remove the major version from sys.platform) was accepted, but I closed it. -- Update votes for (2) Python 3.3: change sys.platform to 'linux': Charles-François Natali: -1 Amaury Forgeot d'Arc: -1 Antoine Pitrou: +1 Barry A. Warsaw: +1 Éric Araujo: +1 Dave Malcolm: +1 Marc-Andre Lemburg: +1 Martin v. Löwis: +1 Victor Stinner: +1 = total=+5 (9 votes) The changeset b072e1559d6b (sys.platform is now always 'linux') closes this issue because it solves the initial problem. Did you notice how trivial is the final patch? ;-) This funny issue is closed, we can now work again on real bugs :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12798] Update mimetypes documentation
New submission from Sandro Tosi sandro.t...@gmail.com: Following http://mail.python.org/pipermail/docs/2011-June/004727.html I've updated the mimetypes module doc. Some changes I would like to do (but I didn't, since I'd like to hear comments): - move the example of the module before the definition of MimeTypes class (so right below mimetypes.common_types) - move all the text about MimeTypes class in the subsection that talks about it. Comments, as always, are welcome. -- assignee: docs@python components: Documentation files: mimetypes_doc_update.patch keywords: patch messages: 142572 nosy: docs@python, ezio.melotti, sandro.tosi priority: normal severity: normal stage: patch review status: open title: Update mimetypes documentation versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22968/mimetypes_doc_update.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12798 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12799] realpath not resolving symbolic links under Windows
New submission from Antoine Pitrou pit...@free.fr: From a look at the code, realpath() does not seem to resolve symlinks under Windows, even though we have the _getfinalpathname function to do that. Please indulge with me if I'm wrong :) -- components: Library (Lib) messages: 142573 nosy: brian.curtin, pitrou, tim.golden priority: normal severity: normal status: open title: realpath not resolving symbolic links under Windows versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 85e091c83f9a by Victor Stinner in branch 'default': Issue #12326: woops, I really mean 'linux', not 'linux2' http://hg.python.org/cpython/rev/85e091c83f9a -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5301] add mimetype for image/vnd.microsoft.icon (patch)
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4964215ddcba by Sandro Tosi in branch '2.7': #5301: add image/vnd.microsoft.icon (.ico) MIME type http://hg.python.org/cpython/rev/4964215ddcba New changeset d9a0781c24b8 by Sandro Tosi in branch '3.2': #5301: add image/vnd.microsoft.icon (.ico) MIME type http://hg.python.org/cpython/rev/d9a0781c24b8 New changeset 95b230772469 by Sandro Tosi in branch 'default': #5301: merge with 3.2 http://hg.python.org/cpython/rev/95b230772469 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5301 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5301] add mimetype for image/vnd.microsoft.icon (patch)
Sandro Tosi sandro.t...@gmail.com added the comment: Thanks Drew for the issue and the patch: it has now been committed on all the active branches! -- assignee: - sandro.tosi nosy: +sandro.tosi resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 3.3 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5301 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9878] Avoid parsing pyconfig.h and Makefile by autogenerating extension module
STINNER Victor victor.stin...@haypocalc.com added the comment: avoid parsing pyconfig.h and Makefile in the sysconfig module by autogenerating an extension module This feature will be appreciated by small devices embeding Python: on such device, headers and Makefile are not copied to not waste disk space. To me, it is also an horrible thing to parse pyconfig.h and Makefile at startup, because these files are non trivial to parse and it should be done only once. Because these files are created one, we should parse them once, when Python is compiled. So an autogenerating an extension module is an excellent idea. It will speed up Python startup. -- nosy: +haypo type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
STINNER Victor victor.stin...@haypocalc.com added the comment: allow an optional dirfd argument at the end of the arglist I prefer this suggestion. I didn't know openat(). Antoine told me that it can be used, for example, to fix security vulnerabilities like #4489. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12794] platform: add a major function to get the system major version
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11362] image/webp missing from mimetypes.py
Changes by Sandro Tosi sandro.t...@gmail.com: -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11362 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1043134] Add preferred extensions for MIME types
Changes by Sandro Tosi sandro.t...@gmail.com: -- nosy: +sandro.tosi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1043134 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b5ccdf7c032a by Victor Stinner in branch 'default': Issue #12326: refactor usage of sys.platform http://hg.python.org/cpython/rev/b5ccdf7c032a -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12326 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink
New submission from Aurélien Dunand aurelien.dunand+pyt...@gmail.com: When you extractall a tarball containing a symlink in stream mode ('r|'), an Exception happens: Traceback (most recent call last): File ./test_extractall_stream_symlink.py, line 26, in module tar.extractall(path=destdir) File /usr/lib/python3.2/tarfile.py, line 2134, in extractall self.extract(tarinfo, path, set_attrs=not tarinfo.isdir()) File /usr/lib/python3.2/tarfile.py, line 2173, in extract set_attrs=set_attrs) File /usr/lib/python3.2/tarfile.py, line 2249, in _extract_member self.makefile(tarinfo, targetpath) File /usr/lib/python3.2/tarfile.py, line 2289, in makefile source.seek(tarinfo.offset_data) File /usr/lib/python3.2/tarfile.py, line 553, in seek raise StreamError(seeking backwards is not allowed) tarfile.StreamError: seeking backwards is not allowed You can reproduce the bug with this snippet of code: TEMPDIR='/tmp/pyton_test' os.mkdir(TEMPDIR) tempdir = os.path.join(TEMPDIR, testsymlinks) temparchive = os.path.join(TEMPDIR, testsymlinks.tar) destdir = os.path.join(TEMPDIR, extract) os.mkdir(tempdir) try: source_file = os.path.join(tempdir,'source') target_file = os.path.join(tempdir,'symlink') with open(source_file,'w') as f: f.write('something\n') os.symlink('source', target_file) tar = tarfile.open(temparchive,'w') tar.add(target_file, arcname=os.path.basename(target_file)) tar.add(source_file, arcname=os.path.basename(source_file)) tar.close() fo = open(temparchive, 'rb') tar = tarfile.open(fileobj=fo, mode='r|') try: tar.extractall(path=destdir) finally: tar.close() finally: os.unlink(temparchive) shutil.rmtree(TEMPDIR) If source_file is added before target_file, there is no Exception raised. But it still raised when you create the same tarball with GNU tar. -- components: Library (Lib) messages: 142580 nosy: adunand priority: normal severity: normal status: open title: 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
Ned Deily n...@acm.org added the comment: I believe openat is new to POSIX (mandatory as of POSIX 2008). For example, it's not currently in OS X and apparently was first added to FreeBSD in 8.0. So it would have to be checked by configure and documented as platform-dependent. -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
Antoine Pitrou pit...@free.fr added the comment: I believe openat is new to POSIX (mandatory as of POSIX 2008). For example, it's not currently in OS X and apparently was first added to FreeBSD in 8.0. So it would have to be checked by configure and documented as platform-dependent. We already have os.openat: http://docs.python.org/dev/library/os.html#os.openat This request is to make it easier to use with the high-level IO classes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12801] C realpath not used by os.path.realpath
New submission from Antoine Pitrou pit...@free.fr: We have our own quirky implementation of C realpath() in posixpath.py. It would probably be simpler, safer and more efficient to simply call the POSIX function instead (but it most be exposed somewhere, by posixmodule.c I suppose). -- components: Library (Lib) messages: 142583 nosy: haypo, neologix, pitrou, rosslagerwall priority: normal severity: normal status: open title: C realpath not used by os.path.realpath type: feature request versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12801 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12799] realpath not resolving symbolic links under Windows
STINNER Victor victor.stin...@haypocalc.com added the comment: You are right, but this issue is a duplicate of #9949. -- nosy: +haypo resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9949] os.path.realpath on Windows does not follow symbolic links
STINNER Victor victor.stin...@haypocalc.com added the comment: The issue #12799 has been marked as a duplicate of this issue: From a look at the code, realpath() does not seem to resolve symlinks under Windows, even though we have the _getfinalpathname function to do that. Please indulge with me if I'm wrong :) -- nosy: +haypo, pitrou, tim.golden versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1298813] sysmodule.c: realpath() is unsafe
Antoine Pitrou pit...@free.fr added the comment: The latest POSIX versions (*) allow NULL to be passed for the target memory area, meaning that realpath() will allocate as much memory as necessary by itself. This essentially does the same thing as canonicalize_file_name(), but in a standard way rather than by relying on a GNU extension. I suppose that possibility could be checked at configure time. (*) http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html -- nosy: +pitrou stage: test needed - needs patch versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1298813 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12801] C realpath not used by os.path.realpath
STINNER Victor victor.stin...@haypocalc.com added the comment: The Python implementation (os.path.realpath) was introduced 10 years ago by the issue #461781. The Python implemtation has known bugs: - #9949: os.path.realpath on Windows does not follow symbolic links - #11397: os.path.realpath() may produce incorrect results See also the issue #1298813: _Py_wrealpath() must use canonicalize_file_name() if available. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12801 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12797] io.FileIO and io.open should support openat
Ned Deily n...@acm.org added the comment: We already have os.openat Ah, right. The comment still applies, though, to future documentation of the proposed feature. +1 on it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink
Changes by Ned Deily n...@acm.org: -- nosy: +lars.gustaebel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL
New submission from Antoine Pitrou pit...@free.fr: Windows error 3 is returned when a directory path doesn't exist, but 267 is returned when an existing path is not a directory. This corresponds straight to the definition of ENOTDIR, but Python translates it to EINVAL: os.listdir(xx) Traceback (most recent call last): File stdin, line 1, in module WindowsError: [Error 3] The system cannot find the path specified: 'xx\\*.*' os.listdir(LICENSE) Traceback (most recent call last): File stdin, line 1, in module WindowsError: [Error 267] The directory name is invalid: 'LICENSE\\*.*' os.chdir(LICENSE) Traceback (most recent call last): File stdin, line 1, in module WindowsError: [Error 267] The directory name is invalid: 'LICENSE' e = sys.last_value e.errno 22 errno.errorcode[22] 'EINVAL' In PC/errmap.h, no Windows error code is translated to ENOTDIR (errno 20). -- messages: 142589 nosy: amaury.forgeotdarc, brian.curtin, pitrou, tim.golden priority: normal severity: normal stage: needs patch status: open title: Windows error code 267 should be mapped to ENOTDIR, not EINVAL type: behavior versions: Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12802 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL
Vlad Riscutia riscutiav...@gmail.com added the comment: Attached new mapping though I don't know where unit test for this should go... -- keywords: +patch nosy: +vladris Added file: http://bugs.python.org/file22969/issue12802.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12802 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com