[issue1322] platform.dist() has unpredictable result under Linux
Marc-Andre Lemburg added the comment: None of the linked patch URLs work anymore. Could someone please upload a current patch to the ticket for review ? As mentioned before, I don't believe that changing the function to first try the lsb-release will result in the same results as what the functions returns now (for the distributions where it gives correct results). Furthermore, the file does not appear to be available on all major platforms. Only the lsb-release binary has become somewhat of a standard, so trying the file first, then the lsb-release binary will in most cases result in spawning a process. As example, on openSUSE 11.4, the lsb-release binary reads the /etc/SuSE-release file and then returns these results: lsb-release -a LSB Version:n/a Distributor ID: SUSE LINUX Description:openSUSE 11.4 (x86_64) Release:11.4 Codename: Celadon Note that taking these results would result in platform.dist() to return ('SUSE LINUX', '11.4', 'x86_64') instead of the current ('SuSE', '11.4', 'x86_64'). Finally, I think after all these years, the whole concept of linux_distribution() has failed due to the distributions using too many different ways of describing themselves. I'd be +1 on deprecating the functionality altogether and remove linux_distribution()/dist() in the long run. The functionality is better left to a package which can be updated more easily on PyPI. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20136] Logging: StreamHandler does not use OS line separator.
New submission from A. Libotean: The StreamHandler implementation uses hardcoded Unix/Linux line separators. This generates inconveniences when running on Windows as the file viewers expect DOS line terminators. I've attached a fix that will use os.linesep as the line terminator thus making the log files usable with Windows utilities. Please revise the fix and consider including it. -- components: Library (Lib) files: streamhandler.py messages: 207416 nosy: alibotean priority: normal severity: normal status: open title: Logging: StreamHandler does not use OS line separator. type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file33321/streamhandler.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20136 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20137] Logging: RotatingFileHandler computes string length instead of byte representation length.
New submission from A. Libotean: Current implementation of RotatingFileHandler ignores the encoding when computing the entry byte length. I've attached a modified version that will compute the entry lenght in bytes. -- components: Library (Lib) files: rotatingfilehandler.py messages: 207417 nosy: alibotean priority: normal severity: normal status: open title: Logging: RotatingFileHandler computes string length instead of byte representation length. type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file33322/rotatingfilehandler.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20137 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode
New submission from Armin Ronacher: I just noticed through looking through someone else's WSGI framework that wsgiref is incorrectly handling URL handling. It does not go through the WSGI coding dance in the wsgiref.utils.request_uri function. Testcase through werkzeug: from wsgiref.util import request_uri from werkzeug.test import create_environ from werkzeug.urls import url_parse, url_unquote env = create_environ('/\N{SNOWMAN}') url_parse(request_uri(env)).path '/%C3%A2%C2%98%C2%83' url_unquote(url_parse(request_uri(env)).path) '/â\x98\x83' _ == '/\N{SNOWMAN}' False If this passes tests then I'm assuming that wsgiref is doing the inverse bug somewhere else. I will look into it later, but this behavior is definitely broken. -- messages: 207418 nosy: aronacher priority: normal severity: normal status: open title: wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19081] zipimport behaves badly when the zip file changes while the process is running
Gregory P. Smith added the comment: attaching a patch for 3.3. up next, 3.4: So long as I get to it before the release candidates the approach can likely be improved for 3.4 to actually hold the zip file we're importing from open for the life of the process instead of doing all of these stat calls. That'd also get rid of the platform specific trick used to get the os.fstat function without being able to import the os module. -- Added file: http://bugs.python.org/file33323/issue19081-33-gps04.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19081] zipimport behaves badly when the zip file changes while the process is running
Changes by Gregory P. Smith g...@krypto.org: Removed file: http://bugs.python.org/file31869/issue19081-gps02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19081] zipimport behaves badly when the zip file changes while the process is running
Changes by Gregory P. Smith g...@krypto.org: Removed file: http://bugs.python.org/file31860/issue19081-gps01.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16074] Bad error message in os.rename, os.link, and os.symlink
Vajrasky Kok added the comment: Jakub Wilk, yeah, I missed that one. Jason Gerard DeRose, thanks for the additional information. Anyway, I already persuaded Ruby developers to specialize the message, although it's only for creating symlink. https://bugs.ruby-lang.org/issues/9263 As of Python, let's leave that for Python 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16074 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1322] platform.dist() has unpredictable result under Linux
Marc-Andre Lemburg added the comment: Another example on openSUSE 12.3: # lsb-release -a LSB Version:n/a Distributor ID: openSUSE project Description:openSUSE 12.3 (x86_64) Release:12.3 Codename: Dartmouth This would result in ('openSUSE project', '11.4', 'x86_64'). I don't think such distribution name changes are useful in practice. The existing linux_distribution() code always returns 'SuSE' for these (and likewise for other distributions). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1322] platform.dist() has unpredictable result under Linux
Matthias Klose added the comment: sure, then please let's deprecate that for 3.4, and remove in 3.5. /etc/os-release introduce the next set of different names. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20139] Python installer does not install a pip command (just pip3 and pip3.4)
New submission from Paul Moore: The Python 3.4b2 installer for Windows does not install a pip.exe wrapper when the default options are selected. Only the pip3.exe and pip3.4.exe commands are provided. The documentation for ensurepip makes it clear that this is the default behaviour, but there is no comment in either the PEP or in Python Setup and Usage stating that this is what happens. Also, I imagine that people will expect a pip command to be available by default, so an explanation of *why* only the versioned commands are installed should be added. (It may be that having the unversioned command as well is actually the correct thing to do, on Windows if not on Unix - I can't recall the details of the discussion. If so, maybe the correct thing to do is to change the Windows installer behaviour). -- assignee: dstufft components: Documentation messages: 207423 nosy: dstufft, ncoghlan, pmoore priority: normal severity: normal status: open title: Python installer does not install a pip command (just pip3 and pip3.4) type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20139 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20140] UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs
New submission from Jarek Śmiejczak: Full traceback: https://gist.github.com/jarekps/2729ee1917ea372e6642 Error's starts in pip but after investigation of traceback it looks like it is python's issue (version 2.7.5). Windows version: 8.1 Enterprise x64 with Polish language pack. Feel free to ask if any additional information is necessary. -- components: Windows messages: 207424 nosy: Jarek.Śmiejczak priority: normal severity: normal status: open title: UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs type: crash versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20140 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20140] UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs
STINNER Victor added the comment: https://gist.github.com/jarekps/2729ee1917ea372e6642 Copy of the output: --- C:\Users\Jarosławpip Traceback (most recent call last): File c:\python27\Scripts\pip-script.py, line 9, in module load_entry_point('pip==1.5', 'console_scripts', 'pip')() File c:\python27\lib\site-packages\distribute-0.6.49-py2.7.egg\pkg_resources.py, line 345, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File c:\python27\lib\site-packages\distribute-0.6.49-py2.7.egg\pkg_resources.py, line 2381, in load_entry_point return ep.load() File c:\python27\lib\site-packages\distribute-0.6.49-py2.7.egg\pkg_resources.py, line 2087, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File c:\python27\lib\site-packages\pip\__init__.py, line 11, in module from pip.vcs import git, mercurial, subversion, bazaar # noqa File c:\python27\lib\site-packages\pip\vcs\subversion.py, line 4, in module from pip.index import Link File c:\python27\lib\site-packages\pip\index.py, line 16, in module from pip.wheel import Wheel, wheel_ext, wheel_setuptools_support File c:\python27\lib\site-packages\pip\wheel.py, line 23, in module from pip._vendor.distlib.scripts import ScriptMaker File c:\python27\lib\site-packages\pip\_vendor\distlib\scripts.py, line 15, in module from .resources import finder File c:\python27\lib\site-packages\pip\_vendor\distlib\resources.py, line 105, in module cache = Cache() File c:\python27\lib\site-packages\pip\_vendor\distlib\resources.py, line 40, in __init__ base = os.path.join(get_cache_base(), 'resource-cache') File c:\python27\lib\ntpath.py, line 108, in join path += \\ + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 14: ordinal not in range(128) --- It looks like a bug in distlib.resources, not in Python. os.path.join() works correctly if all arguments are bytes strings (str type). I should work if all arguments are Unicode strings only containing ASCII characters. (I don't know if it works if all aruments are Unicode strings.) In your case, it looks like os.path.join() is called with a unicode and a bytes string. -- nosy: +haypo, ncoghlan, vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20140 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode
Changes by Graham Dumpleton graham.dumple...@gmail.com: -- nosy: +grahamd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1322] platform.dist() has unpredictable result under Linux
Vajrasky Kok added the comment: Here is the patch to deprecate platform.dist and platform.linux_distribution. -- nosy: +vajrasky Added file: http://bugs.python.org/file33324/deprecate_platform_dist.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1322] platform.dist() has unpredictable result under Linux
Marc-Andre Lemburg added the comment: On 06.01.2014 11:53, Vajrasky Kok wrote: Here is the patch to deprecate platform.dist and platform.linux_distribution. -- nosy: +vajrasky Added file: http://bugs.python.org/file33324/deprecate_platform_dist.patch Thanks. I think we'll need to do this in three steps: 1. pending deprecation in 3.4 2. deprecation in 3.5 3. removal in 3.6 Please also add a note to these steps to the warning text and a deprecation notice to the documentation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20139] Python installer does not install a pip command (just pip3 and pip3.4)
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20139 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20140] UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs
Vinay Sajip added the comment: It's not failing specifically because of distlib or os.path.join functionality: it's failing because, given a Unicode path C:\Users\Jarosław\..., Python is attempting to decode it using the default, ASCII codec. I'll certainly look at updating distlib to handle this case, but the same problem could bite the user in other areas. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20140 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode
Changes by Florian Apolloner flor...@apolloner.eu: -- nosy: +apollo13 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20140] UnicodeDecodeError in ntpath.py when home dir contains non-ascii signs
Vinay Sajip added the comment: Jarek: I can't easily test this in my environment; perhaps you can help. Could you change, in the file c:\python27\lib\site-packages\pip\_vendor\distlib\resources.py, line 40 from base = os.path.join(get_cache_base(), 'resource-cache') to base = os.path.join(get_cache_base(), str('resource-cache')) to see if that resolves the problem? Currently, 'resource-cache' is a Unicode string (because of from __future__ import unicode_literals in the containing module) and that causes Python to try and convert the get_cache_base() result to Unicode using ASCII, which leads to the failure. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20140 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19081] zipimport behaves badly when the zip file changes while the process is running
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20141] Argument Clinic: broken support for 'O!'
New submission from Serhiy Storchaka: First, the documentation says that syntax for 'O!' conversion is object(type='name_of_Python_type'), but actually the type argument should be the name of C structure which represents Python type. I.e. object(type='list') is rejected, and object(type='PyList_Type') is accepted. Second, from this declaration /*[clinic] module spam spam.ham items: object(type='PyList_Type') / [clinic]*/ Argument Clinic generates following parsing code: if (!PyArg_ParseTuple(args, O!:ham, PyList_Type, items)) goto exit; It is wrong, should be PyList_Type. -- assignee: docs@python components: Build, Documentation messages: 207430 nosy: docs@python, larry, serhiy.storchaka priority: release blocker severity: normal status: open title: Argument Clinic: broken support for 'O!' type: crash versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20141] Argument Clinic: broken support for 'O!'
Larry Hastings added the comment: So a documentation error and having to manually specify at the front of your string means it's broken? Nevertheless, I'll take a look at it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20141] Argument Clinic: broken support for 'O!'
Serhiy Storchaka added the comment: You can't manually specify at the front of the name. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20141] Argument Clinic: broken support for 'O!'
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file33325/spammodule.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20142] Argument Clinic: Py_buffer parameters are not initialized
New submission from Serhiy Storchaka: Argument Clinic doesn't initialize Py_buffer parameters. It generates cleanup code: /* Cleanup for data */ if (data.buf) PyBuffer_Release(data); And if PyArg_ParseTuple() is failed, the buf attribute can contains arbitrary (non-NULL) data. This causes crash in PyBuffer_Release(). See issue20133 for working example. -- components: Build files: spammodule.c messages: 207433 nosy: larry, serhiy.storchaka priority: release blocker severity: normal status: open title: Argument Clinic: Py_buffer parameters are not initialized type: crash versions: Python 3.4 Added file: http://bugs.python.org/file33326/spammodule.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20142 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20143] Argument Clinic: negative line numbers
New submission from Serhiy Storchaka: In case of error Argument Clinic sometimes reports negative line numbers. -- messages: 207434 nosy: larry, serhiy.storchaka priority: normal severity: normal status: open title: Argument Clinic: negative line numbers type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20143 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
New submission from Serhiy Storchaka: For example it doesn't support PY_SSIZE_T_MAX as default value for Py_ssize_t argument. Is there any way to specify it? This is required for converting the _sre module. -- components: Build messages: 207435 nosy: larry, serhiy.storchaka priority: normal severity: normal status: open title: Argument Clinic doesn't support named constants as default values versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20145] unittest.assert*Regex functions should verify that expected_regex has a valid type
New submission from the mulhern: A normal thing for a developer to do is to convert a use of an assert* function to a use of an assert*Regex function and foolishly forget to actually specify the expected regular expression. If they do this, the test will always pass because the callable expression will be in the place of the expected regular expression and the callable expression will, therefore, be None. It would be nice if in the constructor in AssertRaisesBaseContext (for 3.5) not only was the expected regex converted to a regex (if actually a string or bytes) but if it's not if it were checked if it were a valid regular expression object and an exception raised if this is not the case. In the current version of AssertRaisesBaseContext.handle the comments say that if the callable object is None then the function is being used as a context manager. Not always the case, alas, perhaps the developer just forgot to add that necessary regular expression before the callable object. -- messages: 207436 nosy: the.mulhern priority: normal severity: normal status: open title: unittest.assert*Regex functions should verify that expected_regex has a valid type type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20139] Python installer does not install a pip command (just pip3 and pip3.4)
Nick Coghlan added the comment: This is deliberate - the unversioned command is only installed into virtual environments. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20139 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20139] Python installer does not install a pip command (just pip3 and pip3.4)
Paul Moore added the comment: Fair enough. Can the justification be recorded somewhere, please? It's inconsistent with most other Python commands on Windows. (I don't recall what the justification was, and can't come up with a search that locates the discussion thread). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20139 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20139] Python installer does not install a pip command (just pip3 and pip3.4)
Paul Moore added the comment: It would not be impossible for the ensurepip call in the Windows installer to set the --default-pip flag, if that gives a better user experience on Windows. I'm not wedded to either answer myself, but given that versioned executable names are uncommon on Windows, I can easily imagine a series of bug reports saying I asked for pip to be installed, and it's not there. Making a deliberate decision one way or the other and documenting it seems like the minimum reasonable approach. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20139 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20146] UserDict module docs link is obsolete
New submission from Alexandru Gheorghe: FILE /usr/lib/python2.7/UserDict.py MODULE DOCS http://docs.python.org/library/UserDict Reference link to online documentation is invalid. (Probably) Should be: http://docs.python.org/library/userdict.html Happens on Debian 7 Wheezy x86_64: Python 2.7.3 , [GCC 4.7.2] on linux2 -- assignee: docs@python components: Documentation messages: 207441 nosy: docs@python, drunax priority: normal severity: normal status: open title: UserDict module docs link is obsolete type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20146 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20139] Python installer does not install a pip command (just pip3 and pip3.4)
Nick Coghlan added the comment: I'm not sure we specifically considered the Windows case - we were avoiding the name collision with pip for Python 2 on POSIX systems. The decision on which names to install is actually made in pip itself, though, ensurepip just indicates what kind of install it is. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20139 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20147] multiprocessing.Queue.get() raises queue.Empty exception if even if an item is available
Changes by Torsten Landschoff t.landsch...@gmx.net: Added file: http://bugs.python.org/file33328/queue_timeout_1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20147 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: Here's the problem. Let's say I gave you a way of specifying a symbolic constant for the default value for C. What value should we use for the default value in Python? Keep in mind, it has to be expressed as a static value that can be stored as a string as part of the __text_signature__ at the front of the docstring. If you can answer that question, we can solve the problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import
Daniel Holth added the comment: Thanks. I guess I know who to ask now. It was just painful seeing so much import-time computation, pretty much guaranteed to happen every time Python starts up, being wasted on a feature that is rarely used. On the Raspberry Pi the majority of the import time is spent building this table and the speed difference is noticeable. On Mon, Jan 6, 2014, at 10:22 AM, Larry Hastings wrote: Larry Hastings added the comment: Since this isn't a bugfix, it was inappropriate to check this in after feature-freeze for 3.4. However it looks harmless enough, so I'm not asking you to revert it at this time. I guess it's easier to get forgiveness than permission, huh. -- nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18515 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18515 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20137] Logging: RotatingFileHandler computes string length instead of byte representation length.
R. David Murray added the comment: Could you please upload your proposed fix as a patch file (universal diff)? -- nosy: +r.david.murray, vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20137 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import
Larry Hastings added the comment: Since this isn't a bugfix, it was inappropriate to check this in after feature-freeze for 3.4. However it looks harmless enough, so I'm not asking you to revert it at this time. I guess it's easier to get forgiveness than permission, huh. -- nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18515 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20147] multiprocessing.Queue.get() raises queue.Empty exception if even if an item is available
New submission from Torsten Landschoff: The behaviour of multiprocessing.Queue surprised me today in that Queue.get() may raise an exception even if an item is immediately available. I tried to flush entries without blocking by using the timeout=0 keyword argument: $ /opt/python3/bin/python3 Python 3.4.0b1 (default:247f12fecf2b, Jan 6 2014, 14:50:23) [GCC 4.6.3] on linux Type help, copyright, credits or license for more information. from multiprocessing import Queue q = Queue() q.put(hi) q.get(timeout=0) Traceback (most recent call last): File stdin, line 1, in module File /opt/python3/lib/python3.4/multiprocessing/queues.py, line 107, in get raise Empty queue.Empty Actually even passing a small non-zero timeout will not give me my queue entry: q.get(timeout=1e-6) Traceback (most recent call last): File stdin, line 1, in module File /home/torsten/opensrc/cpython/Lib/multiprocessing/queues.py, line 107, in get raise Empty queue.Empty Expected behaviour for me would be to return the item that is in the queue. I know that there is a kwarg *block* which gives me the desired behaviour: q.get(block=False) 'hi' In my case the get call is embedded in my own module which does not currently expose the block parameter. My local solution is of course to update the wrapper: if timeout == 0: timeout = None block = False However I see a few smells here in the python standard library. First, everything else seems to accept timeout=0 as nonblocking: import threading lock = threading.Lock() lock.acquire(timeout=0) True from queue import Queue q = Queue() q.put(hi) q.get(timeout=0) 'hi' Of special note is that queue.Queue behaves as I would have expected. IMHO it should be consistent with multiprocessing.Queue. Also note that queue.Queue.get() and queue.Queue.put() name their blocking flag block, while everybody else uses blocking. As a side note, I think the current approach is flawed in computing the deadline. Basically it does the following: deadline = time.time() + timeout if not self._rlock.acquire(block, timeout): raise Empty timeout = deadline - time.time() if timeout 0 or not self._poll(timeout): raise Empty On my system, just taking the time twice and computing the delta takes 2 microseconds: import time t0 = time.time(); time.time() - t0 2.384185791015625e-06 Therefore calling Queue.get(block, timeout) with 0 timeout 2e-6 will never return anything from the queue even though Queue.get(block=False) would do that. This contradicts the idea that Queue.get(block=False) will return faster than with block=True with any timeout 0. Apart from that, as Python does not currently support waiting on multiple sources, we currently often check a queue with a small timeout concurrently with doing other stuff. In case the system get really loaded, I would expect this to cause problems because the updated timeout may fall below zero. Suggested patch attached. -- components: Library (Lib) files: queue_timeout_0.diff keywords: patch messages: 207443 nosy: torsten priority: normal severity: normal status: open title: multiprocessing.Queue.get() raises queue.Empty exception if even if an item is available type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file33327/queue_timeout_0.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20147 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: As an example, consider pattern_match() in _sre.c. This implements the match method on a pattern object; in other words, re.compile().match(). The third parameter, endpos, defaults to PY_SSIZE_T_MAX in C. What should inspect.Signature() report as the default value for endpos? We can't look up the proper value for PY_SSIZE_T_MAX, because the default value inspect.Signature() uses was written out as text when Argument Clinic processed the function. As a hint, the documentation for match() dodges this problem by outright lying. It claims that the prototype for the function is: match(string[, pos[, endpos]]) which is a lie. pattern_match() parses its arguments by calling PyArg_ParseTupleAndKeywords() with a format string of O|nn. which means, for example, you could call: match(abc, endpos=5) The documentation claims this is invalid but it works fine. In other words, it's a sticky problem, and the people who had it before us didn't try to solve it properly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Convert the _sre module to use Argument Clinic
New submission from Serhiy Storchaka: Here is preliminary patch which converts the _sre module to use Argument Clinic. 22 functions are converted. There are thre problems: * Issue20141. The code was manually edited after Argument Clinic (and should be edited again for next run of Argument Clinic). * Issue20144. Literal 10 is temporary used instead of PY_SSIZE_T_MAX. * Pydoc for _sre.compile (and only for this function) returns: _sre.compile = built-in function compile -- components: Extension Modules, Regular Expressions messages: 207448 nosy: ezio.melotti, larry, mrabarnett, serhiy.storchaka priority: normal severity: normal status: open title: Convert the _sre module to use Argument Clinic type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Convert the _sre module to use Argument Clinic
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file33329/sre_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Serhiy Storchaka added the comment: Not always default value can be expressed in Python. Current docstring for the match() method says match(string[, pos[, endpos]]). For this particular case it can be written as match(string, pos=0, endpos=sys.maxsize). And this is very common case (see also str.find(sub[, start[, end]]), etc). Perhaps there are cases in which the default value is not PY_SSIZE_T_MAX and None is not accepted (as for dir_fd parameter in os functions). So as minimum Argument Clinic can support sys.maxsize, and as maximum, it should support arbitrary values. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Convert the _sre module to use Argument Clinic
Serhiy Storchaka added the comment: Maybe we could use a better literal value? Like 2**31 - 1? This only a placeholder. It will be replaced by named constant in final patch. 2**31 - 1 is not better here than any other arbitrary value. I don't understand the pydoc thing. Can you elaborate? Pydoc for _sre.compile doesn't output signature and docstring, but only mentioned above line. There is similar issue in audioop module (issue20133) for the ratecv function. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20136] Logging: StreamHandler does not use OS line separator.
R. David Murray added the comment: The IO system should automatically take care of the linesep conversion when writing to a text stream. Are you sure you specified that the output was a text file? -- nosy: +r.david.murray, vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20136 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: sys.maxsize won't work. inspect.Signature parses the __text_signature__ using ast.parse, and it only recognizes constant values and named constants (True/False/None) for the default value for parameters. Playing with ast, it looks like we'd have to support a tree of Attribute nodes, then look up sys (or whatever) and recursively getattr on it. Which would be new code. Anyway it seems like a bad idea: import inspect import re import sys sys.maxsize = 3 inspect.signature(re.compile(.*).match) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Serhiy Storchaka added the comment: Then perhaps these methods can not be converted to use Argument Clinic now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20141] Argument Clinic: broken support for 'O!'
Larry Hastings added the comment: Actually, the documentation (the howto) states: Note that object() must explicitly support each Python type you specify for the type argument. Currently it only supports str. It should be easy to add more, just edit Tools/clinic/clinic.py, search for O! in the text, and add more entries to the dict mapping types to strings just above it. Maybe this is a bad API. But it's not broken. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20141 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Convert the _sre module to use Argument Clinic
Larry Hastings added the comment: Obviously we can't live with manually editing the output from Argument Clinic, so I'll get you a fix for O! today. Maybe we could use a better literal value? Like 2**31 - 1? I don't understand the pydoc thing. Can you elaborate? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20142] Argument Clinic: Py_buffer parameters are not initialized
Larry Hastings added the comment: Here's a patch, please review. You can see how Py_buffer variables are initialized in zlibmodule.c in the patch. -- Added file: http://bugs.python.org/file0/larry.clinic.py_buffer.initialization.patch.1.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20142 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Convert the _sre module to use Argument Clinic
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +Argument Clinic doesn't support named constants as default values, Argument Clinic: broken support for 'O!' ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20133] Convert the audioop module to use Argument Clinic
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +Argument Clinic: Py_buffer parameters are not initialized ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20133 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20149] 'with instance' references class's __enter__ attribute rather than instance's
New submission from Daniel Grace: I was writing code for a class that uses one threading.RLock per object. For convenience, I wanted to be able to use that lock's context manager and acquire/release methods without referencing the lock directly, so I opted to take a shortcut by assigning self.__enter__ = self.lock.__enter__ and so forth. This fails in Python 3.3.1 (self-compiled on Debian) and both 3.3.2+ and 2.7.5+ (currently available Ubuntu packages). Judging by the error messages, it looks 'with' is examining the __enter__ and __exit__ attributes defined on the instance's class, rather than those defined on the instance itself. The workaround here is simple enough, but I'm under the impression that it shouldn't be needed anyways. Test case follows: import threading class Foo(object): # Uncommenting these yields NoneType is not callable rather than an AttributeError # __enter__ = None # __exit__ = None # acquire = None # release = None # lock = None def __init__(self): self.lock = threading.RLock() print(repr(self.lock)) self.__enter__ = self.lock.__enter__ self.__exit__ = self.lock.__exit__ self.acquire = self.lock.acquire self.release = self.lock.release foo = Foo() # These all function as expected. The fourth line fails (correctly) on 2.7.5. print(repr(foo.__enter__)) print(repr(foo.__exit__)) print(foo.__enter__()) print(foo.__exit__()) # This does not with foo: pass -- components: Interpreter Core messages: 207457 nosy: dewin priority: normal severity: normal status: open title: 'with instance' references class's __enter__ attribute rather than instance's type: behavior versions: Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20149 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19081] zipimport behaves badly when the zip file changes while the process is running
Roundup Robot added the comment: New changeset 8dbf8edb7128 by Gregory P. Smith in branch '2.7': Fixes issue19081: When a zipimport .zip file in sys.path being imported http://hg.python.org/cpython/rev/8dbf8edb7128 New changeset 90a99059aa36 by Gregory P. Smith in branch '2.7': news entry for issue19081 fix. http://hg.python.org/cpython/rev/90a99059aa36 New changeset cbeb22969da1 by Gregory P. Smith in branch '2.7': normalize whitespace from prior issue19081 fix commit. http://hg.python.org/cpython/rev/cbeb22969da1 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20150] API breakage in string formatting with :s option
New submission from Thomas Robitaille: The following code: {0:s}.format([1,2,3]) no longer works in Python 3.4b1, and gives the following exception: {0:s}.format([1,2,3]) Traceback (most recent call last): File stdin, line 1, in module TypeError: non-empty format string passed to object.__format__ This worked previously in Python 2.6-3.3: {0:s}.format([1,2,3]) '[1, 2, 3]' If this is a deliberate change, it should be included in the 'What's new in Python 3.4' -- components: Interpreter Core messages: 207459 nosy: Thomas.Robitaille priority: normal severity: normal status: open title: API breakage in string formatting with :s option versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20150 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20142] Argument Clinic: Py_buffer parameters are not initialized
Serhiy Storchaka added the comment: LGTM. But is not {NULL} enough for Py_buffer initialization? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20142 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20150] API breakage in string formatting with :s option
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +eric.smith, ezio.melotti, larry type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20150 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20142] Argument Clinic: Py_buffer parameters are not initialized
Serhiy Storchaka added the comment: Or perhaps we should introduce macros Py_buffer_INIT. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20142 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19081] zipimport behaves badly when the zip file changes while the process is running
Gregory P. Smith added the comment: The Windows 7 buildbot is unhappy after that change and failing one of the new tests: ERROR: testZipFileChangesAfterFirstImport (test.test_zipimport.ZipFileModifiedAfterImportTestCase) Alter the zip file after caching its index and try an import. -- Traceback (most recent call last): File C:\buildbot.python.org\2.7.kloth-win64\build\lib\test\test_zipimport.py, line 446, in testZipFileChangesAfterFirstImport ziptest_a = __import__(ziptest_a, globals(), locals(), [test_value]) ZipImportError: bad local file header in C:\buildbot.python.org\2.7.kloth-win64\build\build\test_python_4388\junk95142.zip It sounds like it was unable to find or properly use an fstat function. I'll fix it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: Attached is an example of how we could support simple named constants in __text_signature__. The change to posixmodule.c is just a hack to exercise the code in inspect.Signature; I didn't have a good example handy. When I apply the patch and run x.py, I see: (path, *, dir_fd=None, follow_symlinks=True, fake=9223372036854775807) This patch is just an example; I don't propose to check it in in this state. (We'd still need to modify Argument Clinic to support these named constants, too.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20150] API breakage in string formatting with :s option
Eric V. Smith added the comment: See issue 7994 and issue 9856. This behavior has been deprecated for a while, and is now an error. -- assignee: - eric.smith resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20150 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20150] API change in string formatting with :s option should be documented in What's New.
Eric V. Smith added the comment: Oops, I missed the should be documented part of your message. That's true, and I'll leave this open. But I'll change it to a doc request and assign it accordingly. -- assignee: eric.smith - docs@python components: +Documentation -Interpreter Core nosy: +docs@python resolution: invalid - status: closed - open title: API breakage in string formatting with :s option - API change in string formatting with :s option should be documented in What's New. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20150 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20142] Argument Clinic: Py_buffer parameters are not initialized
Changes by Larry Hastings la...@hastings.org: -- assignee: - larry resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20142 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20142] Argument Clinic: Py_buffer parameters are not initialized
Roundup Robot added the comment: New changeset 16ff19d1d367 by Larry Hastings in branch 'default': Issue #20142: Py_buffer variables generated by Argument Clinic are now http://hg.python.org/cpython/rev/16ff19d1d367 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20142 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: Whoops, forgot to attach the file. here it is. -- Added file: http://bugs.python.org/file1/larry.simple.named.constants.in.text.signature.example ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20143] Argument Clinic: negative line numbers
Larry Hastings added the comment: I've seen the problem before, but was too busy to fix it. Give me a reproducable test case and I'll fix it. -- assignee: - larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20143 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20143] Argument Clinic: negative line numbers
Larry Hastings added the comment: Oh, golly, this was one of those what was I thinking? sorts of bugs. The problem (and the fix) was obvious once I stared at it long enough. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20143 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20143] Argument Clinic: negative line numbers
Roundup Robot added the comment: New changeset 9c8d31d69044 by Larry Hastings in branch 'default': Issue #20143: The line numbers reported in Argument Clinic errors are http://hg.python.org/cpython/rev/9c8d31d69044 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20143 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Barry A. Warsaw added the comment: It seems a little unfortunate that you lose the symbolic default, especially since the expanded number just appears random. print(inspect.signature(os.stat)) (path, *, dir_fd=None, follow_symlinks=True, fake=9223372036854775807) sys.maxsize 9223372036854775807 -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20151] Convert the binascii module to use Argument Clinic
New submission from Serhiy Storchaka: Here is a patch which converts the binascii module to use Argument Clinic. 14 functions are converted. There is one known issue. Pydoc doesn't show signature and docstring for several functions: a2b_qp, b2a_qp, crc32. -- components: Extension Modules files: binascii_clinic.patch keywords: patch messages: 207473 nosy: larry, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Convert the binascii module to use Argument Clinic type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file2/binascii_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20151 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20149] 'with instance' references class's __enter__ attribute rather than instance's
R. David Murray added the comment: magic methods like __enter__ and __exit__ are only looked up on the class, not on the instance. This is by design. In some older versions of Python some specific methods (and I think __enter__ and __exit__ were among them for a time) were looked up on the instances, but this was a bug. (Personally I think it would be nice if they were looked up on the instances, but there are good reasons why this is not done.) -- nosy: +r.david.murray resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20149 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20152] Use Argument Clinic with _imp
Changes by Brett Cannon br...@python.org: -- components: +Extension Modules ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20152 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20152] Use Argument Clinic with _imp
New submission from Brett Cannon: Since _imp isn't directly exposed it isn't a priority to do the conversion, but for maintenance and such it should still occur. -- assignee: brett.cannon messages: 207474 nosy: brett.cannon, larry priority: low severity: normal stage: needs patch status: open title: Use Argument Clinic with _imp versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20152 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: It is unfortunate, but on the other hand that's what happens in Python too: import sys import inspect def foo(blah=sys.maxsize): pass ... str(inspect.signature(foo)) '(blah=9223372036854775807)' Nick proposed something we could use to fix these (I think he called them named constants) but it's not in the language yet. Anyway propagating those all the way from Argument Clinic to inspect.Signature would be tricky. Could you live with this being checked in to 3.4? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Barry A. Warsaw added the comment: On Jan 06, 2014, at 08:23 PM, Larry Hastings wrote: Could you live with this being checked in to 3.4? For sure! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19255] Don't wipe builtins at shutdown
Antoine Pitrou added the comment: Thanks for the patch, Gennadiy. Two comments: 1) I don't think re-doing the whole initialization like that is ok. It's too brutal and may also not work as you want. 2) To validate your changes, you should add a unit test anyway (in test_builtin perhaps). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19255 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19255] Don't wipe builtins at shutdown
Antoine Pitrou added the comment: Also, since such changes are subtle and error-prone, I think it's better to defer until 3.5 now that 3.4b2 has been released. Serhiy, what do you think? -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19255 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: Attached is a patch supporting simple symbolic constants. It works from beginning to end--you specify it in the Argument Clinic input and it shows up in the inspect.Signature and uses the constant in the generated C code. One complication: when using one of these constants, I force you to specify a c_default. Which is now automatically supported on all converters, as is py_default. I converted pattern_match in _sre.c as a sample. I won't check that part of the patch in; it's just to give you an idea of what it looks like for the user. -- Added file: http://bugs.python.org/file3/larry.simple.symbolic.constant.default.values.diff.1.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Guido van Rossum added the comment: I grepped for clinic in the source code and I have a hunch why this confusing: each clinic-generated block has *three* marker comments, each containing [clinic] or [clinic checksum: ...]. TBH I can't always tell on which side of the comment the generated code sits, so I agree it would be nice if there was an additional keyword clearly indicating begin/end. Looking more carefully it seems the pattern is /*[clinic] . . (this seems to be the clinic input) . [clinic]*/ . . (this seems to be generated) . /*[clinic checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709]*/ I expect things would be clearer to the uninitiated if instead they said something like: /*[clinic input] . . . [clinic start generated code]*/ . . . /*[clinic end generated code; checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709]*/ Larry, would that be easy? -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Larry Hastings added the comment: And for Python blocks would you suggest /*[python input] ... [python start generated code]*/ ... /*[python end generated code; checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709]*/ To answer your question: no, it wouldn't be hard. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Guido van Rossum added the comment: Yes. Then I suggest working on a patch before people get too deep into the conversion project. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Serhiy Storchaka added the comment: I proposed contrary approach. Allow docstring to fake signature. import sys import inspect def foo(blah=sys.maxsize): foo(blah=sys.maxsize) pass ... str(inspect.signature(foo)) '(blah=sys.maxsize)' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19255] Don't wipe builtins at shutdown
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19255 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20144] Argument Clinic doesn't support named constants as default values
Larry Hastings added the comment: storchaka: You propose a result, not an approach. How do you propose we do that? In any case, I think making *that* work would be way too big a change for 3.4. Whatever you proposed would only be appropriate for 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20144 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Serhiy Storchaka added the comment: Why not just move most (except implementation function headers) generated code out to separate file? Right now the list of symbols in the Kate editor contains three names for every function: BINASCII_A2B_UU_METHODDEF, binascii_a2b_uu and binascii_a2b_uu_impl. This makes navigation cumbersome. Also when I search function name a2b_uu, I found 13 occurrences (it will be decreased to 2 or 3 if move generated code out). So search is not helpful too, -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Antoine Pitrou added the comment: If e.g. binascii_a2b_uu_impl were moved to a different file, how would binascii_a2b_uu call it without exposing the symbol externally? I think stitching it with #include is the only workable solution. We already do this for e.g. stringlib. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Guido van Rossum added the comment: I use Emacs, so I have no idea what would help for Kate. I suppose Kate is programmable? Maybe you can add some kind of filter for this purpose? If e.g. binascii_a2b_uu_impl were moved to a different file, how would binascii_a2b_uu call it without exposing the symbol externally? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Guido van Rossum added the comment: And the stringlib situation confuses the hell out of me already. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20153] New-in-3.4 weakref finalizer doc section is already out of date.
New submission from R. David Murray: The following discussion section in the weakref docs: http://docs.python.org/dev/library/weakref.html#comparing-finalizers-with-del-methods which was added in 3.4, is out of date because of the GC improvements. It should be tweaked to match the new reality. (I've already deleted the Note under __callback__.) -- assignee: docs@python components: Documentation messages: 207489 nosy: docs@python, pitrou, r.david.murray, sbt priority: normal severity: normal stage: needs patch status: open title: New-in-3.4 weakref finalizer doc section is already out of date. type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20153 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Serhiy Storchaka added the comment: I use Emacs, so I have no idea what would help for Kate. I suppose Kate is programmable? Maybe you can add some kind of filter for this purpose? In comparision with Emacs it is not programmable. If e.g. binascii_a2b_uu_impl were moved to a different file, how would binascii_a2b_uu call it without exposing the symbol externally? No, I propose to move generated binascii_a2b_uu__doc__, BINASCII_A2B_UU_METHODDEF and binascii_a2b_uu to separate file, and left clinic input and binascii_a2b_uu_impl in main file. Then #include binascii.clinic should be added before the list of module functions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Serhiy Storchaka added the comment: In contrast to stringlib programmers should not look in these generated files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Guido van Rossum added the comment: Then the separate file version looks much worse to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19723] Argument Clinic should add markers for humans
Larry Hastings added the comment: If it's source code, programmers will need to examine it from time to time. A more important distinction imo: stringlib is type-parameterized like some sort of prehistoric C++ template specialization. Thankfully the gunk generated by Argument Clinic is free of such dizzying technology. Another approach to making Clinic output easier to read--which I thought I also proposed at one point--would be to save up most of the Clinic output in an accumulator, then emit the contents of the accumulator on demand. Clinic could probably get away with only generating a prototype for the generated function, the macro for the methoddef, and the prototype (sans semicolon) for the impl. The bulk of the generated code, the implementation of the generated function and the docstring, would go in the accumulator and could be tucked away anywhere in the file you like. I could even make it idiot-proof; if you haven't emptied the accumulator before the end of the file, it could tack the correct Clinic block on the end for you. Here's a quick mockup of what that would look like: /*[clinic] zlib.compress bytes: Py_buffer Binary data to be compressed. [ level: int Compression level, in 0-9. ] / Returns compressed string. [clinic]*/ #define ZLIB_COMPRESS_METHODDEF\ {compress, (PyCFunction)zlib_compress, METH_VARARGS, zlib_compress__doc__}, static PyObject * zlib_compress(PyModuleDef *module, PyObject *args); static PyObject * zlib_compress_impl(PyModuleDef *module, Py_buffer *bytes, int group_right_1, int level) /*[clinic checksum: 9f055a396620bc1a8a13d74c3496249528b32b0d]*/ { PyObject *ReturnVal = NULL; Byte *input, *output = NULL; unsigned int length; ... Not sure how far this suggestion ever got; I think maybe I only showed it to Stefan Krah, who said it wouldn't help his use case so I dropped it. Any good? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19723 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20154] Deadlock in asyncio.StreamReader.readexactly()
New submission from Guido van Rossum: There's currently a deadlock in StreamReader.readexactly() -- if the requested size is larger than the buffer limit for pause, the transport may be paused with no way to unpause it. See http://code.google.com/p/tulip/issues/detail?id=99 in the Tulip tracker. -- assignee: gvanrossum messages: 207494 nosy: gvanrossum priority: high severity: normal stage: test needed status: open title: Deadlock in asyncio.StreamReader.readexactly() type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20154 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20154] Deadlock in asyncio.StreamReader.readexactly()
Roundup Robot added the comment: New changeset 54d32e01bbfd by Guido van Rossum in branch 'default': asyncio: Fix deadlock in readexactly(). Fixes issue #20154. http://hg.python.org/cpython/rev/54d32e01bbfd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20154 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20154] Deadlock in asyncio.StreamReader.readexactly()
Guido van Rossum added the comment: I'd appreciate help writing a test. (Debugging this already set me back enough hours.) -- resolution: - remind ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20154 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com