Filters:
Languages
Toughness
Just bugs labeled...
-
· link
The empty path '' is considered as an acceptable path in os.path.join, and works as a neutral prefix: print os.path.join('','aaa') ===> aaa which seems rather natural. But it raises an exception when used as a parameter to os.listdir. Logically, it should then list the current directory. (the alternative would be to raise an exception when os.path.join gets an empty argument). The inconsistency became clear to me when I had to write the following function : def listdirs(path,flist): # Appends to "flist" all paths to files that # start with "path". Argument "path" can be empty string ''. if path=='' : localist=os.listdir('.') else : localist=os.listdir(path) for f in localist : p=os.path.join(path,f) flist.append(p) if os.path.isdir(p) : listdirs(p,flist) return flist The conditionnal is needed only to avoid the exception, while the code is unique afterwards. This is related to Issue818059, but I did not see how that issue was resolved. Furthermore, the case of the empty path as argument to os.listdir should be documented in http://docs.python.org/2/library/os.html
-
multiprocessing.cpu_count() implementation should be made available in the os module, where it belongs.
-
When (at least sometimes) exceptions occur during shutdown, warnings like the following appear: Exception TypeError: "'NoneType' object is not callable" in ignored This is apparently meant to be read as Exception <<TypeError: "'NoneType' object is not callable" in ...>> [was] ignored instead of, for instance Exception TypeError: "'NoneType' object is not callable" in ignored Even when parsed correctly, it is a bit mysterious (who/what ignored the exception?) to one not in the know and has generated more than one python-list thread. Suggestion (from John Machin): reword to something like Shutdown ignored this exception: TypeError: "'NoneType' object is not callable" This would tell people that they might need to find out more about the shutdown process. Would it be permissible to change this in 3.1?
-
· link
The OS X linker now understands -R, but distutils continues to pass the wrong flags back in distutils.unixccompiler.runtime_library_dir_option(). I'm checking with the Apple folks as to exactly what the right flag is.
-
In Python 3.3 (I did not test with 3.4), sys.modules cannot be reassigned without breaking the import mechanism; while it works with Python <= 3.2. Here is how to reproduce the bug: progval@Andromede:/tmp$ mkdir test_imports progval@Andromede:/tmp$ echo "from . import module" > test_imports/__init__.py progval@Andromede:/tmp$ echo "print('foo')" > test_imports/module.py progval@Andromede:/tmp$ python3.3 Python 3.3.1 (default, Apr 6 2013, 13:58:40) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.modules = dict(sys.modules) >>> import test_imports Traceback (most recent call last): File "<stdin>", line 1, in <module> File "./test_imports/__init__.py", line 1, in <module> from . import module SystemError: Parent module 'test_imports' not loaded, cannot perform relative import >>> progval@Andromede:/tmp$ python3.2 Python 3.2.3 (default, May 6 2013, 01:46:35) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.modules = dict(sys.modules) >>> import test_imports foo >>>
-
· link
To reproduce, try the following code: from argparse import ArgumentParser a = ArgumentParser() a.add_argument("foo-bar") args = a.parse_args(["biz"]) print args, args.foo_bar Expected output: Namespace(foo_bar='biz') biz Actual output: Namespace(foo-bar='biz') Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'Namespace' object has no attribute 'foo_bar' Other comments: The positional argument 'foo-bar' becomes impossible to retrieve without explicitly passing keyword argument dest='foo_bar'. Hyphens in positional arguments should be automatically replaced with underscores just as with other arguments. I have not tested if this problem occurs in Python versions newer than 2.6.
-
With libpython.py loaded in gdb, when backtracing and trying to pretty-print frame objects along the way, this error is sometimes raised: Python Exception <type 'exceptions.TypeError'> object of type 'FakeRepr' has no len() See attached patch against tip.
-
I am in a situation where I'm building an IPNetwork from separate address and mask information. So roughly I'd like to write either: addr = IPAddress('192.168.0.0') network = IPNetwork((addr, '255.255.0.0')) or addr = '192.168.0.0' network = IPNetwork((addr, '255.255.0.0')) Of course it seems like this would be equivalent to: network = IPNetwork('%s/%s' % (addr, '255.255.0.0.')) (but more user-friendly :-))
-
Add the standard hot keys for resizing fonts (i.e. on a Mac, CMD-plus and CMD-minus).
