[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that the same issue is exist with gzip, bz2, lzma, tarfile and zipfile (or even worse). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22996 ___

[issue22984] test_json.test_endless_recursion(): Fatal Python error: Cannot recover from stack overflow. on x86 XP-4 3.x buildbot

2014-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this patch will break the purpose of the test. We should fix the issue instead of hide it from tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22984

[issue22984] test_json.test_endless_recursion(): Fatal Python error: Cannot recover from stack overflow. on x86 XP-4 3.x buildbot

2014-12-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22984 ___ ___ Python-bugs-list

[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: Ok, here is an updated patch (version 2): - tests still ensure that the event loop is passed explicitly - call_soon() cie now fail if the policy has no event loop set for the current thread (before it only failed if the event loop set in the policy was

[issue22599] traceback: errors in the linecache module at exit

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset cd3244416592 by Victor Stinner in branch '3.4': Issue #22599: Enhance tokenize.open() to be able to call it during Python https://hg.python.org/cpython/rev/cd3244416592 New changeset 22f2784a276e by Victor Stinner in branch 'default': (Merge 3.4)

[issue22599] traceback: errors in the linecache module at exit

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: Yes, please do this. Ok done. I only added the test to default, not in the 3.4 branch. As Antoine noticed, the test is fragile, I perfer to not backport it. Ok, let's focus now on the issue #22696 ;-) -- dependencies: -Add a function to know about

[issue22696] Add a function to know about interpreter shutdown

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: After solving this issue we should reconsider the traceback_ignore_linecache_error.patch patch in issue22599. I reposted the patch in this issue since I just closed the issue #22599. -- Added file:

[issue22984] test_json.test_endless_recursion(): Fatal Python error: Cannot recover from stack overflow. on x86 XP-4 3.x buildbot

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: I think this patch will break the purpose of the test. We should fix the issue instead of hide it from tests. The test ensures that json calls Py_EnterRecursiveCall() which relies on sys.getrecursionlimit(), see the commit below. There is no generic fix

[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up

2014-12-05 Thread Cees Timmerman
New submission from Cees Timmerman: # http://stackoverflow.com/a/25678113/819417 def copy(data): if not isinstance(data, unicode): data = data.decode('mbcs') OpenClipboard(None) EmptyClipboard() hCd = GlobalAlloc(GMEM_DDESHARE, 2 * (len(data) + 1)) pchData =

[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up

2014-12-05 Thread Cees Timmerman
Cees Timmerman added the comment: A copy of my test program at https://gist.github.com/CTimmerman/133cb80100357dde92d8 -- Added file: http://bugs.python.org/file37366/test_clipboard_win.py ___ Python tracker rep...@bugs.python.org

[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up

2014-12-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: (you swapped the unicode values: \U0001f4cb is copied as \U0001f400) On Windows, strings have changed in 3.3. See in https://docs.python.org/3/whatsnew/3.3.html, len() now always returns 1 for non-BMP characters. The call to GlobalAlloc should use the

[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up

2014-12-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Better use utf-16-le encoding: len(data.encode('utf-16-le')) + 2 otherwise the encoded bytes start with the \fffe BOM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22999

[issue22994] datetime buggy

2014-12-05 Thread santhosh
santhosh added the comment: Thanks simeon.visser, I understood your point. Didn't got your point earlier. Hey belopolsky, Here is the solution val=datetime.datetime.strptime(2015-02-01,'%Y-%m-%d').date() zon=pytz.timezone('US/Pacific') Bad Code: dt=datetime.datetime(val.year,val.month,val.day,

[issue22394] Update documentation building to use venv and pip

2014-12-05 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- assignee: georg.brandl - brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22394 ___ ___

[issue22581] Other mentions of the buffer protocol

2014-12-05 Thread R. David Murray
R. David Murray added the comment: Made some review comments. The last comment change (deletion) in unicodeobject.c is not as obvious as the other changes were; I'm not familiar enough with the C API to know why it is correct. I trust you on that, though :) --

[issue22992] Adding a git developer's guide to Mercurial to devguide

2014-12-05 Thread Demian Brecht
Demian Brecht added the comment: I believe most points should be addressed in the updated patch. Below are responses to other comments (those not included have resulted in changes in the patch). @Ezio: 4) it should be possible to use evolve instead of bookmarks, but evolve is currently

[issue22914] Rewrite of Python 2/3 porting HOWTO

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 55b94462ca7f by Brett Cannon in branch '3.4': Issue #22914: Update the Python 2/3 porting HOWTO to describe a more https://hg.python.org/cpython/rev/55b94462ca7f -- nosy: +python-dev ___ Python tracker

[issue22914] Rewrite of Python 2/3 porting HOWTO

2014-12-05 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22914 ___

[issue22992] Adding a git developer's guide to Mercurial to devguide

2014-12-05 Thread Berker Peksag
Berker Peksag added the comment: +# address review comments and merge You can remove the and merge part. +# generate patch for submission +git diff master..issueA issueA.patch Contributors may need to update their repos before this step. It would be good to add a note about git

[issue22581] Other mentions of the buffer protocol

2014-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you David. I have left enumerations of concrete bytes-like classes (bytes and bytearray) because I thought that it is good to be more verbose in the documentation. I left the decision how write it to you: :class:`bytes`, :class:`bytearray` or

[issue21793] httplib client/server status refactor

2014-12-05 Thread Demian Brecht
Demian Brecht added the comment: Updated patch addressing review comments. Thanks for the review. -- Added file: http://bugs.python.org/file37368/issue21793_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21793

[issue22581] Other mentions of the buffer protocol

2014-12-05 Thread R. David Murray
R. David Murray added the comment: Yeah, just ignore the unicodeobject.c comment comment. It seems to me that the stuff in the parens is supposed to be a precise description of what the format code handles, with elaboration in the following text. So I'd prefer to just use the :term: in those

[issue22914] Rewrite of Python 2/3 porting HOWTO

2014-12-05 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22914 ___ ___

[issue22696] Add a function to know about interpreter shutdown

2014-12-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch with docs. -- Added file: http://bugs.python.org/file37369/is_finalizing2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Benchmarks and Intel's recommendation show that aligned allocation is actually important for AVX performance, and NumPy depends on CPython providing the right allocation APIs (for integration with tracemalloc): https://github.com/numpy/numpy/issues/5312 So I

[issue22984] test_json.test_endless_recursion(): Fatal Python error: Cannot recover from stack overflow. on x86 XP-4 3.x buildbot

2014-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The tes failed on Windows XP which is no more supported, I don't think that it's interesting to spend time on it. So may be just skip it on Windows XP? Or as far as this approach doesn't solve the problem and the test may crash on other platforms, may be

[issue22946] urllib gives incorrect url after open when using HTTPS

2014-12-05 Thread Demian Brecht
Demian Brecht added the comment: +1 to the addition of a test. Also, I know it's only related, but it might be nice to also have this fixed in http_error_default: https://hg.python.org/cpython/file/021c1df36910/Lib/urllib/request.py#l2003. -- nosy: +demian.brecht

[issue22984] test_json.test_endless_recursion(): Fatal Python error: Cannot recover from stack overflow. on x86 XP-4 3.x buildbot

2014-12-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22984 ___ ___

[issue21793] httplib client/server status refactor

2014-12-05 Thread Demian Brecht
Changes by Demian Brecht demianbre...@gmail.com: Added file: http://bugs.python.org/file37370/issue21793_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21793 ___

[issue22946] urllib gives incorrect url after open when using HTTPS

2014-12-05 Thread John McKay
John McKay added the comment: For the test can I assume that we have the openssl binary in the path? The other tests just use a static response to emulate the server, but without being able to use s_client it would be quite a bit more effort to fake a working HTTP server with TLS so that it

[issue22946] urllib gives incorrect url after open when using HTTPS

2014-12-05 Thread Benjamin Peterson
Benjamin Peterson added the comment: We have a testing HTTPS server in Lib/test/ssl_servers.py. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22946 ___

[issue22394] Update documentation building to use venv and pip

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 888103600e72 by Brett Cannon in branch 'default': Issue #22394: Add a 'venv' command to Doc/Makefile. https://hg.python.org/cpython/rev/888103600e72 -- nosy: +python-dev ___ Python tracker

[issue22394] Update documentation building to use venv and pip

2014-12-05 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22394 ___

[issue22581] Other mentions of the buffer protocol

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 853e3e115db4 by Serhiy Storchaka in branch '3.4': Issue #22581: Use more bytes-like object throughout the docs and comments. https://hg.python.org/cpython/rev/853e3e115db4 New changeset 450a025b1669 by Serhiy Storchaka in branch 'default': Issue

[issue22581] Other mentions of the buffer protocol

2014-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed with just bytes-like object. Thank you David for your review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22581 ___

[issue22581] Other mentions of the buffer protocol

2014-12-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22581 ___

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: Windows provides: void * _aligned_malloc( size_t size, size_t alignment ); http://msdn.microsoft.com/en-US/library/8z34s9c6%28v=vs.80%29.aspx How should we handle platforms which don't provide a memory allocator with an alignment? The simplest

[issue22696] Add a function to know about interpreter shutdown

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: is_finalizing2.patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___

[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22996 ___ ___ Python-bugs-list

[issue21557] os.popen os.system lack shell-related security warnings

2014-12-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21557 ___ ___ Python-bugs-list

[issue22696] Add a function to know about interpreter shutdown

2014-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Before committing the patch it will be good to find places in the code which will benefit from this function. And please don't forget to fix a typo in the docstring. -- ___ Python tracker rep...@bugs.python.org

[issue21557] os.popen os.system lack shell-related security warnings

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: Python 3.5 doc has no red warning in the subprocess module, but a nice section: https://docs.python.org/dev/library/subprocess.html#security-considerations Why not simply copying the note of the subprocess doc? Note: Read the Security Considerations section

[issue21557] os.popen os.system lack shell-related security warnings

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: subprocess.getstatusoutput(cmd) needs also this note (or warning). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21557 ___

[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file37371/gcgzipio.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22996 ___

[issue22985] Segfault on time.sleep

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: Program received signal SIGTERM, Terminated. SIGTERM is not a segmentation fault. SIGSEGV is for segmentation faults. -- nosy: +haypo resolution: - not a bug status: open - closed ___ Python tracker

[issue9584] fnmatch, glob: Allow curly brace expansion

2014-12-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Allow curly brace expansion - fnmatch, glob: Allow curly brace expansion ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: How should we handle platforms which don't provide a memory allocator with an alignment? The simplest option is to return NULL (MemoryError). Are there such platforms? posix_memalign() is a POSIX standard, even OpenBSD has it. --

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset a7a8947e9ce4 by Victor Stinner in branch 'default': Issue #9647: os.confstr() ensures that the second call to confstr() returns the https://hg.python.org/cpython/rev/a7a8947e9ce4 -- nosy: +python-dev ___

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: I added an assertion. Can we close this issue? -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9647 ___

[issue22696] Add a function to know about interpreter shutdown

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: Before committing the patch it will be good to find places in the code which will benefit from this function. The traceback and/or the linecache is a first good candidate to use this new function. We may patch more functions later if needed, I don't think

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: PyMem_GetAllocator() and PyMem_SetAllocator() have a domain parameter which can take 3 values: PYMEM_DOMAIN_RAW, PYMEM_DOMAIN_MEM and PYMEM_DOMAIN_OBJ. I don't think that we need 3 flavors of allocators (PyMem_Raw, PyMem, PyObject). Maybe the PYMEM_DOMAIN_RAW

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: (Oops, I didn't want to close the issue.) -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9647 ___

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread Nathaniel Smith
Nathaniel Smith added the comment: It's not terribly difficult to write a crude-but-effective aligned allocator on top of raw malloc: def aligned_malloc(size, alignment): assert alignment 255 raw_pointer = (uint8*) malloc(size + alignment) shift = alignment - (raw_pointer %

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 05/12/2014 23:15, STINNER Victor a écrit : I don't think that we need 3 flavors of allocators (PyMem_Raw, PyMem, PyObject). Maybe the PYMEM_DOMAIN_RAW domain is enough: OS functions don't require the GIL. In this case, should we add a new pair of

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread Nathaniel Smith
Nathaniel Smith added the comment: Re: msg232219: If you go down the route of adding both aligned_malloc and aligned_free to the Allocator structure, I think you might as well support it for all domains? For the PyMem and PyObject domains you can just literally set the default functions to be

[issue22989] HTTPResponse.msg not as documented

2014-12-05 Thread Martin Panter
Martin Panter added the comment: See Issue 21228 for a patch which documents the “.msg” hack, and that the info() method is available for HTTP responses. I think documenting the “.headers” attribute would be a bad idea, because it is introducing yet another way to do what the

[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: You cannot just add a new domain because the function prototypes are different (need an extra alignement parameter). You have to add new members to the structure or add a new structure. -- ___ Python tracker

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-12-05 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: - patch review versions: -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21228 ___

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-05 Thread Martin Panter
Martin Panter added the comment: Updated patch with indentation fixed and new wording. I am just guessing the RST syntax based on the surrounding text, so please review :) -- Added file: http://bugs.python.org/file37372/runtest.patch ___ Python

[issue22998] inspect.Signature and default arguments

2014-12-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: Should this be closed now? -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22998 ___ ___

[issue22998] inspect.Signature and default arguments

2014-12-05 Thread Yury Selivanov
Yury Selivanov added the comment: Should this be closed now? Yes, let's close it. David and Walter, you're welcome to re-open the issue if you want to discuss it in more detail. -- resolution: - wont fix status: open - closed ___ Python tracker

[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-05 Thread Yury Selivanov
Yury Selivanov added the comment: Hi Victor, I left you some feedback in code review. I'm kind of leaning towards your proposal that we should force users to always use safe API. But I also understand Guido's point. -- ___ Python tracker

[issue16041] poplib: unlimited readline() from connection

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 339f877cca11 by Benjamin Peterson in branch '2.7': in poplib, limit maximum line length that we read from the network (closes #16041) https://hg.python.org/cpython/rev/339f877cca11 -- resolution: - fixed stage: patch review - resolved

[issue16042] smtplib: unlimited readline() from connection

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 923aac88a3cc by Benjamin Peterson in branch '2.7': smtplib: limit amount read from the network (closes #16042) https://hg.python.org/cpython/rev/923aac88a3cc -- resolution: - fixed stage: needs patch - resolved status: open - closed

[issue16043] xmlrpc: gzip_decode has unlimited read()

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset d50096708b2d by Benjamin Peterson in branch '2.7': add a default limit for the amount of data xmlrpclib.gzip_decode will return (closes #16043) https://hg.python.org/cpython/rev/d50096708b2d -- nosy: +python-dev resolution: - fixed stage:

[issue16893] Generate Idle help from Doc/library/idle.rst

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 283c364c372a by Terry Jan Reedy in branch '2.7': Issue #16893: Update Idle doc chapter to match current Idle and add new https://hg.python.org/cpython/rev/283c364c372a New changeset 2fc341c6e314 by Terry Jan Reedy in branch '3.4': Issue #16893:

[issue22998] inspect.Signature and default arguments

2014-12-05 Thread R. David Murray
R. David Murray added the comment: I'm good with your solution, but I'm going to adjust the resolution by changing the component :) -- assignee: - docs@python components: +Documentation -Library (Lib) nosy: +docs@python resolution: wont fix - fixed stage: - resolved

[issue16043] xmlrpc: gzip_decode has unlimited read()

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset a0368f81af9a by Benjamin Peterson in branch '3.2': add a default limit for the amount of data xmlrpclib.gzip_decode will return (closes #16043) https://hg.python.org/cpython/rev/a0368f81af9a New changeset 4a9418c6f8ae by Benjamin Peterson in

[issue9179] Lookback with group references incorrect (two issues?)

2014-12-05 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- priority: release blocker - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9179 ___ ___

[issue22935] Disabling SSLv3 support

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 49d267a58cc2 by Benjamin Peterson in branch '2.7': allow ssl module to compile if openssl doesn't support SSL 3 (closes #22935) https://hg.python.org/cpython/rev/49d267a58cc2 New changeset 4077e0cd8d48 by Benjamin Peterson in branch '3.4': allow

[issue22919] Update PCBuild for VS 2015

2014-12-05 Thread Steve Dower
Steve Dower added the comment: Does anyone else want to provide any feedback? Or should I go ahead and get it in (after rebasing/retesting/etc.)? The feedback so far has been really helpful. -- ___ Python tracker rep...@bugs.python.org

[issue9584] fnmatch, glob: Allow curly brace expansion

2014-12-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___