[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: Regarding the patch below, isn't most of this redundant? ISTM that simply calling PyErr_SetString(...) should do all of this, including the exception chaining. diff -r 23ab1197df0b Objects/genobject.c --- a/Objects/genobject.c Wed Nov 19 13:21:40 2014

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Chris Angelico
Chris Angelico added the comment: Stefan, I'm not sure - I don't know the details of the C API here. But I tried commenting out everything but that one line, and while it does result in RuntimeError, it doesn't do the exception chaining. Currently, I believe the exception isn't being caught

[issue22965] smtplib.py: senderrs[each] - TypeError: unhashable instance

2014-11-29 Thread mattes
New submission from mattes: I get the following error: File /usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py, line 731, in sendmail senderrs[each] = (code, resp) TypeError: unhashable instance senderrs[str(each)] = (code, resp) fixes it.

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: Ah, right - chaining only happens automatically when the exception has already been caught and moved to sys.exc_info. There's a _PyErr_ChainExceptions(), though, which does it for you. You should be able to say PyErr_Fetch(x,y,z) PyErr_SetString()

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Chris Angelico
Chris Angelico added the comment: Yeah, I saw that. Since that function begins with an underscore, I thought it best to replicate its behaviour rather than to call it. Either way ought to work though. -- ___ Python tracker rep...@bugs.python.org

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: Public underscore C functions are there for exactly the purpose of not duplicating functionality across *internal* core runtime code, without making them an official part of the C-API for *external* code. (I understand that it's a POC patch, though, so whoever

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: FYI, here's the set of tests that I've written for my implementation in Cython: https://github.com/cython/cython/blob/b4383a540a790a5553f19438b3fc22b11858d665/tests/run/generators_pep479.pyx -- ___ Python tracker

[issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

2014-11-29 Thread Piotr Ożarowski
New submission from Piotr Ożarowski: when py_compile module is asked to create .pyc file for file with invalid name, it doesn't fail or ignore such request - it creates/overwrites .pyc file for sane file name (i.e. ignores everything after dot) $ touch foo.bar.py $ python3.4 -m py_compile

[issue22898] segfault during shutdown attempting to log ResourceWarning

2014-11-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: Out of curiosity I have tried to figure out how to build another test case using the model provided by runtimerror_singleton.py. This cannot be done, and for the following reasons: The infinite recursion of PyErr_NormalizeException() is supposed to occur as

[issue19858] Make pickletools.optimize aware of the MEMOIZE opcode.

2014-11-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which makes pickletools.optimize() to work with the MEMOIZE opcode. As side effect it also renumbers memoized values, this allows to use short BINPUT and BINGET instead of LONG_BINPUT and LONG_BINGET. -- keywords: +patch stage:

[issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

2014-11-29 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- components: +Library (Lib) stage: - test needed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22966 ___

[issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

2014-11-29 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22966 ___ ___ Python-bugs-list

[issue22462] Modules/pyexpat.c violates PEP 384

2014-11-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4b986350feb by Antoine Pitrou in branch '3.4': Close issue #22895: fix test failure introduced by the fix for issue #22462. https://hg.python.org/cpython/rev/e4b986350feb New changeset 4990157343c6 by Antoine Pitrou in branch 'default': Close

[issue22895] test failure introduced by the fix for issue #22462

2014-11-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: This should be fixed now. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22895 ___

[issue22895] test failure introduced by the fix for issue #22462

2014-11-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4b986350feb by Antoine Pitrou in branch '3.4': Close issue #22895: fix test failure introduced by the fix for issue #22462. https://hg.python.org/cpython/rev/e4b986350feb New changeset 4990157343c6 by Antoine Pitrou in branch 'default': Close

[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2014-11-29 Thread 700eb415
700eb415 added the comment: From the OpenBSD random(4) man page: The arc4random(3) function in userland libraries should be used instead, as it works without the need to access these devices every time. Theo just had a good talk on this issue here about why /dev/random needs replacing here:

[issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

2014-11-29 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22966 ___ ___ Python-bugs-list mailing

[issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

2014-11-29 Thread Piotr Ożarowski
Piotr Ożarowski added the comment: Python 3.2 generates foo.bar.cpython-32.pyc so it's a regression -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22966 ___

[issue22967] tempfile.py does not work in windows8

2014-11-29 Thread Kyle Lahnakoski
New submission from Kyle Lahnakoski: I installed python 2.7.8 on Windows version 6.2 (build 9200) and get-pip.py does not run. I traced the problem to c:\python27\lib\tempfile.py Here is my session: c:\Users\kyle\Downloadspython Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500

[issue22967] tempfile.py does not work in windows8

2014-11-29 Thread Zachary Ware
Zachary Ware added the comment: Try the following in Command Prompt: cd /D C:\Users\kyle\Downloads python -c import io;print io.__file__ The result should be C:\Python27\lib\io.pyc. If it's not, rename the file that you do get back. -- nosy: +zach.ware resolution: - not a bug

[issue22967] tempfile.py does not work in windows8

2014-11-29 Thread Kyle Lahnakoski
Kyle Lahnakoski added the comment: Doh! Dirty directory! Thank you for your time! My apologies. -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22967 ___

[issue22967] tempfile.py does not work in windows8

2014-11-29 Thread Zachary Ware
Zachary Ware added the comment: No problem, glad it was an easy one :) -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22967 ___

[issue22968] types._calculate_meta nit: isinstance != PyType_IsSubtype

2014-11-29 Thread Greg Turner
New submission from Greg Turner: Kinda trivial but... Something like the enclosed, untested patch would seem to make new_class work a bit more like type_new. To be explicit, the difference is whether or not to respect virtual subclasses. So, for example, as implemented, we can implement

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-29 Thread Zachary Ware
Zachary Ware added the comment: I'd prefer to just reimplement itemgetter and attrgetter to make them picklable rather than adding pickling methods to them; see attached patch. I also posted a few comments, but I just went ahead and addressed them myself in this patch. I'm not qualified to

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-29 Thread Zachary Ware
Changes by Zachary Ware zachary.w...@gmail.com: Removed file: http://bugs.python.org/file37319/issue22955.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22955 ___

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-29 Thread Zachary Ware
Changes by Zachary Ware zachary.w...@gmail.com: Added file: http://bugs.python.org/file37320/issue22955.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22955 ___

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: operator.methodcaller is similar to functools.partial which is pickleable and can be used as a sample. In C implementation some code can be shared between __repr__ and __reduce__ methods. As for tests, different protocols should be tested. Also should be

[issue22884] argparse.FileType.__call__ returns unwrapped sys.stdin and stdout

2014-11-29 Thread paul j3
paul j3 added the comment: Related issues are: http://bugs.python.org/issue13824 - argparse.FileType opens a file and never closes it http://bugs.python.org/issue14156 - argparse.FileType for '-' doesn't work for a mode of 'rb' As discussed earlier FileType was meant as a convenience for

[issue21236] patch to use cabinet.lib instead of fci.lib (fixes build with Windows SDK 8.0)

2014-11-29 Thread Steve Dower
Steve Dower added the comment: AFAICT, cabinet.lib has been around since at least VS 2008, so 3.4 will be fine. But since it builds currently there's no point changing it. I'll just let my changes handle it for 3.5 and leave the older versions alone. --

[issue22676] _pickle's whichmodule() is slow

2014-11-29 Thread Steve Dower
Steve Dower added the comment: That patch looks good to me (better than my fix would have been :) ) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22676 ___

[issue22909] [argparse] Using parse_known_args, unknown arg with space in value is interpreted as first positional arg

2014-11-29 Thread paul j3
paul j3 added the comment: This an issue for parse_args as well. parse_args just calls parse_known_args, and raises an error if extras is not empty. Early on in parsing, it tries to classify argument strings as either optionals (--flags) or positionals (arguments). And there's an explicit

[issue22919] Update PCBuild for VS 2015

2014-11-29 Thread Steve Dower
Steve Dower added the comment: After a debug build with VS2015, my biggest concern is this: ..\PC\bdist_wininst\install.rc(19): fatal error RC1015: cannot open include file 'afxres.h'. [P:\ath\to\cpython\PCbuild\bdist_wininst.vcxproj] I thought I had a workaround for this, but I'll have

[issue22909] [argparse] Using parse_known_args, unknown arg with space in value is interpreted as first positional arg

2014-11-29 Thread paul j3
paul j3 added the comment: Duplicate of http://bugs.python.org/issue22433 -- resolution: - duplicate ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22909 ___

[issue22960] xmlrpc.client.ServerProxy() should accept a custom SSL context parameter

2014-11-29 Thread Alex Gaynor
Alex Gaynor added the comment: Attached is a patch for 2.7 -- keywords: +patch Added file: http://bugs.python.org/file37321/issue22960.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22960

[issue22909] [argparse] Using parse_known_args, unknown arg with space in value is interpreted as first positional arg

2014-11-29 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: - resolved status: open - closed superseder: - Argparse considers unknown optional arguments with spaces as a known positional argument ___ Python tracker rep...@bugs.python.org

[issue22536] subprocess should include filename in FileNotFoundError exception

2014-11-29 Thread Travis Thieman
Travis Thieman added the comment: Thank you all for the helpful comments. A revised attempt is attached as -2.patch, with improved behavior around using cwd if the child is never called and orig_executable if it is. I opted not to fix the issue with the redundancy in the error message as I

[issue22960] xmlrpc.client.ServerProxy() should accept a custom SSL context parameter

2014-11-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: I suppose I should ask you to write a test. Of course, HTTPS doesn't seem to be tested at all right now (see the attractive FIXME: mostly untested comment in SafeTransport.) Maybe, it's easier now, though, using the code in Lib/test/ssl_servers.py?

[issue22960] xmlrpc.client.ServerProxy() should accept a custom SSL context parameter

2014-11-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 62bd574e95d5 by Benjamin Peterson in branch '2.7': add context parameter to xmlrpclib.ServerProxy (#22960) https://hg.python.org/cpython/rev/62bd574e95d5 -- nosy: +python-dev ___ Python tracker

[issue22960] xmlrpc.client.ServerProxy() should accept a custom SSL context parameter

2014-11-29 Thread Alex Gaynor
Alex Gaynor added the comment: Attached patch fixes it for Python3. -- Added file: http://bugs.python.org/file37323/issue22960-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22960 ___

[issue22960] xmlrpc.client.ServerProxy() should accept a custom SSL context parameter

2014-11-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4b00430388ad by Benjamin Peterson in branch '3.4': add context parameter to xmlrpclib.ServerProxy (#22960) https://hg.python.org/cpython/rev/4b00430388ad New changeset 2a126ce6f83e by Benjamin Peterson in branch 'default': merge 3.4 (#22960)

[issue22959] http.client.HTTPSConnection checks hostname when SSL context has check_hostname==False

2014-11-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: Why do you think it still verifies the hostname? It will certainly check if the certificate has a valid trust chain, but it won't do matching on the hostname. -- nosy: +benjamin.peterson ___ Python tracker

[issue22960] xmlrpc.client.ServerProxy() should accept a custom SSL context parameter

2014-11-29 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22960 ___