[issue31218] del expects __delitem__ if __setitem__ is defined
New submission from Calvin: I noticed some odd behaviour on classes defining __setitem__. Using del on a class defining __setitem__ but not __delitem__ results in "AttributeError: __delitem__". On classes definig neiter __setitem__ nor __delitem__ on the other hand this results in "TypeError: 'WithoutSetItem' object doesn't support item deletion". See the appended example script. -- files: delitem_example.py messages: 300346 nosy: raumzeitkeks priority: normal severity: normal status: open title: del expects __delitem__ if __setitem__ is defined type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file47085/delitem_example.py ___ Python tracker <http://bugs.python.org/issue31218> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12554] Failed imports clean up module, but not sub modules
New submission from Calvin Spealman : I came across this behavior when it was related to the shadowing of a small typo bug and took me forever to find. In my case, the original error was shadowed in a way that is unrelated to this bug, but lead to the module being imported twice (because it was removed when it failed the first time) and then the second import caused a completely unexpected error, because the state of the submodules conflicted with the import-time logic of the top-level package. I think when a module fails to load, all of its sub-modules should be removed from sys.modules, not just itself. calvin@willow-delta:/tmp$ mkdir foo/ calvin@willow-delta:/tmp$ cat >> foo/__init__.py import foo.bar 1/0 calvin@willow-delta:/tmp$ cat >> foo/bar.py name = "bar" calvin@willow-delta:/tmp$ python Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import foo Traceback (most recent call last): File "", line 1, in File "foo/__init__.py", line 2, in 1/0 ZeroDivisionError: integer division or modulo by zero >>> import sys >>> sys.modules['foo.bar'] >>> -- components: Interpreter Core messages: 140298 nosy: Calvin.Spealman priority: normal severity: normal status: open title: Failed imports clean up module, but not sub modules type: behavior ___ Python tracker <http://bugs.python.org/issue12554> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11683] unittest discover should recurse into packages which are already in sys.path
New submission from Calvin Spealman : For example, if I had a project with a "src/" directory and inside that directory is a package named "foo", then I can run "python3 -m unittest discover -s ." and the tests will be not be found, but I can run "python3 -m unittest discover -s src/" and the tests in the foo package are run. This is because it can only find things which are in the python path, but if I have src/ on the path (I ran "add2virtualenv src/" at some point) then discover should know it can traverse inside this directory. -- messages: 132242 nosy: Calvin.Spealman priority: normal severity: normal status: open title: unittest discover should recurse into packages which are already in sys.path type: feature request versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue11683> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11683] unittest discover should recurse into packages which are already in sys.path
Calvin Spealman added the comment: Doesn't it already go into multiple directories? Isn't that a requirement of a recursive directory walk, which I understand discover does? I am also thinking the current documentation just doesn't make these details clear, so should that be another ticket if I think those should change for the 3.2 docs to clarify the current behavior? -- ___ Python tracker <http://bugs.python.org/issue11683> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4331] Can't use _functools.partial() created function as method
Calvin Spealman <[EMAIL PROTECTED]> added the comment: I don't think this is any kind of bug, it is simply a product of only function objects being decorated automatically as methods. Your python version works because it is, in fact, a function. _functools.partial objects are not functions, but simply callable objects. -- nosy: +ironfroggy ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4331> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4579] .read() and .readline() differ in failing
Changes by Calvin Spealman <[EMAIL PROTECTED]>: -- nosy: +ironfroggy ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4579> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4579] .read() and .readline() differ in failing
Calvin Spealman <[EMAIL PROTECTED]> added the comment: Confirmed this behavior on my ubuntu installations but it fails properly on Windows. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4579> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4573] zsh-style subpattern matching for fnmatch/glob
Calvin Spealman <[EMAIL PROTECTED]> added the comment: This should be applicable to 2.7, at least, as well. Here is a backport of the patch against trunk. -- nosy: +ironfroggy Added file: http://bugs.python.org/file12273/zsh-fnmatch-2.7.diff ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4573> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4573] zsh-style subpattern matching for fnmatch/glob
Changes by Calvin Spealman <[EMAIL PROTECTED]>: -- versions: +Python 2.7 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4573> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5174] xmlrpclib docs include incorrect file closing
New submission from Calvin Spealman : The following example from the xmlrpclib docs has an obviously erronous call to close() after the actual return. (http://docs.python.org/library/xmlrpclib.html) def python_logo(): handle = open("python_logo.jpg") return xmlrpclib.Binary(handle.read()) handle.close() The patch included also makes the whitespace PEP-8 compliant. -- assignee: georg.brandl components: Documentation files: xmlrpc_doc.patch keywords: patch messages: 81309 nosy: georg.brandl, ironfroggy severity: normal status: open title: xmlrpclib docs include incorrect file closing versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1 Added file: http://bugs.python.org/file12961/xmlrpc_doc.patch ___ Python tracker <http://bugs.python.org/issue5174> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5174] xmlrpclib docs include incorrect file closing
Calvin Spealman added the comment: The patch attached uses a with statement for proper file closing in the examples. ___ Python tracker <http://bugs.python.org/issue5174> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5191] Partial function application 'from the right'
Changes by Calvin Spealman : -- nosy: +ironfroggy ___ Python tracker <http://bugs.python.org/issue5191> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41276] Min / Max returns different values depending on parameter order
New submission from Calvin Davis : See attached image The behavior of min() (and probably max and other related functions) changes depending on the order of the parameters it sorts. In the image, I sorted two tuples, coordinate points, with the same Y value and different X values. When the X values were in increasing order, finding the minimum x value and minimum y value were the same. However if the list was reversed, finding the minimum x and y values in the list provided different results. -- assignee: terry.reedy components: IDLE files: yqzRk0Y.png messages: 373512 nosy: Calvin Davis, terry.reedy priority: normal severity: normal status: open title: Min / Max returns different values depending on parameter order type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49314/yqzRk0Y.png ___ Python tracker <https://bugs.python.org/issue41276> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41276] Min / Max returns different values depending on parameter order
Calvin Davis added the comment: Thank you for the clarification, sorry for the report! You're awesome! -- ___ Python tracker <https://bugs.python.org/issue41276> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41276] Min / Max returns different values depending on parameter order
Calvin Davis added the comment: You say that confusing IDLE with Python is common for beginners, do you mean to suggest that IDLE isn't a Python interpreter? I know IDLE is essentially just an IDE and distinctly different than the python shell, but I wasn't aware the differences would affect anything. I expect my sample code would work the same in IDLE or a python file, no confusion there. I guess I'm not sure what you mean by reducing confusion, because to me IDLE and the python shell are similar enough, and both distinctly different than executing a .py file, though both should have the same behavior right? -- ___ Python tracker <https://bugs.python.org/issue41276> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30378] SysLogHandler does not support IPv6 destinations
New submission from Calvin Cheng: The attached test script works fine with IPv4 syslog: $ python test_syslog.py 192.168.1.4 (no errors reported) When running the attached script with python 3.5.2 on Ubuntu 16.04, received the following error: $ python3 test_syslog.py ::1 --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.5/logging/handlers.py", line 908, in emit self.socket.sendto(msg, self.address) socket.gaierror: [Errno -9] Address family for hostname not supported Call stack: File "test_syslog.py", line 16, in logging.info("Test Syslog with IPv6") Message: 'Test Syslog with IPv6' Arguments: () Similar error in python 2.7.10: $ python test_syslog.py ::1 Traceback (most recent call last): File "/usr/lib/python2.7/logging/handlers.py", line 864, in emit self.socket.sendto(msg, self.address) gaierror: [Errno -9] Address family for hostname not supported Logged from file test_syslog.py, line 16 -- components: Library (Lib) files: test_syslog.py messages: 293764 nosy: Calvin Cheng priority: normal severity: normal status: open title: SysLogHandler does not support IPv6 destinations type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file46865/test_syslog.py ___ Python tracker <http://bugs.python.org/issue30378> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30378] SysLogHandler does not support IPv6 destinations
Changes by Calvin Cheng : -- nosy: +Calvin Cheng -calcheng ___ Python tracker <http://bugs.python.org/issue30378> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30378] SysLogHandler does not support IPv6 destinations
Changes by Calvin Cheng : -- nosy: +calcheng -Calvin Cheng ___ Python tracker <http://bugs.python.org/issue30378> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16388] Urllib screws up capitalization in "User-Agent" HTTP Header
New submission from Calvin Owens: Urllib encodes as: "User-agent" The correct form is: "User-Agent" This is quite important, as it makes this library totally unusable for scraping moronic websites which require a recognized User-Agent string to work correctly, of which there are many. -- components: Library (Lib) messages: 174540 nosy: Calvin.Owens priority: normal severity: normal status: open title: Urllib screws up capitalization in "User-Agent" HTTP Header type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue16388> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16388] Urllib screws up capitalization in "User-Agent" HTTP Header
Calvin Owens added the comment: 2275 hasn't been touched for almost 2 years. If there was a fix in v3.3, it ought to be backported. But it doesn't look like they ever came up with one. -- ___ Python tracker <http://bugs.python.org/issue16388> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'
New submission from Calvin Walton: On Exherbo, the main C/C++ compilers are named e.g. "x86_64-pc-linux-gnu-cc" and "x86_64-pc-linux-gnu-c++", and they are symlinks to either (usually) gcc or (rarely) clang. Since distutils (in unixccompiler.py) is checking for the substring "gcc" or "g++" in the compiler name, this does not match our compiler - and the "-Wl," prefix is missing, resulting in link errors in some cases. (We are particularly noticing this when doing gobject-introspection builds via cmake, where giscanner uses distutils to build the link command) As far as I know, all major compilers on Linux require the -Wl, option to pass through linker options - clang actually interprets -R without -Wl, to mean something completely different. We are planning to locally patch distutils to have an additional condition to the gcc check, `sys.platform[:5] == "linux" or self._is_gcc(compiler):` in our distribution to work around the issue. I'll attach patches once they're prepared, but I'd appreciate feedback about the problem. -- components: Distutils messages: 251546 nosy: Calvin Walton, dstufft, eric.araujo priority: normal severity: normal status: open title: distutils doesn't add "-Wl," prefix to "-R" on Linux if the C compiler isn't named 'gcc' versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue25229> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'
Changes by Calvin Walton : -- keywords: +patch Added file: http://bugs.python.org/file40568/distutils-compiler-name.patch ___ Python tracker <http://bugs.python.org/issue25229> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'
Changes by Calvin Walton : Added file: http://bugs.python.org/file40569/distutils-compiler-name.patch ___ Python tracker <http://bugs.python.org/issue25229> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25819] print "Hi" in python 3 exception handling doesn't work
New submission from Calvin Simpkinson: When you execute the code: try: print "Hi" except: print("Hello") in python 3.5, it creates a syntax error in Terminal on Mac and a pop-up error in IDLE, while it should just print Hello in the console. -- messages: 256083 nosy: Calvin Simpkinson priority: normal severity: normal status: open title: print "Hi" in python 3 exception handling doesn't work type: behavior versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue25819> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com