[issue17860] subprocess docs lack info how to use output result
Ronald Oussoren added the comment: I don't agree that adding a table/picture is the only thing that can be done, or even that it is a good idea. IMHO the subprocess documentation is clear enough about the distinction between bytes and string, especially in the section about convenience functions that is right at the top of the page. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17860] subprocess docs lack info how to use output result
Ezio Melotti added the comment: Also in the Python 3 docs we don't compare the current behavior with Python 2. Ronald patch LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution
Ned Deily added the comment: Looks good to me, other than that the doc change should include a version added directive (which can be added by the committer): .. function:: clear_cache() + .. versionadded:: 3.4 + Clear the filecmp cache. This may be useful if a file is compared so quickly -- stage: needs patch - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18149 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17860] subprocess docs lack info how to use output result
Serhiy Storchaka added the comment: LGTM. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17010] Windows launcher ignores active virtual environment
Vinay Sajip added the comment: Recent changes to the launcher mean that for a shebang line of #!/usr/bin/env python, the path is searched for a Python executable. This will include the Python executable in an activated venv, so I am closing this issue. The change is already available for testing in the standalone launcher at https://bitbucket.org/pypa/pylauncher/downloads/ and should be incorporated into the launcher released with Python 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17010 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17010] Windows launcher ignores active virtual environment
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17010 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18048] Merging test_pep263.py and test_coding.py
Roundup Robot added the comment: New changeset 00a199c265c3 by Serhiy Storchaka in branch 'default': Issue #18048: Rename test_pep263.py to test_source_encoding.py. http://hg.python.org/cpython/rev/00a199c265c3 New changeset 3b906421245d by Serhiy Storchaka in branch 'default': Issue #18048: Rename test_coding.py to test_source_encoding.py. http://hg.python.org/cpython/rev/3b906421245d New changeset 464e8fd7300d by Serhiy Storchaka in branch 'default': Issue #18048: Merge test_pep263.py and test_coding.py into test_source_encoding.py. http://hg.python.org/cpython/rev/464e8fd7300d -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18048] Merging test_pep263.py and test_coding.py
Serhiy Storchaka added the comment: Merging itself is trivial. The trick is how preserve the history of both files. Unfortunately this can't be represented in one mercurial patch. Three commits needed for this. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17010] Windows launcher ignores active virtual environment
Piotr Dobrogost added the comment: @Vinay Is there any discussion which lead to this change? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17010 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18202] Minor fixes for test_coding
New submission from Serhiy Storchaka: Here is a patch which contains followed changes: * Use bytes in test_exec_valid_coding(). Encoding instruction is ignored in strings. * Use non-ascii data in test_exec_valid_coding() to check that encoding is working. * Use explicit file encoding in test_file_parse(). * Use with statement for file in test_file_parse(). * Modify sys.path after opening file in test_file_parse() and restore before other cleanups. * Cleanup '.pyo' file in test_file_parse(). Test can ran in optimized mode. * Add msg parameter for better failure reporting in test_error_from_string(). * Use unittest.main(). -- components: Tests files: test_coding.patch keywords: patch messages: 191066 nosy: lemburg, loewis, nnorwitz, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Minor fixes for test_coding type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30569/test_coding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18202 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18202] Minor fixes for test_coding
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file30569/test_coding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18202 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18202] Minor fixes for test_coding
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file30570/test_coding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18202 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution
Mark Levitt added the comment: Cool. I've gone ahead and generated a new patch with the version added directive included. -- Added file: http://bugs.python.org/file30571/18149-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18149 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17010] Windows launcher ignores active virtual environment
Vinay Sajip added the comment: Is there any discussion which lead to this change? http://mail.python.org/pipermail/python-dev/2013-May/125939.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17010 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18179] SMTP.local_hostname is undocumented
Changes by Berker Peksag berker.pek...@gmail.com: -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file30572/issue18179.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18179 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17860] subprocess docs lack info how to use output result
Changes by Ronald Oussoren ronaldousso...@mac.com: -- assignee: docs@python - ronaldoussoren stage: needs patch - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13238] Add shell command helpers to subprocess module
Paul Moore added the comment: There's also https://pypi.python.org/pypi/sarge One other thing I *often* want to do when scripting commands is to capture output, but provide some form of progress reporting (something like a dot per line of output, usually). That's annoyingly verbose with subprocess. -- nosy: +pmoore ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13238 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18193] Move imp.reload() to importlib
Berker Peksag added the comment: Here's a patch. Changes: - Used types.ModuleType instead of type(sys) - Updated imp and importlib docs - Moved test_imp.ReloadTests to test_importlib.test_api.ReloadTests -- keywords: +patch nosy: +berker.peksag stage: test needed - patch review Added file: http://bugs.python.org/file30573/issue18193.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18193 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8402] Add a function to escape metacharacters in glob/fnmatch
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8402 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe
Xavier de Gaye added the comment: Attached are two test cases for this patch. test_simple_producer still fails with the new patch because it should be: self.producer_fifo.extendleft([first, data]) instead of: self.producer_fifo.appendleft([data, first]) The order of the items in the list is reversed, as documented in deque.extendleft. So the attachment also includes the corrected patch with this single change. I still think that if num_sent == 0, then 'first' should be put back in the queue. This means that initiate_send should not attempt anymore to send an empty string, which is confusing anyway, and therefore at the beginning of initiate_send, when 'if not first', then we should return in all cases and not only when 'first' is None. -- Added file: http://bugs.python.org/file30574/cpython.asyncore_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17925 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17860] subprocess docs lack info how to use output result
anatoly techtonik added the comment: On Thu, Jun 13, 2013 at 9:20 AM, Ezio Melotti rep...@bugs.python.orgwrote: Also in the Python 3 docs we don't compare the current behavior with Python 2. That's most unfortunate. Major PITA comes from attempts to port existing code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17860] subprocess docs lack info how to use output result
anatoly techtonik added the comment: _failed_ attempts to port existing code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3329] API for setting the memory allocator used by Python
STINNER Victor added the comment: This patch does not propose a simple API to reuse internal debug hooks when replacing system (PyMem) allocators. Ok, this is now fixed with new patch (version 5). Nick does not want a new environment variable, so I added instead a new function PyMem_SetupDebugHooks() which reinstalls hooks to detect bugs if allocator functions were replaced with PyMem_SetAllocators() or PyObject_SetAllocators(). The function does nothing is Python is not compiled in debug more or if hooks are already installed (so the function can be called twice). I also added unit tests for PyMem_SetAllocators() and PyObject_SetAllocators()! And I added versionadded:: 3.4 to the C API documentation. -- Added file: http://bugs.python.org/file30575/py_setallocators-5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3329 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe
Andrew Stormont added the comment: I think you mean: self.producer_fifo.extendleft([data, first]) Instead of: self.producer_fifo.extendleft([first, data]) No? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17925 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18203] Replace calls to malloc() with PyMem_Malloc()
New submission from STINNER Victor: The issue #3329 proposes an API to replace memory allocator functions. But Python calls directly malloc(), realloc() and free() in some functions, so custom allocators would not be used there. Examples of functions calling malloc/realloc/free directly: _PySequence_BytesToCharpArray(), block_new() (of pyarena.c), find_key() (of thread.c), PyInterpreterState_New(), win32_wchdir(), posix_getcwd(), Py_Main(), etc. We have to be careful with the GIL: PyMem_*() functions can only be called when holding the GIL. -- messages: 191076 nosy: amaury.forgeotdarc, haypo, kristjan.jonsson, ncoghlan priority: normal severity: normal status: open title: Replace calls to malloc() with PyMem_Malloc() type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18203 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3329] API for setting the memory allocator used by Python
STINNER Victor added the comment: To be exhaustive, another patch should be developed to replace all calls for malloc/realloc/free by PyMem_Malloc/PyMem_Realloc/PyMem_Free. I created issue #18203 for this point. PyObject_Malloc() is still using mmap() or malloc() internally for example. Arena allocator can be replaced or hooked with PyObject_SetArenaAllocators() of my lastest patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3329 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18203] Replace calls to malloc() with PyMem_Malloc()
Serhiy Storchaka added the comment: Be aware about external code which allocate memory itself (i.e. expat). -- nosy: +serhiy.storchaka stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18203 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17860] subprocess docs lack info how to use output result
Amaury Forgeot d'Arc added the comment: Surely there are already good places to help with 2-3 transition? The Library Reference is not such a place. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17860 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18203] Replace calls to malloc() with PyMem_Malloc()
STINNER Victor added the comment: Be aware about external code which allocate memory itself (i.e. expat). Well, I know that it will hard to cover 100% of the stdlib. I just want to replace the most obvious calls. Some libraries can be configured to use a custom memory allocators: - zlib: zalloc and zfree, http://www.zlib.net/manual.html#Usage - bz2 - lzma: LzmaEnc_Create parameter - OpenSSL: CRYPTO_set_mem_functions - etc. We should probably uses these functions to reuse Python allocators (PyMem_Malloc()), or maybe only if PyMem_SetAllocators() has been called? (if Python does not use system allocators, aka malloc) See also #18178 for libffi, it may be related. The _decimal module configures libmpdec to use PyMem_Malloc: #define _Py_DEC_MINALLOC 4 mpd_mallocfunc = PyMem_Malloc; mpd_reallocfunc = PyMem_Realloc; mpd_callocfunc = mpd_callocfunc_em; mpd_free = PyMem_Free; mpd_setminalloc(_Py_DEC_MINALLOC); -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18203 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10581] Review and document string format accepted in numeric data type constructors
Nick Coghlan added the comment: I think PEP 393 gives us a quick way to fast parsing: if the max char is 128, just roll straight into normal processing, otherwise do the normalisation and all decimal digits are from the same script steps. There are almost certainly better ways to do the script translation, but the example below tries to just do the convert to ASCII step to avoid duplicating the +/- and decimal point processing logic: if max_char(arg) = 128: arg = toNFKC(arg) originals = set() converted = [] for c in arg: try: d = str(unicodedata.decimal(c)) except ValueError: d = c else: originals.add(c) converted.append(d) if (max(originals) - min(originals)) = 10: raise ValueError(%s mixes digits from multiple scripts % arg) arg = .join(converted) result = parse_ascii_number(arg) P.S. I don't think the base argument is especially applicable ('0x' is rejected because 'x' is not a base 10 digit and we allow a base of '0' to request use int literal base markers). -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10581 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18203] Replace calls to malloc() with PyMem_Malloc()
Christian Heimes added the comment: expat has a XML_Memory_Handling_Suite. You just have to replace XML_ParserCreate() and XML_ParserCreateNS with XML_ParserCreate_MM(). -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18203 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18163] Add a 'key' attribute to KeyError
Mark Dickinson added the comment: +1. I recently chastised a colleague for doing raise KeyError(long_message) instead of raise KeyError(missing_item). When I went to the standard library to support my POV, I found (to my chagrin) a big mix of the two styles. from collections import ChainMap d = ChainMap({}, {}) try: ... d.pop('not there') ... except KeyError as e: ... key, = e.args ... key Key not found in the first mapping: 'not there' -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18163 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18201] distutils write into symlinks instead of replacing them
Éric Araujo added the comment: There are a handful of issues related to symlinks handling in distutils. From the discussion on #15205 , the state of things is that basically distutils has no defined behaviour with respect to symlinks, and it’s not clear to me what the desired behaviour would be. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18201 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18201] distutils write into symlinks instead of replacing them
Michał Górny added the comment: Well, I don't see much relevance between the two bugs, to be honest :). I think this bug is more of a symptom of a deeper issue with the way distutils is installing files. But the issue is causing repeating issues for our users, and I don't really know what is the best way of at least helping our users avoid them. If there were an agreement that this specific behavior of distutils is unintended, we can prepare a patch. I don't really want to diverge from the 'upstream' behavior in Gentoo just to fix our issue, and I don't really see another good way of fixing it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18201 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18203] Replace calls to malloc() with PyMem_Malloc()
Georg Brandl added the comment: We have to be careful with the GIL: PyMem_*() functions can only be called when holding the GIL. Some libraries can be configured to use a custom memory allocators: [...] We should probably uses these functions to reuse Python allocators (PyMem_Malloc()) I think there's a potential problem here :) -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18203 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14044] IncompleteRead error with urllib2 or urllib.request -- fine with urllib, wget, or curl
raylu added the comment: The URL works for me. While wget does download it successfully, I get the following output: $ wget http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx\?Zip_Code\=98199 --2013-06-13 12:15:21-- http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx?Zip_Code=98199 Resolving info.kingcounty.gov (info.kingcounty.gov)... 146.129.240.75 Connecting to info.kingcounty.gov (info.kingcounty.gov)|146.129.240.75|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: ‘XmlRest.aspx?Zip_Code=98199’ [ = ] 515,315 448KB/s in 1.1s 2013-06-13 12:15:23 (448 KB/s) - Read error at byte 515315 (Success).Retrying. --2013-06-13 12:15:24-- (try: 2) http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx?Zip_Code=98199 Connecting to info.kingcounty.gov (info.kingcounty.gov)|146.129.240.75|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: ‘XmlRest.aspx?Zip_Code=98199’ [ =] 0 --.-K/s in 0s Cannot write to ‘XmlRest.aspx?Zip_Code=98199’ (Success). Similarly, curl gives $ curl http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx\?Zip_Code\=98199 /dev/null % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 100 503k0 503k0 0 222k 0 --:--:-- 0:00:02 --:--:-- 229k curl: (18) transfer closed with outstanding read data remaining $ wget --version GNU Wget 1.14 built on linux-gnu. $ curl --version curl 7.30.0 (x86_64-pc-linux-gnu) libcurl/7.30.0 OpenSSL/1.0.1e zlib/1.2.8 libidn/1.25 libssh2/1.4.2 librtmp/2.3 -- nosy: +raylu ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18204] distutils error showing upload error message
New submission from Matt Perry: Distutils attempts r.read() instead of request.read() when showing an upload error message. -- assignee: eric.araujo components: Distutils files: disutils_error_message.diff keywords: patch messages: 191088 nosy: eric.araujo, tarek, unshift priority: normal severity: normal status: open title: distutils error showing upload error message versions: Python 2.7 Added file: http://bugs.python.org/file30576/disutils_error_message.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18204 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold
New submission from STINNER Victor: The callback PyOS_ReadlineFunctionPointer (used to read a line from the standard input) must return a buffer allocated by PyMem_Malloc(), but PyOS_Readline() releases the GIL before calling PyOS_ReadlineFunctionPointer. Simplified extract of PyOS_Readline(): Py_BEGIN_ALLOW_THREADS if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout))) rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt); else rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, prompt); Py_END_ALLOW_THREADS tok_nextc() calls PyOS_Readline() and calls PyMem_FREE() to release its result. PyOS_ReadlineFunctionPointer should allocate memory using malloc(), not using PyMem_Malloc(). But PyOS_Readline() should copy the line into a buffer allocated by PyMem_Malloc() to keep backward compatibility. See also issue #18203 and #3329. -- components: Interpreter Core, Library (Lib) messages: 191089 nosy: haypo priority: normal severity: normal status: open title: PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18205 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold
STINNER Victor added the comment: Here is a patch for Python 3.4. -- keywords: +patch Added file: http://bugs.python.org/file30577/readline_gil.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18205 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold
STINNER Victor added the comment: Oh, this is a duplicate of #16742, read also the thread on python-dev: http://mail.python.org/pipermail/python-dev/2012-December/123225.html -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18205 ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
STINNER Victor added the comment: I just found the readline/GIL issue while working on #18203. I created #18205 but then I found this issue. I just closed #18205 as a duplicate. Here is a patch for Python 3.4. -- Copy of the initial message (msg191089): The callback PyOS_ReadlineFunctionPointer (used to read a line from the standard input) must return a buffer allocated by PyMem_Malloc(), but PyOS_Readline() releases the GIL before calling PyOS_ReadlineFunctionPointer. Simplified extract of PyOS_Readline(): Py_BEGIN_ALLOW_THREADS if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout))) rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt); else rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, prompt); Py_END_ALLOW_THREADS tok_nextc() calls PyOS_Readline() and calls PyMem_FREE() to release its result. PyOS_ReadlineFunctionPointer should allocate memory using malloc(), not using PyMem_Malloc(). But PyOS_Readline() should copy the line into a buffer allocated by PyMem_Malloc() to keep backward compatibility. See also issue #18203 and #3329. -- keywords: +patch nosy: +haypo versions: -Python 3.2 Added file: http://bugs.python.org/file30578/readline_gil.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18203] Replace calls to malloc() with PyMem_Malloc()
STINNER Victor added the comment: We have to be careful with the GIL: PyMem_*() functions can only be called when holding the GIL. (...) I think there's a potential problem here :) I didn't understand the motivation to require the GIL held for PyMem_Malloc(). I searched in the source code history and on the Internet (archives of python-dev). In my opinion, the restiction is motivated by a bug: PyMem_Malloc() calls (indirectly) PyObject_Malloc() in debug mode, and PyObject_Malloc() is not thread-safe. I opened a thread on python-dev to discuss this point. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18203 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold
Changes by STINNER Victor victor.stin...@gmail.com: -- superseder: - PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18205 ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
STINNER Victor added the comment: See the following thread on python-dev, the root problem is that PyMem_Malloc() cannot be called with the GIL held. This is a bug in my opinion, and it should be fixed. http://mail.python.org/pipermail/python-dev/2013-June/126822.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18206] There is no license.html on www.python.org
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18206] There is no license.html on www.python.org
New submission from py.user: [guest@localhost ~]$ python3 Python 3.3.0 (default, Sep 29 2012, 22:07:38) [GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux Type help, copyright, credits or license for more information. license() See http://www.python.org/3.3/license.html 404 answer from webmas...@python.org: Hello, When I use the version of Python distributed by python.org and type license() I get the full license text and not the url. It seems like this might be a change made by Red Hat? Either way, the proper place to discuss issues like this is on the Python bug tracker: http://bugs.python.org/ Feel free to report an issue there and the developers can look at it. This email address is actually for reporting problems with the Python.org website! All the best, Michael Foord in Lib/site.py: [guest@localhost cpython]$ sed -n '453,456p' Lib/site.py builtins.license = _Printer( license, See http://www.python.org/%.3s/license.html; % sys.version, [LICENSE.txt, LICENSE], [os.path.join(here, os.pardir), here, os.curdir]) [guest@localhost cpython]$ -- assignee: docs@python components: Documentation, Library (Lib) messages: 191095 nosy: docs@python, py.user priority: normal severity: normal status: open title: There is no license.html on www.python.org type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18206] There is no license.html on www.python.org
Georg Brandl added the comment: This broke because we now have release 3.3.0 instead of 3.3. But it's easy to add a redirect, which I've done now. In the future, site.py should be fixed to say 3.3.0 or 3.3.X depending on the current bugfix version. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18202] Minor fixes for test_coding
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18202 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3329] API for setting the memory allocator used by Python
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3329 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18206] license url in site.py should always use X.Y.Z form of version number
R. David Murray added the comment: For anyone who wants to work on this: the license URL is printed if only if the license file can't be found. -- keywords: +easy nosy: +r.david.murray stage: - needs patch title: There is no license.html on www.python.org - license url in site.py should always use X.Y.Z form of version number versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18199] Windows: support path longer than 260 bytes using \\?\ prefix
Changes by STINNER Victor victor.stin...@gmail.com: -- title: No long filename support for Windows - Windows: support path longer than 260 bytes using \\?\ prefix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18199 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18197] insufficient error checking causes crash on windows
STINNER Victor added the comment: Can you explain why fileno() does fail? Do you have an idea of how many open file descriptor do you have? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18197 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8106] SSL session management
Changes by Christian Heimes li...@cheimes.de: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8106 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18207] OpenSSL may ignore seconds in notAfter
New submission from Christian Heimes: I'm doing some testing with old versions of OpenSSL. Some versions like 0.9.8i from 15 Sep 2008 ignore seconds in notAfter field: ./python -m test test_ssl test_hashlib [1/2] test_ssl test test_ssl failed -- Traceback (most recent call last): File /home/heimes/dev/python/cpython/Lib/test/test_ssl.py, line 145, in test_parse_cert self.assertEqual(p['notAfter'], 'Oct 5 23:01:56 2020 GMT') AssertionError: 'Oct 5 23:01:00 2020 GMT' != 'Oct 5 23:01:56 2020 GMT' - Oct 5 23:01:00 2020 GMT ? ^^ + Oct 5 23:01:56 2020 GMT It's actually an issue in OpenSSL. I'm getting the same result with the openssl binary: $ ../openssl/0.9.8i/bin/openssl x509 -text -in Lib/test/https_svn_python_org_root.pem | grep GMT Not Before: Mar 30 12:29:00 2003 GMT Not After : Mar 29 12:29:00 2033 GMT $ ../openssl/0.9.8y/bin/openssl x509 -text -in Lib/test/https_svn_python_org_root.pem | grep GMT Not Before: Mar 30 12:29:49 2003 GMT Not After : Mar 29 12:29:49 2033 GMT I'd like to modify the test for a well-defined set of errnous OpenSSL versions. -- components: Extension Modules messages: 191099 nosy: christian.heimes, pitrou priority: normal severity: normal status: open title: OpenSSL may ignore seconds in notAfter versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18207 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18200] Update stdlib to use ModuleNotFoundError
Changes by Brett Cannon br...@python.org: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18200] Update stdlib to use ModuleNotFoundError
Roundup Robot added the comment: New changeset 8d28d44f3a9a by Brett Cannon in branch 'default': Issue #18200: Update the stdlib (except tests) to use http://hg.python.org/cpython/rev/8d28d44f3a9a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18200] Update stdlib to use ModuleNotFoundError
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10581] Review and document string format accepted in numeric data type constructors
Alexander Belopolsky added the comment: PEP 393 implementation has already added the fast path to decimal encoding: http://hg.python.org/cpython/diff/8beaa9a37387/Objects/unicodeobject.c#l1.3735 What we can do, however, is improve performance of converting non-ascii numerals by looking up only the first digit's value and converting the rest using simple: value = code - (first_code - first_value) if not 0 = value 10: raise or fall back to UCD lookup -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10581 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1611154] os.path.exists(file/) failure on Solaris 9
A.M. Kuchling added the comment: Here's an updated version of the patch. It at least compiles and runs on MacOS, but I don't have a Solaris installation to check whether it still fixes the problem on Solaris 9. Note that, according to http://en.wikipedia.org/wiki/Solaris_(operating_system)#Version_history, Solaris 9 will only be supported until October 2014. -- keywords: +patch Added file: http://bugs.python.org/file30579/python-stat-patch-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1611154 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com