[issue9548] locale can be imported at startup but relies on too many library modules
Raymond Hettinger added the comment: +1 This seems like a reasonable solution. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19201] lzma and 'x' mode open
STINNER Victor added the comment: Being strict this would be 3.4 material, Why? The patch is trivial, I don't how it could cause a regression. If you don't want regression, add a unit test to test_lzma.py. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15805] Add stdout redirection tool to contextlib
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15805 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15805] Add stdout redirection tool to contextlib
Roundup Robot added the comment: New changeset 63a1ee94b3ed by Raymond Hettinger in branch 'default': Issue #15805: Add contextlib.redirect_stdout() http://hg.python.org/cpython/rev/63a1ee94b3ed -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15805 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9548] locale can be imported at startup but relies on too many library modules
STINNER Victor added the comment: The io module doesn't need to set temporarly the LC_CTYPE locale (which is a good thing because the change is process-wide!). If we ignore systems where CODESET is not available, the _bootlocale can be simplified to a few lines: if sys.platform.startswith(win): def getpreferredencoding(): import _locale return _locale._getdefaultlocale()[1] else: def getpreferredencoding(): result = nl_langinfo(CODESET) if not result and sys.platform == 'darwin': result = 'UTF-8' return result This code can probably be implemented in C, directly in the _locale module. Would it be acceptable to modify the io module to replace locale.getpreferredencoding(False) with _locale.getpreferredencoding(False)? Does anyone know if Python does still support systems where CODESET is not available? Which OS does not support CODESET? Would it be acceptable to fallback to locale.py if CODESET is not available? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15329] clarify which deque methods are thread-safe
Raymond Hettinger added the comment: So, is deque a faster replacement for Queue.Queue or not? Yes, it is faster. The Queue module itself uses the deque internally. And the Queue is slowed down a bit through locks, function indirection, and additional features such as maxsize, join, and task_done. The deque's append(), appendleft(), pop(), popleft(), and len(d) operations are thread-safe in CPython. The append methods have a DECREF at the end (for cases where maxlen has been set), but this happens after all of the structure updates have been made and the invariants have been restored, so it is okay to treat these operations as atomic. Closing this tracker item. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15329 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19209] Remove import copyreg from os module
STINNER Victor added the comment: Can't we modify the qualified name instead? Attached os_stat_statvfs_pickle.patch implements this idea. IMO it's much simpler because it removes completly the need of the copyreg module. Example with the patch on Linux: $ ./python Python 3.4.0a3+ (default:63a1ee94b3ed+, Oct 10 2013, 10:03:45) import os, pickletools, pickle s=os.stat('.') pickletools.dis(pickle.dumps(s)) 0: \x80 PROTO 3 2: cGLOBAL 'os stat_result' ... pickle.loads(pickle.dumps(s)) os.stat_result(st_mode=16893, st_ino=19792207, st_dev=64772, st_nlink=17, st_uid=1000, st_gid=1000, st_size=28672, st_atime=1381392226, st_mtime=1381392226, st_ctime=1381392226) v=os.statvfs('.') pickletools.dis(pickle.dumps(v)) 0: \x80 PROTO 3 2: cGLOBAL 'os statvfs_result' ... pickle.loads(pickle.dumps(v)) os.statvfs_result(f_bsize=4096, f_frsize=4096, f_blocks=125958458, f_bfree=124095595, f_bavail=117695595, f_files=32006144, f_ffree=31792079, f_favail=31792079, f_flag=4096, f_namemax=255) -- Added file: http://bugs.python.org/file32026/os_stat_statvfs_pickle.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19206] Support disabling file I/O when doing traceback formatting
STINNER Victor added the comment: Unfortunately, the traceback.py module reads from files to load the source lines for the traceback (using linecache.py). linecache is supposed to cache the result. When all files generating tracebacks of your project are cached, only os.stat() is called on each file to check if the file has been modified. But I'm not sure I understood your request: do you want the line content in your traceback or not? If you don't want the line content, the traceback module should be modified to add an option don't read file content. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19206 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates
STINNER Victor added the comment: I tested utf_16_32_surrogates_4.patch: surrogateescape with as encoder does not work as expected. b'[\x00\x80\xdc]\x00'.decode('utf-16-le', 'ignore') '[]' b'[\x00\x80\xdc]\x00'.decode('utf-16-le', 'replace') '[�]' b'[\x00\x80\xdc]\x00'.decode('utf-16-le', 'surrogateescape') '[\udc80\udcdc\u' = I expected '[\udc80\udcdc]'. With a decoder, surrogateescape does not work neither: '[\uDC80]'.encode('utf-16-le', 'surrogateescape') Traceback (most recent call last): File stdin, line 1, in module UnicodeEncodeError: 'utf-16-le' codec can't encode character '\udc80' in position 1: surrogates not allowed Using the PEP 383, I expect that data.decode(encoding, 'surrogateescape') does never fail, data.decode(encoding, 'surrogateescape').encode(encoding, 'surrogateescape') should give data. -- With UTF-16, there is a corner case: b'[\x00\x00'.decode('utf-16-le', 'surrogateescape') Traceback (most recent call last): File stdin, line 1, in module File /home/haypo/prog/python/default/Lib/encodings/utf_16_le.py, line 16, in decode return codecs.utf_16_le_decode(input, errors, True) UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 2: truncated data b'[\x00\x80'.decode('utf-16-le', 'surrogateescape') '[\udc80' The incomplete sequence b'\x00' raises a decoder error, wheras b'\x80' does not. Should we extend the PEP 383 to bytes in range [0; 127]? Or should we keep this behaviour? Sorry, this question is unrelated to this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12892 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15329] clarify which deque methods are thread-safe
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15329 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15805] Add stdout redirection tool to contextlib
Vajrasky Kok added the comment: Nice. My only complain is the dis.dis example. We don't have to use redirect_stdout context manager. +# How to capture disassembly to a string + +import dis +import io + +f = io.StringIO() +with redirect_stdout(f): +dis.dis('x**2 - y**2') +s = f.getvalue() dis.dis supports file object natively. We can do this instead: dis.dis('x**2 - y**2', file=f) -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15805 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19214] shutil.make_archive should recognize extensions in filenames
New submission from Andreas Hilboll: shutil.make_archive should be able to automatically determine the desired *format* from the given filename. It would make life easier, because the programmer wouldn't need to strip the extension from the filename before passing it to make_archive. I'm think of something along the lines of if base_path.lower().endswith(.zip): fmt = zip base_path = base_path[:-4] elif base_path.lower().endswith(.tar.gz) or base_path.lower().endswith(.tgz): fmt = gztar base_path = base_path[:-7] elif base_path.lower().endswith(.tar.bz2): fmt = bztar base_path = base_path[:-8] elif base_path.lower().endswith(.tar): fmt = tar base_path = base_path[:-4] -- messages: 199373 nosy: andreas-h priority: normal severity: normal status: open title: shutil.make_archive should recognize extensions in filenames type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19214 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19210] Unicode Objects in Tuples
Stephen Tucker added the comment: Dear All (Eric Smith in particular), I see the issue has been closed - I guess that I have to use e-mail to continue this discussion. I attach a source file that demonstrates the feature, and the output from IDLE that it generated. Yours, Stephen Tucker. On Wed, Oct 9, 2013 at 6:10 PM, Eric V. Smith rep...@bugs.python.orgwrote: Eric V. Smith added the comment: Can you provide some code which demonstrates this? It's easier to address this if we have known working (or non-working) examples. Thanks. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___ -- Added file: http://bugs.python.org/file32027/UnicodeTupleTestIDLEOutput.txt Added file: http://bugs.python.org/file32028/UnicodeTupleTest.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. import UnicodeTupleTest (u'\u2021',) (u'\u2021', u'\u2021') # # Set a unicode string with a non-ASCII character mystring = u'\u2021' # # Print the string print mystring # # Print the string enclosed in parentheses print (mystring) # # Print the string as the first item in a tuple whose second item is None print (mystring,) # # Set a tuple consisting of two instances of this string mytuple = (mystring, mystring) # # Print the tuple print mytuple ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates
STINNER Victor added the comment: Could you please review this not so simple patch instead? I did a first review of your code on rietveld. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12892 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19215] StringIO.StringIO('foo').readline(0) == 'foo'
New submission from Zdeněk Pavlas: The behavior contradicts documentation and is inconsistent with both cStringIO and File objects. Patch attached. StringIO.StringIO('foo').readline(0) 'foo' cStringIO.StringIO('foo').readline(0) '' open('/etc/passwd').readline(0) '' -- components: Library (Lib) files: stringio.patch keywords: patch messages: 199376 nosy: Zdeněk.Pavlas priority: normal severity: normal status: open title: StringIO.StringIO('foo').readline(0) == 'foo' type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file32029/stringio.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19215 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19201] lzma and 'x' mode open
Vajrasky Kok added the comment: Here is the unit test for Tim Heaney's work. There is a test that explicitly tests that we get error when opening in 'x' mode. Also, this test is only for lzma. I think we should create separate tickets for other compression methods. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32030/add_x_mode_to_lzma.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19201] lzma and 'x' mode open
Changes by Vajrasky Kok sky@speaklikeaking.com: Removed file: http://bugs.python.org/file32030/add_x_mode_to_lzma.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19201] lzma and 'x' mode open
Changes by Vajrasky Kok sky@speaklikeaking.com: Added file: http://bugs.python.org/file32031/add_x_mode_to_lzma.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
New submission from Christian Heimes: The import library uses excessive stat() calls. I've implemented a simple cache for the bootstrap module that reduces the amount of stat() calls by almost 1/3 (236 - 159 on Linux). -- assignee: brett.cannon files: import_stat_cache.patch keywords: patch messages: 199378 nosy: brett.cannon, christian.heimes priority: normal severity: normal stage: patch review status: open title: stat cache for import bootstrap type: performance versions: Python 3.4 Added file: http://bugs.python.org/file32032/import_stat_cache.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19210] Unicode Objects in Tuples
Martin v. Löwis added the comment: Stephen: do you agree that your example actually doesn't demonstrate the issue you originally reported? Your first to print statements don't actually print a tuple, whereas the latter two do, and the string gets always escaped in the tuple, and never when printed directly. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19210] Unicode Objects in Tuples
Eric V. Smith added the comment: As Martin points out, your first example is printing a string, not a tuple. The parens here are not building a tuple, they are just used for grouping in the expression, and are not doing anything in this example. So my explanation still holds: everything is working as designed. The output of the first two print statements uses str(astring), the second two use str(atuple). repr of a tuple is effectively: ( + , .join(repr(item) for item in tuple) + ) So when printing your tuples, Python is using the repr of each string in the tuple. Since this is not a bug or feature request, it's probably best to continue the discussion on python-list. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16938] pydoc confused by __dir__
Ronald Oussoren added the comment: A problem with __objclass__ is that it is undocumented other than in PEP 252. That why I called it a workaround, at the time I created this issue I had just found the problem and workaround and as far as I knew __objclass__ was an undocumented feature of CPython that just happened to fix my problem. If using __objclass__ is the right solution, as it seems to be, this should be documented somewhere, probably in the section on descriptors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16938 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19215] StringIO.StringIO('foo').readline(0) == 'foo'
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19215 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19215] StringIO.StringIO('foo').readline(0) == 'foo'
R. David Murray added the comment: Oops, I was too quick with that nosy. This bug is fixed in io.StringIO, which means it is fixed in Python3. And sorry to say, it shouldn't be fixed in a maintenance release, since it is a behavior change that could break working programs. -- nosy: +r.david.murray resolution: - out of date stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19215 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19217] Calling assertEquals for moderately long list takes too long
New submission from Jacek Bzdak: Call to assertEquals(list1, list2) does not finish (takes more than couple of minutes), for lists that containt 1 elements if all list elements are different. The same call in python2.6 finishes instanteneously. This occours even if error message is truncated using maxDiff. -- components: Library (Lib) files: unittest_scse.py messages: 199383 nosy: Jacek.Bzdak priority: normal severity: normal status: open title: Calling assertEquals for moderately long list takes too long type: resource usage versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file32033/unittest_scse.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19217] Calling assertEquals for moderately long list takes too long
Jacek Bzdak added the comment: I have attached a simple test case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19217] Calling assertEquals for moderately long list takes too long
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, michael.foord stage: - needs patch versions: +Python 3.4 -Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14604] spurious stat() calls in importlib
Changes by Christian Heimes li...@cheimes.de: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14604 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
STINNER Victor added the comment: See also #14604. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
Roundup Robot added the comment: New changeset bea4447c22bf by Victor Stinner in branch 'default': Issue #18874: PyCode_New() now ensures that the filename is a ready Unicode http://hg.python.org/cpython/rev/bea4447c22bf New changeset ba27cba3ae20 by Victor Stinner in branch 'default': Issue #18874: _PyObject_Malloc/Realloc/Free() now falls back on http://hg.python.org/cpython/rev/ba27cba3ae20 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Antoine Pitrou added the comment: Benchmarks? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe
Roundup Robot added the comment: New changeset 98dbe677dfe7 by Victor Stinner in branch 'default': Close #16742: Fix misuse of memory allocations in PyOS_Readline() http://hg.python.org/cpython/rev/98dbe677dfe7 -- nosy: +python-dev resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19217] Calling assertEquals for moderately long list takes too long
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18999] Robustness issues in multiprocessing.{get, set}_start_method
Richard Oudkerk added the comment: BTW, the context objects are singletons. I could not see a sensible way to make ctx.Process be a picklable class (rather than a method) if there can be multiple instances of a context type. This means that the helper processes survive until the program closes down. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18999 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19192] Move test_current_time from test_xmlrpc_net to test_xmlrpc
R. David Murray added the comment: Added some review comments. Summary: I think we should just make it a dotted attribute test, and forget about the 'time' thing, which was just used because that's what the available network test used. (I find it odd that allow_dotted_names does not appear to be tested at all.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19192 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18999] Robustness issues in multiprocessing.{get, set}_start_method
Richard Oudkerk added the comment: Attached is a patch which allows the use of separate contexts. For example try: ctx = multiprocessing.get_context('forkserver') except ValueError: ctx = multiprocessing.get_context('spawn') q = ctx.Queue() p = ctx.Process(target=foo, args=(q,)) p.start() ... Also, get_start_method(allow_none=True) will return None if the start method has not yet been fixed. -- Added file: http://bugs.python.org/file32034/context.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18999 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
R. David Murray added the comment: It occurs to me, looking at the docs, that there are doc changes also required for this patch. And given that there are doc changes, this clearly can't be treated as a bug fix. If there is no objection to fixing it in 3.4, though, I'd like to do that in the next few days. This is not normally the kind of change that I'd advocate for, since it does break backward compatibility, but in this case I think the benefits outweigh the possible problems, since there are probably very few people who script pdb sessions. -- versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
R. David Murray added the comment: There is definitely a bug in set_payload here, and (obviously :) no test for that case (passing an 8bit charset to set_payload). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19192] Move test_current_time from test_xmlrpc_net to test_xmlrpc
Vajrasky Kok added the comment: Attached the second version patch to address R. David Murray's concerns. 1. test_dotted_attribute name has been taken, so I use test_instance_with_allow_dotted_names name. Or should I use test_instance_with_dotted_attribute name? Or maybe test_allow_dotted_names name? 2. There is no test testing allow_dotted_name feature with fail case. I did consider to chuck the test in this ticket. But one xmlrpc server can only register one instance, meaning I have to create a separate server for this test. Currently we have two: http_server and http_multi_server. I don't think it's a good idea to chuck the fail case to http_multi_server. 3. Okay, I removed the checking datetime test. Thanks. -- Added file: http://bugs.python.org/file32035/move_current_time_test_from_xmlrpc_net_to_xmlrpc_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19192 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16355] inspect.getcomments() does not work in the interactive shell
Vajrasky Kok added the comment: Only doc fix? What about unit test confirming that getcomments and getsource return None if inspect can not find the source code? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16355 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
Eric Snow added the comment: Though I can't speak regarding the patch, your justification for breaking backward compatibility seems good enough to me (but I may not be the best judge :). However, backward compatibility is a funny thing. I've spent not insignificant time thinking about it with regards to the import system and PEP 451 particularly. The problem is that, while there may not be much code using a feature now, there may be people that start to use it later under an earlier system Python (e.g. 3.2 or 3.3). Then when their system upgrades Python to 3.4 their code breaks. So a backward incompatible change can have a more adverse impact than is measurable right now. That's a subtle but significant reason behind our aversion to breaking backward compatibility, I've come to realize. Of course, doing so is still an option if the benefit outweighs the risk/cost. It sounds like you are comfortable with the risk here, and I trust your judgement. :) -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16355] inspect.getcomments() does not work in the interactive shell
R. David Murray added the comment: Yes, good point, those tests should definitely be added, which means the test work doesn't go to waste :) Note, however, that getsource *does* raise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16355 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
R. David Murray added the comment: Well, I'm not certain, to tell you the truth. However, the only non-backward-incompatible change that will work is to introduce a new command that gives one access to the real print function, and that to me feels really really ugly and, if I may be somewhat hyperbolic, undignified. In other words, I am willing to break this particular feature in a feature release as the price of restoring pdb's consistency with the python language and the history of the changes between python2 and python3...because it is primarily a UI change and not a change that affects programs (in the general case, at least). It shouldn't depend on only my view though. If Georg doesn't want to decide, we should put it out to python-dev. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
Eric Snow added the comment: Sounds good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Brett Cannon added the comment: A cursory look at the patch suggests that the cache use is permanent and so any dynamic changes to a file or directory after an initial caching will not be picked up. Did you run the test suite with this patch as it should have failed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Christian Heimes added the comment: Is the content of the bootstrap module used after the interpreter is boot strapped? I see ... that's a problem. It's a proof of concept anyway and the speed up is minimal. On my computer with a SSD the speedup barely measurable. I'd like to see if it makes a difference on a Raspbarry Pi or a NFS shares I have another idea, too. Could we add an optional 'stat' argument to __init__() of FileLoader and ExtensionFileLoader so we can pass the stat object around and reuse it for loading? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
New submission from Eric Snow: There has been some discussion on python-dev about improving interpreter startup time. Christian Heimes brought up how the os module imports collections (so _Environ can inherit from it) [1], and mentioned a couple of solutions [2]. [1]https://mail.python.org/pipermail/python-dev/2013-October/129312.html [2]https://mail.python.org/pipermail/python-dev/2013-October/129367.html -- components: Library (Lib) messages: 199402 nosy: christian.heimes, eric.snow priority: normal severity: normal stage: needs patch status: open title: Use of MutableMapping in os module slows down interpreter startup type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
Georg Brandl added the comment: patch looks good for 3.4; I probably didn't realize that p uses repr when I added print. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Eric Snow added the comment: Here is a patch for an alternate approach. It does not require re-implementing MutableMapping (could get out of sync) and does not require rearranging collections.abc. Instead it uses a metaclass to resolve the import issue lazily. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file32036/os-lazy-collections.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Christian Heimes added the comment: Nice trick :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Eric Snow added the comment: And when the lazy base class gets resolved, the metaclass gets to say You didn't see anything and I was never here. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18243] mktime_tz documentation out-of-date
Changes by Vladimir Rutsky altsy...@gmail.com: -- nosy: +rutsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18243 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19210] Unicode Objects in Tuples
Stephen Tucker added the comment: Martin: Yes, I agree this does not demonstrate the issue I reported - so far as print is concerned. The other issue in my original report was that the same behaviour is exhibited when tuples are read from a utf-8 - encoded file where a tuple which has a unicode string in it with a non-ASCII character is displayed with its non-ASCII characters as escapes. Eric: I am in a quandary. I am not convinced that the appearance of such strings (under either circumstance) should be governed by whether they are in tuples or not. It still seems remarkably like a bug to me. However, I am happy to continue this discussion on Python-list, if you consider it better to do that. Please, can you tell me, how do I do that? On Thu, Oct 10, 2013 at 12:29 PM, Eric V. Smith rep...@bugs.python.orgwrote: Eric V. Smith added the comment: As Martin points out, your first example is printing a string, not a tuple. The parens here are not building a tuple, they are just used for grouping in the expression, and are not doing anything in this example. So my explanation still holds: everything is working as designed. The output of the first two print statements uses str(astring), the second two use str(atuple). repr of a tuple is effectively: ( + , .join(repr(item) for item in tuple) + ) So when printing your tuples, Python is using the repr of each string in the tuple. Since this is not a bug or feature request, it's probably best to continue the discussion on python-list. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19219] speed up marshal.loads()
New submission from Antoine Pitrou: This patch contains assorted improvements for unmarshalling pyc files. It will also make them ~10% smaller. $ ./python -m timeit -s import marshal; d=marshal.dumps(tuple((i, str(i)) for i in range(1000))) marshal.loads(d) - 3.4 unpatched: 232 usec per loop - 3.4 patched: 96.3 usec per loop - 2.7 (for reference): 76.5 usec per loop -- components: Interpreter Core files: marshal_opts4.patch keywords: patch messages: 199408 nosy: barry, christian.heimes, pitrou priority: normal severity: normal stage: patch review status: open title: speed up marshal.loads() type: performance versions: Python 3.4 Added file: http://bugs.python.org/file32037/marshal_opts4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19219 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19219] speed up marshal.loads()
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19219 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19210] Unicode Objects in Tuples
R. David Murray added the comment: python-list is a mailing list, so you would subscribe and post your questions and examples there. There are very good reasons for the existing behavior, and python-list would be a good place for you to learn about them (by asking questions). The file case is the same: you are using print to create the output, and it is print's rules that are being used to generate that output, before it ever gets written to the file. (And by the way, you are free to post to a closed issue. Having it closed just means it doesn't show up on our list of issues we need to fix :) -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19210 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Brett Cannon added the comment: importlib/_bootstrap.py is importlib, period, so there is no separation of what is used to start Python and what is used after interpreter startup is completed. As for adding a 'stat' argument to the loaders, it's possible but as always it comes down to whether it will break someone or not. Since loaders do not necessarily execute immediately you are running the risk of a very stale cached stat object. Plus Eric Snow has his PEP where the API in terms of loader __init__ signature so you would want to look into that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19220] Outdated unicodedata.__doc__
New submission from Arfrever Frehtes Taifersar Arahesis: Unicode version was updated in 3.3 and 3.4, but unicodedata.__doc__ was not updated. $ for version in 3.2 3.3 3.4; do python${version} -c 'import unicodedata; print(%s\n\%s\\n % (unicodedata.unidata_version, unicodedata.__doc__))'; done 6.0.0 This module provides access to the Unicode Character Database which defines character properties for all Unicode characters. The data in this database is based on the UnicodeData.txt file version 6.0.0 which is publically available from ftp://ftp.unicode.org/. The module uses the same names and symbols as defined by the UnicodeData File Format 6.0.0 (see http://www.unicode.org/reports/tr44/tr44-6.html). 6.1.0 This module provides access to the Unicode Character Database which defines character properties for all Unicode characters. The data in this database is based on the UnicodeData.txt file version 6.0.0 which is publically available from ftp://ftp.unicode.org/. The module uses the same names and symbols as defined by the UnicodeData File Format 6.0.0 (see http://www.unicode.org/reports/tr44/tr44-6.html). 6.2.0 This module provides access to the Unicode Character Database which defines character properties for all Unicode characters. The data in this database is based on the UnicodeData.txt file version 6.0.0 which is publically available from ftp://ftp.unicode.org/. The module uses the same names and symbols as defined by the UnicodeData File Format 6.0.0 (see http://www.unicode.org/reports/tr44/tr44-6.html). URL for 6.1.0: http://www.unicode.org/reports/tr44/tr44-8.html URL for 6.2.0: http://www.unicode.org/reports/tr44/tr44-10.html -- messages: 199411 nosy: Arfrever priority: normal severity: normal status: open title: Outdated unicodedata.__doc__ versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19220 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19221] Upgrade to Unicode 6.3.0
New submission from Arfrever Frehtes Taifersar Arahesis: Unicode 6.3.0 was released on 2013-09-30. Please remember to update unicodedata.__doc__. New URL for unicodedata.__doc__: http://www.unicode.org/reports/tr44/tr44-12.html -- messages: 199412 nosy: Arfrever priority: normal severity: normal status: open title: Upgrade to Unicode 6.3.0 versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19221 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19221] Upgrade to Unicode 6.3.0
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson, ezio.melotti, lemburg, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19221 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19221] Upgrade to Unicode 6.3.0
Changes by Benjamin Peterson benja...@python.org: -- assignee: - benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19221 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12939] Add new io.FileIO using the native Windows API
Piotr Dobrogost added the comment: I guess extracting Richard's patch to a package and placing it on PyPI would be a good move. I recalled reading this bug after I saw Does Python IO allow opened file to be deleted/renamed on Windows? question on Stackoverflow (http://stackoverflow.com/q/19280836/95735) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12939 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
Connor Osborn added the comment: Here is the documentation patch: I defaulted to the docs that were in 2.7.5, by noting that beside the p command the builtin print function could be used. I also fixed a small code sample that still used print ... syntax. -- Added file: http://bugs.python.org/file32038/18764-docs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19221] Upgrade to Unicode 6.3.0
Roundup Robot added the comment: New changeset 97df7404f39c by Benjamin Peterson in branch 'default': upgrade unicode db to 6.3.0 (closes #19221) http://hg.python.org/cpython/rev/97df7404f39c -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19221 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19222] gzip and 'x' mode open
New submission from Tim Heaney: This is analogous to issue19201, but for gzip. Recent versions of Python have an 'x' mode for open, but gzip doesn't support it. It looks like everything is passed to builtins.open eventually, so if we just allow the 'x' option to pass through, all will be well. -- files: patch.gzip.py messages: 199416 nosy: oylenshpeegul priority: normal severity: normal status: open title: gzip and 'x' mode open type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file32039/patch.gzip.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19222 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
Roundup Robot added the comment: New changeset 592579b89d8c by R David Murray in branch 'default': #18764: p(rint) - p in pdb docs. http://hg.python.org/cpython/rev/592579b89d8c -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19223] bz2 and 'x' mode open
New submission from Tim Heaney: This is analogous to issue19201, but for bz2. Recent versions of Python have an 'x' mode for open, but bz2 doesn't support it. It looks like everything is passed to builtins.open eventually, so if we just allow the 'x' option to pass through, all will be well. -- files: patch.bz2.py messages: 199418 nosy: oylenshpeegul priority: normal severity: normal status: open title: bz2 and 'x' mode open type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file32040/patch.bz2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
R. David Murray added the comment: I applied the patch (with doc and test changes) in d4d886620a00, before I saw your patch. But your patch fixes the main 'p' docs, which I somehow missed, so I applied it, too. So, thanks Connor, and I think this is done. A couple notes if you are going to continue to contribute, which I hope you do: diffs from the root of the checkout are easier to apply (ideally, 'hg diff', or 'git diff' if you use the git mirror). And, please submit a contributor agreement (http://www.python.org/psf/contrib). -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19220] Outdated unicodedata.__doc__
Arfrever Frehtes Taifersar Arahesis added the comment: Issue #19221 has been fixed, but URL in unicodedata.__doc__ in default branch was not updated :( . Now it should be http://www.unicode.org/reports/tr44/tr44-12.html -- assignee: - benjamin.peterson nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19220 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19220] Outdated unicodedata.__doc__
Roundup Robot added the comment: New changeset 4e301c80f5d1 by Benjamin Peterson in branch '3.3': remove url from docstring (closes #19220) http://hg.python.org/cpython/rev/4e301c80f5d1 New changeset f38edb58fefb by Benjamin Peterson in branch 'default': merge 3.3 (#19220) http://hg.python.org/cpython/rev/f38edb58fefb -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19220 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19201] lzma and 'x' mode open
Tim Heaney added the comment: Okay, I just made similar issues for gzip (issue19222) and bz2 (issue19223). It's weird how different these three patches are! We're essentially doing the same thing: please allow the x option to pass through to builtins.open. Why don't these three modules look more alike? On Thu, Oct 10, 2013 at 6:31 AM, Vajrasky Kok rep...@bugs.python.orgwrote: Vajrasky Kok added the comment: Here is the unit test for Tim Heaney's work. There is a test that explicitly tests that we get error when opening in 'x' mode. Also, this test is only for lzma. I think we should create separate tickets for other compression methods. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32030/add_x_mode_to_lzma.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18764] The pdb print command prints repr instead of str in python3
Connor Osborn added the comment: I'm hoping to ease into more involvement. Thanks for the review and tips, and I submitted the agreement(e-sign version). -- nosy: -eric.snow, ezio.melotti, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18764 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Eric Snow added the comment: With ModuleSpec (PEP 451), the finder creates the spec object (where it stores the loader). At that point the finder is free to store any stat object you like in spec.loader_state. The spec is made available to the loader during exec (if the loader supports it, which the importlib loaders will). So there is no need to add anything to any loader __init__. The only catch is the slim possibility that the stat object will be stale by the time it gets used. I seem to remember a case where something like this happened (related to distros building their system Python or something). -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19219] speed up marshal.loads()
STINNER Victor added the comment: Why adding ASCII strings, whereas you can add Latin1 (UCS1, U+-U+00FF) strings? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19219 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18754] Run Python child processes in isolated mode in the test suite?
STINNER Victor added the comment: @Crys: ping! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18754 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18664] occasional test_threading failure
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18664 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18281] tarfile defines stat constants
STINNER Victor added the comment: issue18281.stoneleaf.01.patch looks good to me, please commit it! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18281 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16381] Introduce option to force the interpreter to exit upon MemoryErrors
STINNER Victor added the comment: This issue is maybe a new usecase of the PEP 445. Try attached Python module fatalmalloc.c, use attached setup.py script to build it. $ python3.4 -c 'import fatalmalloc; x=x*(50*1024*1024); print(len(x))' Traceback (most recent call last): File string, line 1, in module MemoryError $ python3.4 -c 'import fatalmalloc; fatalmalloc.enable(); x=x*(50*1024*1024)' $ echo $? 1 -- Added file: http://bugs.python.org/file32041/fatalmalloc.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16381 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16381] Introduce option to force the interpreter to exit upon MemoryErrors
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file32042/setup.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16381 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19046] SystemError: ..\Objects\weakrefobject.c:903: bad argument to internal function
STINNER Victor added the comment: @ichael Herrmann: ping? Without feedback, I will close the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19046 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Eric Snow added the comment: For interpreter startup, stats are not involved for builtin and frozen modules[1]. They are tied to imports that involve traversing sys.path (a.k.a. PathFinder). Most stats happen in FileFinder.find_loader. The remainder are for source (.py) files (a.k.a. SourceFileLoader). Here's a rough sketch of what typically happens currently during the import of a path-based module[2], as related to stats (and other FS access): (lines with FS access start with *) def load_module(fullname): suffixes = ['.cpython-34m.so', '.abi3.so', '.so', '.py', '.pyc'] tailname = fullname.rpartition('.')[2] for entry in sys.path: * mtime = os.stat(entry).st_mtime if mtime != cached_mtime: * cached_listdir = os.listdir(entry) if tailname in cached_listdir: basename = entry/tailname * if os.stat(basename).st_mode implies directory: # superfluous? # package? for suffix in suffixes: full_path = basename + suffix * if os.stat(full_path).st_mode implies file: if is_extension: * dlopen(full_path) elif is_sourceless: * open(full_path).read() else: load_from_source(full_path) return # ...non-package module? for suffix in suffixes: full_path = entry/tailname + suffix if tailname + suffix in cached_listdir: * if os.stat(full_path).st_mode implies file: # superfluous? if is_extension: * dlopen(full_path) elif is_sourceless: * open(full_path).read() else: load_from_source(full_path) def load_from_source(sourcepath): * st = os.stat(sourcepath) if st: * open(bytecodepath).read() else: * open(sourcepath).read() * os.stat(sourcepath).st_mode for parent in ancestor_dirs(sourcepath): * os.stat(parent).st_mode - missing_parents for parent in missing_parents: * os.mkdir(parent) * open(tempname).write() * os.replace(tempname, bytecodepath) Obviously there are some unix-isms in there. Windows ends up not that different though. stat/FS count - load_module (*per path entry*): (add 1 listdir to each if the cache is stale) not found: 1 stat non-package dir: 7 (num_suffixes + 2 stats) package (best): 4/5-9+ (3 stats, 1 read or load_from_source) package (worst): 8/9-13+ (num_suffixes + 2 stats, 1 read or load_from_source) non-package module 3/4-8+ (best): (2 stats, 1 read or load_from_source) non-package module 7/8-12+ (worst): (num_suffixes + 1 stats, 1 read or load_from_source) non-package module + dir (best): 10/11-15+ (num_suffixes + 4 stats, 1 read or load_from_source) non-package module + dir (best): 14/15-19+ (num_suffixes * 2 + 3 stats, 1 read or load_from_source) load_from_source: cached: 2 (1 stat, 1 read) uncached, no parents: 4 (2 stats, 1 write, 1 replace) uncached, no missing parents: 5+ (num_parents + 2 stats, 1 write, 1 replace) uncached, missing parents: 6+ (num_parents + 2 stats, num_missing mkdirs, 1 write, 1 replace) Highlights: * the common case is not fast (for the sake of the slight possibility that files may change between imports)--not as much an issue during interpreter startup. * up to 5 different suffixes with a separate stat for each (with extension module suffixes tried first). * the size and ordering of sys.path has a decided impact on # stats. * if a module is cached, a lot less FS access happens. * the more nested a module, the more access happen. * namespace packages don't have much impact on performance. Possible improvements: * provide an internal mechanism to turn on/off caching all stats (don't worry about staleness) and maybe expose it via a context manager/API. (not unlike what Christian put in his patch.) * at least do some temporally local caching where the risk of staleness is particularly small. * Move .py ahead of extension modules (or just behind .cpython-34m.so)? * non-packages are more common than packages (?) so look for those first (hard to make effective without breaking key import semantics). * remove 2 possibly superfluous stats? [1] Maybe we should freeze the stdlib. 0.5 wink [2] importing a module usually involves importing the module's parent and its parent and so forth. Each of those incurs the same stat hits all over again (though usually packages have only 1 path entry to traverse). The stdlib is pretty flat (particularly among modules involved during startup) so this is less of an issue for this ticket. -- ___ Python tracker rep...@bugs.python.org
[issue19216] stat cache for import bootstrap
Brett Cannon added the comment: So the 2 stat calls in the general case are superfluous, it's just a question of whether they make any performance difference. Turns out that at least on my Macbook their is no performance difference and thus not worth the cost of breaking semantics over it: http://bugs.python.org/issue18810 . As for completely turning off stat calls during interpreter startup, that would definitely buy us something, but the question is how much and how do we make it work reliably? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3982] support .format for bytes
Ezio Melotti added the comment: You can use sys.stdout.buffer.write. Note that there's no guarantee that sys.stdout.buffer exists, e.g. if sys.stdout has been replaced with a StringIO. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18177] Incorect quote marks in code section-headers in PDF version of docs
Ezio Melotti added the comment: Should this be moved to the Sphinx bug tracker? -- nosy: +georg.brandl status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18177 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18233] SSLSocket.getpeercertchain()
Dustin Oprea added the comment: I was about to submit a feature request to add exactly this. The [second] patch works like a charm. When are you going to land on a particular resolution so that it can get committed in? Dustin -- nosy: +dsoprea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18233 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15805] Add stdout redirection tool to contextlib
Ezio Melotti added the comment: I think this should also be added to the whatsnew. Regarding the examples, isn't it easier to say that: with redirect_stdout(sys.stderr): print('error') is equivalent to print('error', file=sys.stderr) ? I think that in most of the cases users are redirecting something that is being print()ed, and this example gets the point across (even if the file arg can be used for this specific case, it is not always the case if print() is called by a function). Capturing help() and especially did.dis() output don't seem to me realistic/intuitive use cases for redirect_stdout(). -- stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15805 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Eric Snow added the comment: I realized those two stats are not superfluous in the case that a directory name has a .py suffix or a file doesn't have any suffix. However, I expect that's pretty uncommon. Worst case, these cases cost 2 stats per path entry. In practice they cost nothing due to the dir caching we already do. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19216] stat cache for import bootstrap
Eric Snow added the comment: I forgot to mention that optimizing the default composition of sys.path (from site) could help speed things up, though it might already be optimized in that regard. I also forgot to mention the idea of zipping up the stdlib. Sorry for the sidetrack. Now, back to the stat discussion... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3982] support .format for bytes
Glyph Lefkowitz added the comment: Tempting as it is to reply to the comment about 'buffer' not existing, we're way off topic here. Let's please keep further comments on this bug to issues about a 'format' methods on the 'bytes' object. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19224] Make hash(None) consistent among processes
Changes by Qiangning Hong hon...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file32043/hash_of_none.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19224 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19224] Make hash(None) consistent among processes
New submission from Qiangning Hong: Integers, strings, and bool's hash are all consistent for processes of a same interpreter. However, hash(None) differs. $ python -c print(hash(None)) 272931276 $ python -c print(hash(None)) 277161420 It's wired and make difficulty for distributed systems partitioning data according hash of keys if the system wants the keys support None. This patch makes hash(None) always return 0 to resolve that problem. And it is used in DPark(Python clone of Spark, a MapReduce alike framework in Python, https://github.com/douban/dpark) to speed up portable hash (see line https://github.com/douban/dpark/blob/65a3ba857f11285667c61e2e134dacda44c13a2c/dpark/util.py#L47). davies@gmail.com is the original author of this patch. All credit goes to him. -- messages: 199439 nosy: hongqn priority: normal severity: normal status: open title: Make hash(None) consistent among processes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19224 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19224] Make hash(None) consistent among processes
Raymond Hettinger added the comment: Instead of 0, pick some large random number that is less likely to collide with other hashes such as hash(0). -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19224 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19217] Calling assertEquals for moderately long list takes too long
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19224] Make hash(None) consistent among processes
Christian Heimes added the comment: How about (78 24) + (111 16) + (110 8) + 101 1315925605 The output of hash() is not guaranteed to be consistent between processes. The outcome depends on the hash randomization key, architecture, platform, Python version and perhaps other flags. 32bit builds of Python generated different hash() values than 64bit. The value might depend on endianess, too. (Not sure about that) -- nosy: +christian.heimes stage: - needs patch type: - enhancement versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19224 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19224] Make hash(None) consistent among processes
Qiangning Hong added the comment: Return 1315925605 now :) -- Added file: http://bugs.python.org/file32044/hash_of_none.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19224 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com