[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Nick Coghlan added the comment: types is the OO equivalent to functools these days, in addition to its original role of exposing the internal type objects that aren't builtins. However, it seems to me that the fix for issue 1785 is simply *wrong*: it eliminated the exceptions at the expense of sometimes returning the *wrong answer*. The change in that issue means the inspect module isn't implementing the descriptor protocol correctly, and thus may provide a raw descriptor object when attempting to retrieve that attribute will return something else. Instead of the current behaviour, the inspect module should be trying getattr *first*, and only falling back to peeking in the __dict__ directly if that throws an exception. -- title: Make inspect.getmembers and inspect.classify_class_attrs Enum aware - inspect.getmembers and inspect.classify_class_attrs mishandle descriptors ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19015] Too long command returns 32512
Sworddragon added the comment: I have figured out that system() in C can only take up to 65533 arguments after a command (so it is a 16 bit issue). Giving one more argument will result in the return code 32512 (which implies the exit code 127). -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19015 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11708] argparse: suggestion for formatting optional positional args
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13824] argparse.FileType opens a file and never closes it
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13824 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14365] argparse: subparsers, argument abbreviations and ambiguous option
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14365 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9694] argparse required arguments displayed under optional arguments
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9694 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12558] Locale-dependent exception for float width argument to Tkinter widget constructor
Serhiy Storchaka added the comment: I am presuming that tk truncates fractional parts as int() does; if not, use round(). Tk uses both truncated and rounded value. $ rlwrap wish % canvas .c .c % .c configure -width 10.1 % .c configure -width -width width Width 10c 10 % .c configure -width 10.9 % .c configure -width -width width Width 10c 11 As you can see 10.9 gives both 10c and 11. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12558 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19033] Python 3 won't go on PC-BSD 9.1
R. David Murray added the comment: We have FreeBSD buildbots. Python 3.0 is an ancient version of Python3 (in Internet years, at least :) Please try again with python 3.3, the current stable version of Python3. If that doesn't work, you should contact the pc-bsd support, since Python3 clearly configures and builds on FreeBSD (since it works on the buildbots). (That said, note that the FreeBSD port does have some patches that provide better integration with the FreeBSD ports system...I don't know if PC-BSD uses the ports system or not, so that might or might not be relevant.) -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19033 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19033] Python 3 won't go on PC-BSD 9.1
Changes by Ned Deily n...@acm.org: -- status: open - closed type: behavior - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19033 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19033] Python 3 won't go on PC-BSD 9.1
Ned Deily added the comment: http://www.python.org/download/ http://www.freebsd.org/cgi/ports.cgi?query=python3stype=allsektion=all -- nosy: +ned.deily resolution: - out of date stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19033 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12558] Locale-dependent exception for float width argument to Tkinter widget constructor
Serhiy Storchaka added the comment: Oh, sorry, 10c is unrelated. Tk uses rounding. I don't know if it requires somewhere actual non-integer values. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12558 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19029] tix.py uses StringType
Roundup Robot added the comment: New changeset 9eab3e745061 by Serhiy Storchaka in branch '3.3': Issue #19029: Change non-existing since 3.0 StringType to str. http://hg.python.org/cpython/rev/9eab3e745061 New changeset 95b3efe3d7b7 by Serhiy Storchaka in branch 'default': Issue #19029: Change non-existing since 3.0 StringType to str. http://hg.python.org/cpython/rev/95b3efe3d7b7 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19029 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Antoine Pitrou added the comment: I'm fine with the change too. Tim, what do you think? Speaking of which, some examples were really done with an old machine: $ python -m timeit 'try:' ' str.__bool__' 'except AttributeError:' ' pass' - 10 loops, best of 3: 15.7 usec per loop + 100 loops, best of 3: 0.701 usec per loop (1425528 loops/s) :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Antoine Pitrou added the comment: However, it seems to me that the fix for issue 1785 is simply *wrong*: it eliminated the exceptions at the expense of sometimes returning the *wrong answer*. The underlying problem is that those functions are not very well-specified (actually, classify_class_attrs() is not specified at all: it's undocumented). The main consumer of inspect in the stdlib is pydoc, and pydoc being broken by third-party libraries with non-trivial descriptors was a major nuisance. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19032] __reduce_ex__ on lock object
Antoine Pitrou added the comment: I don't really know. It simply looks like the default implementation of __reduce_ex__. Is it important? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19034] More useful repr for Tcl_Obj
New submission from Serhiy Storchaka: Currently the repr() for Tcl_Obj is not very useful. It exposes only Tcl type name and Tcl object address. import tkinter.ttk tv = tkinter.ttk.Treeview() tv.tag_configure('test', foreground='blue') {} str(tv.tag_configure('test', 'foreground')) 'blue' tv.tag_configure('test', 'foreground') color object at 0xb70f84b8 You need explicitly call str to get more useful information. This is awkward when Tcl object hidden deeply in tuples or other data structure, or reported in a backtrace. Actually every Tcl object can be represented as a string. I propose to expose this representation in repr(). With proposed patch the output of the last command will be: color object: 'blue'. -- components: Tkinter files: tkinter_repr.patch keywords: patch messages: 197881 nosy: gpolo, serhiy.storchaka, terry.reedy priority: normal severity: normal stage: patch review status: open title: More useful repr for Tcl_Obj type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31791/tkinter_repr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19034 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Serhiy Storchaka added the comment: Inconsistency: sec per loop vs. loops/s. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19029] tix.py uses StringType
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19029 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Nick Coghlan added the comment: Right, we definitely want inspect to swallow the exceptions from descriptors. My suggestion is merely to switch the order to be: 1. Try getattr 2. If that throws an exception, check __dict__ directly 3. If neither works (e.g. due to a buggy __dir__ method), ignore the attribute entirely. The problem at the moment is *working* descriptors that are designed to fall back on the metaclass lookup are being mishandled. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Antoine Pitrou added the comment: Right, we definitely want inspect to swallow the exceptions from descriptors. My suggestion is merely to switch the order to be: 1. Try getattr 2. If that throws an exception, check __dict__ directly 3. If neither works (e.g. due to a buggy __dir__ method), ignore the attribute entirely. Are you talking about descriptors defined on the class or the metaclass? :-) -- title: inspect.getmembers and inspect.classify_class_attrs mishandle descriptors - inspect.getmembers and inspect.classify_class_attrs mishandle descriptors ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Jakub Stasiak added the comment: That's right, I was actually wondering about it few minutes before you pointed it out. Find new patch attached. -- Added file: http://bugs.python.org/file31792/timeit-v4-actual-changes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1065986] Fix pydoc crashing on unicode strings
Akira Kitada added the comment: Attaching a modified version of issue1065986.patch. The differences are: - Added _binstr(), which is str() that works with unicode objects. - Changed getdoc() to return encoded docstrings/comments - Used _binstr() to convert __version__, __date__, __author__ and __credits__ to str -- Added file: http://bugs.python.org/file31793/issue1065986-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1065986 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19032] __reduce_ex__ on lock object
Ram Rachum added the comment: I use that to test whether an object is pickleable or not. It used to work in Python 2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11798] Test cases not garbage collected after run
Michael Foord added the comment: If we're sure suite._cleanupis a *good* api for this then fine to expose it (and document) it as a public api. I'll take a look at it in a bit. Test suites will still have to do *some* monkeying around to set suite.cleanup (presumably in load_tests), so I'm not sure it's much more convenient... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11798 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19016] autospecced namedtuples should be truthy by default
Michael Foord added the comment: The problem is that the change you're proposing is backwards incompatible. Code using MagicMock and objects with length will break. -- assignee: - michael.foord versions: +Python 3.4 -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19016 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18996] unittest: more helpful truncating long strings
Michael Foord added the comment: Awesome, thanks for this work. The only thing I'd say is that if _common_shorten is always called with two args - and safe_repr is always called on them - then why not have it take two args and call safe_repr on them? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Nick Coghlan added the comment: On the class, since that's the case which is breaking here (instances are already OK, since they trigger the success path in the custom descriptors) -- title: inspect.getmembers and inspect.classify_class_attrs mishandle descriptors - inspect.getmembers and inspect.classify_class_attrs mishandle descriptors ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19032] __reduce_ex__ on lock object
Antoine Pitrou added the comment: I use that to test whether an object is pickleable or not. It used to work in Python 2. Well, the obvious way to do it would be to call pickle.dumps() on the object, IMO :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19032] __reduce_ex__ on lock object
Ram Rachum added the comment: Wrong, because the object itself could be pickleable but refer to a different object which is non-pickleable. I want to know whether the object itself, without any object it refers to, is pickleable. Also, pickling an object could be very resource-intensive, depending on its size. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16129] No good way to set 'PYTHONIOENCODING' when embedding python.
Brecht Van Lommel added the comment: With the language summit passed some time ago, is there now a more clear picture of how this would fit in the initialisation process? Any idea of what a proper implementation would look like, or is the message still to wait? -- nosy: +Brecht.Van.Lommel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16129 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19032] __reduce_ex__ on lock object
Antoine Pitrou added the comment: Wrong, because the object itself could be pickleable but refer to a different object which is non-pickleable. I want to know whether the object itself, without any object it refers to, is pickleable. I think you're being too picky. Unless you're manually added stuff to your Lock's attributes, there isn't a practical difference between the two situations. Also, pickling an object could be very resource-intensive, depending on its size. Well, this is a Lock here, not an ISO file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14984] netrc module allows read of non-secured .netrc file
Barry A. Warsaw added the comment: @RDM: Please commit to 2.6 and null merge to 2.7. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14984 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18050] embedded interpreter or virtualenv fails with ImportError: cannot import name MAXREPEAT
Serhiy Storchaka added the comment: Well. While the running different versions of binaries and Python files is not a good idea, perhaps we can apply this change. But only for 2.7 and 3.3. There is no need in this garbage in 3.4. I'm still not sure that there are no other inconsistencies between old static binaries and newer Python files. -- assignee: - serhiy.storchaka keywords: +patch stage: needs patch - patch review versions: -Python 3.4 Added file: http://bugs.python.org/file31794/sre_MAXREPEAT.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18050 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18985] Improve the documentation in fcntl module
Vajrasky Kok added the comment: Updated patch based on Ezio's review. I reverted back the changes to Nul and module documentation (since it is not so clear whether we should categorize flock as Unix routine or not). -- Added file: http://bugs.python.org/file31795/fix_documentation_on_fcntl_module_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19035] tokenize.generate_tokens treat '\f' symbol as the end of file (when reading in unicode)
New submission from Alexey Umnov: I execute the following code on the attached file 'text.txt': import tokenize import codecs with open('text.txt', 'r') as f: reader = codecs.getreader('utf-8')(f) tokens = tokenize.generate_tokens(reader.readline) The file 'text.txt' has the following structure: first line with some text, then '\f' symbol (0x0c) on the second line and then some text on the last line. The result is that the function 'generate_tokens' ignores everything after '\f'. I've made some debugging and found out the following. If the file is read without using codecs (in ascii-mode), there are considered to be 3 lines in the file: 'text1\n', '\f\n', 'text2\n'. However in unicode-mode there are 4 lines: 'text1\n', '\f', '\n', 'text2\n'. I guess this is an intended behaviour since 2.7.x, but this causes a bug in tokenize module. Consider the lines 317-329 in tokenize.py: ... column = 0 while pos max: # measure leading whitespace if line[pos] == ' ': column += 1 elif line[pos] == '\t': column = (column//tabsize + 1)*tabsize elif line[pos] == '\f': column = 0 else: break pos += 1 if pos == max: break ... The last 'break' corresponds to the main parsing loop and makes the parsing stop. Thus the lines that consist of (' ', '\t', '\f') characters and don't end with '\n' are treated as the end of file. -- components: Library (Lib) files: tokens.txt messages: 197899 nosy: Alexey.Umnov priority: normal severity: normal status: open title: tokenize.generate_tokens treat '\f' symbol as the end of file (when reading in unicode) type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file31796/tokens.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19035 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18857] urlencode of a None value uses the string 'None'
Claudiu.Popa added the comment: No problem, David, working on these patches is just an occasion for me to learn more and be useful at the same time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18704] IDLE: PEP8 Style Check Integration
R. Jayakrishnan added the comment: I would prefer this issue concludes with a navigation to the new proposed enhancement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18704 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Ethan Furman added the comment: Switching the order to try getattr first is going to make getting the doc from the descriptor problematic -- we have no way of knowing if the descriptor doc goes with the object we got back from getattr. Current patch adds VirtualAttribute to types, and reworks inspect.classify_class_attrs, inspect.getmembers, and Enum to use that instead of _RouteClassAttributeToGetattr (which has been removed). Tests are still needed for the new VirtualAttribute. Not sure VirtualAttribute is the best name; other ideas: - InstanceProperty - AttributeProperty - HiddenClassProperty -- stage: - patch review Added file: http://bugs.python.org/file31797/issue19030.stoneleaf.02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1519638] Unmatched Group issue - workaround
Changes by irdb dalba.w...@gmail.com: -- nosy: +irdb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1519638 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16129] No good way to set 'PYTHONIOENCODING' when embedding python.
Nick Coghlan added the comment: The gory details of the current startup situation are in PEP 432. However, the comprehensive solution described in that PEP isn't going to make it into Python 3.4, so a simpler interim fix would be worthwhile. Since Blender is designed to support building against the system Python, the trick of forcing Python to link to an alternate implementation of a function won't work. Inspired by http://docs.python.org/3/c-api/init.html#Py_SetPath, I suggest offering an API like: int Py_SetStandardStreamEncoding(char *encoding, char *errors) { if (Py_IsInitialized()) { return -1; } Py_StandardStreamEncoding = _PyMem_Strdup(encoding); Py_StandardStreamErrors = _PyMem_Strdup(errors); } The initstdio function in pythonrun.c would then be updated to use the specified Py_StandardStreamEncoding and Py_StandardStreamErrors if they weren't NULL (since that would indicate an embedding application had called SetStandardStreamEncoding). -- assignee: ncoghlan - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16129 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18857] urlencode of a None value uses the string 'None'
Joshua Johnston added the comment: I know that languages like php will treat ?josh= the same as ?josh Using the attached test form in Google Chrome, you will see the data passed as josh= when empty in both GET and POST requests. This is probably the way to go, key=str(value) if value is not None else '' -- Added file: http://bugs.python.org/file31798/test.html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18526] Add resource management/guarding to unittest
Zachary Ware added the comment: Having thought about this more, I think I agree that this is the wrong approach to the issue and that a more general ability to add command line options to unittest would be better. Closing this issue. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18526 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors
Nick Coghlan added the comment: The current behaviour is broken for *any* descriptor which doesn't return itself when retrieved from the class. It just so happens that all the *other* descriptors in the standard library work that way, so it doesn't matter if you retrieve them directly from __dict__ or retrieve them with getattr - you'll get the descriptor object either way. So we should be calling getattr first, and always taking __doc__ (if any) from the returned object. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18948] deliberately crashing tests should prevent core dumps
Zachary Ware added the comment: Perhaps it would be best to either combine SuppressCoreFiles and suppress_crash_popup, or provide a new construct that does so since both are used in almost every place one is used. Also, test_daemon_threads_fatal_error in test_threading should be using suppress_crash_popup, but isn't currently, which I believe falls under the scope of this issue. -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18948 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14984] netrc module allows read of non-secured .netrc file
R. David Murray added the comment: Well, I was planning to merge it, since 2.7 needs the fix as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14984 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14984] netrc module allows read of non-secured .netrc file
Barry A. Warsaw added the comment: On Sep 16, 2013, at 03:12 PM, R. David Murray wrote: Well, I was planning to merge it, since 2.7 needs the fix as well. Oh yeah, that's fine of course. And thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14984 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine
Sam Ferencik added the comment: Thanks for the context. A compatibility issue here is that the value provided by get_platform() is also used outside of Distutils, in particular by pkg_resources (provided by setuptools) and by pip, in both cases to help determine whether a binary distribution of an extension module is compatible with the python being used. If your wording is correct, and get_platform() really is used to determine the python being used, then we could actually be improving things by fixing this. Currently, get_platform() doesn't tell you the bitness of the *python* being used, but the bitness of the *OS* being used (the two of which only differ on 32-on-64). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17226] libintl should also check for libiconv
Alan Hourihane added the comment: This works for me... --- configure.ac.old2013-09-10 14:37:20.0 + +++ configure.ac2013-09-10 14:56:27.0 + @@ -2190,7 +2190,11 @@ AC_CHECK_LIB(intl, textdomain, [AC_DEFINE(WITH_LIBINTL, 1, [Define to 1 if libintl is needed for locale functions.]) -LIBS=-lintl $LIBS]) +LIBS=-lintl $LIBS], + [AC_SEARCH_LIBS(textdomain, intl, + [AC_DEFINE(WITH_LIBINTL, 1, + [Define to 1 if libintl is needed for locale functions.]) + LIBS=-lintl -liconv $LIBS], , -liconv)]) # checks for system dependent C++ extensions support case $ac_sys_system in -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17226 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18230] test_builtin fails/hangs when run after test_getopt
Serhiy Storchaka added the comment: Yes, it is related. test_getopt uses doctests, doctest uses pdb, pdb imports readline. -- nosy: +serhiy.storchaka resolution: - duplicate status: open - closed superseder: - readline-related test_builtin failure ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
New submission from Alan Hourihane: Patch --- Python/fileutils.c.old 2013-09-11 07:04:42.0 + +++ Python/fileutils.c 2013-09-11 07:05:01.0 + @@ -4,8 +4,8 @@ # include windows.h #endif -#ifdef HAVE_LANGINFO_H #include locale.h +#ifdef HAVE_LANGINFO_H #include langinfo.h #endif -- components: Build messages: 197914 nosy: alanh priority: normal severity: normal status: open title: setlocale fails due to locale.h being wrapped up in LANGINFO check. versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19016] autospecced namedtuples should be truthy by default
Shawn Krisman added the comment: Yeah in my head I was thinking it would affect relatively few people who depended on the change, but it's definitely hard to prove that! How about a change that special cases namedtuple? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19016 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17734] Failure when running test_builtin after test_genexps
Serhiy Storchaka added the comment: Yes. test_genexps uses doctests, doctest uses pdb, pdb imports readline. -- nosy: +serhiy.storchaka resolution: - duplicate status: open - closed superseder: - readline-related test_builtin failure ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17734 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18626] Make python -m inspect name meaningful
Claudiu.Popa added the comment: Hello, here's a basic patch. Currently, the header info is printed by default, while the source can be retrieved by using --source (although I would prefer them to be switched, the source should be shown by default and the header info only when requested). It understands the entry point notation, like 'unittest:util.safe_repr'. -- keywords: +patch nosy: +Claudiu.Popa Added file: http://bugs.python.org/file31799/inspect.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18626 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19017] selectors: towards uniform EBADF handling
Guido van Rossum added the comment: Interesting issue. ISTM that closing the FD before unregistering it is a programmer's mistake that shouldn't pass silently. And closing it in a separate thread while the selector is active sounds like an even bigger bug. Could we report an new event type for this situation? E.g. EVENT_CLOSED. The proper response would be to unregister the FD. (And yes, unregistering the FD when it was previously registered should not be an error, even if it has been closed.) I'm not sure I care that there will be an infinite loop if the caller doesn't take action -- it's the same for any event, if you don't read from an FD when you get an EVENT_READ event, you'll get an infinite loop too. Note that this is not exactly the same as the invalid fd that Victor proposes -- although they aren't always distinguishable, the logic errors in the app are different: in one case, closing a FD (that was valid and registered) without unregistering, in the other case, registering an FD that isn't valid. (Ideally the register() call should fail, but I suppose we can't detect that without an extra syscall -- although in some cases there's a syscall in register() anyway, and then we can use that to reject the register() call. -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19017 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18961] Non-UTF8 encoding line
Martin v. Löwis added the comment: Terry: the comment isn't self-contradictory. Instead, the file constitutes a perfectly fine iso-8859-15 byte sequence (albeit a meaningless one: any byte sequence is perfectly fine iso-8559-15, and, in a comment, any characters are allowed by the Python syntax). AFAICT, the file also follows the wording of PEP 263, as it does not disallow additional text on the encoding line. Therefore, I think tokenize should accept the file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18961 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
R. David Murray added the comment: Oops, didn't mean to assign this to anyone. -- assignee: lemburg - nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16038] ftplib: unlimited readline() from connection
Giampaolo Rodola' added the comment: Looks legitimate to me. I will come up with a separate patch for later Python versions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16038 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
R. David Murray added the comment: Can you provide more information about the circumstances in which this is a problem? Presumably there is a reason why the code is currently the way it is, especially since it is done this way in several of the source files, and has been that way for a *long* time. -- assignee: - lemburg nosy: +lemburg, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14984] netrc module allows read of non-secured .netrc file
R. David Murray added the comment: The patch for 3.1 is very close to the 2.7 patch, and is attached. Benjamin and Georg, I'd like to apply this to 3.1 and merge it up through default. May I and can I? -- Added file: http://bugs.python.org/file31800/netrc-py3.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14984 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18960] First line can be executed twice
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18960 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19037] mailbox module modifies maildir file times after moving from tmp directory
New submission from janzert: The Maildir.add and Maildir.__setitem__ methods in the mailbox module attempts to change the file mtime after moving the file into the new directory. This allows a race condition since other programs are can move or otherwise modify the file as soon as it is placed in the new directory. If the file is moved from the new directory before the mtime is set this results in an unexpected OSError exception. The fix seems to simply be setting the file mtime before moving the file into its final position. -- components: Library (Lib) messages: 197930 nosy: janzert, petri.lehtinen priority: normal severity: normal status: open title: mailbox module modifies maildir file times after moving from tmp directory type: behavior versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19017] selectors: towards uniform EBADF handling
Guido van Rossum added the comment: The problem is that for epoll (and kqueue I think) the FD is automagically removed from the backend, which means that we won't get any notification for this FD, hence we're unable to report it as closed. That makes it sound like it will be hard to respond the same way on all platforms. :-( Even silently removing the registration for select and poll still leaves the behavior different: if you register a bad FD with select or poll, the register() call will accept it but the select() call will silently remove it; however if you register a bad FD with epoll or kqueue, register() will raise EBADF. I would prefer to see an EBADF exception in all four cases, even if it happens in register() for some platforms and in select() for others. There is also the issue of trying to unregister (or modify?) an FD that has gone bad after successful registration -- this will also have different behavior on the different platform, right? Maybe we'll get better design guidance if we look at this from the POV of a server loop that doesn't fully control the code that may be registering and unregistering FDs. It seems a good idea to make it so that if some bad piece of code tries to register a bad FD or close a FD without unregistering doesn't bring down the entire server, but the bad code always sees an exception. Maybe we should be silent in select() but cause unregister() to fail? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19017 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18961] Non-UTF8 encoding line
Serhiy Storchaka added the comment: What about first line? Currently both Python interpreter and the tokenize module decode it from UTF-8 (actually due to bug #18960 Python interprets it twice, in different encodings). PEP 263 says: 1. The complete Python source file should use a single encoding. Embedding of differently encoded data is not allowed and will result in a decoding error during compilation of the Python source code. I conclude that the first line should be decoded with the encoding specified in the second line. We first should read the first line, check if it isn't a comment or contains encoding cookie, otherwise read the second line, determine the encoding, and decode read lines. Perhaps it will untangle issue18960 too. -- assignee: - serhiy.storchaka stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18961 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19035] tokenize.generate_tokens treat '\f' symbol as the end of file (when reading in unicode)
R. David Murray added the comment: I suspect this isn't the only place where the change in what is considered a (unicode) line ending character between 2.6 and 2.7/python3 is an issue. As you observe, it causes very subtle bugs. I'm going to have to go trolling through the python3 email package looking for places where this could break things :(. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19035 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19037] mailbox module modifies maildir file times after moving from tmp directory
R. David Murray added the comment: That sounds reasonable. Would you be interested in trying your hand at a patch, ideally with a test? -- components: +email nosy: +barry, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14984] netrc module allows read of non-secured .netrc file
R. David Murray added the comment: Removing 2.6 and 2.7 from versions since it is now fixed there. I'll work on porting it to python3. -- versions: -Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14984 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
Alan Hourihane added the comment: Oops, meant to say. In pythonrun.c the setlocale() call is already wrapped inside the #ifdef so the problem ISN'T bumped into there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14984] netrc module allows read of non-secured .netrc file
Roundup Robot added the comment: New changeset e5c4eb6b8e05 by R David Murray in branch '2.6': #14984: On POSIX, enforce permissions when reading default .netrc. http://hg.python.org/cpython/rev/e5c4eb6b8e05 New changeset 2e19c65d6688 by R David Murray in branch '2.7': Merge #14984: On POSIX, enforce permissions when reading default .netrc. http://hg.python.org/cpython/rev/2e19c65d6688 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14984 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18996] unittest: more helpful truncating long strings
Serhiy Storchaka added the comment: Indeed, I'll rename _common_shorten() to _common_shorten_repr() and call safe_repr() inside. As for two vs multiple args, first I wrote a variant with two args (you can see it in my first unlinked patch), but then I seen that general variant is not harder and even shorter. I'm open for bikeshedding. Perhaps we should change the placeholder to something better (e.g. to [... skipped ...])? Is the number of skipped characters is useful? Note that it is a number of skipped characters in the repr, not in the original strings and can be misguided for strings. Perhaps we should change minimal lengths of head, tail, and interior part? Why part is most important and should be larger? Perhaps add a keyword-only parameter maxlen (or other parameters for customization)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19017] selectors: towards uniform EBADF handling
Charles-François Natali added the comment: Interesting issue. ISTM that closing the FD before unregistering it is a programmer's mistake that shouldn't pass silently. And closing it in a separate thread while the selector is active sounds like an even bigger bug. Agreed. Could we report an new event type for this situation? E.g. EVENT_CLOSED. The proper response would be to unregister the FD. (And yes, unregistering the FD when it was previously registered should not be an error, even if it has been closed.) The problem is that for epoll (and kqueue I think) the FD is automagically removed from the backend, which means that we won't get any notification for this FD, hence we're unable to report it as closed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19017 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: -lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
R. David Murray added the comment: So the real problem is that the setlocale call is outside the ifdef, which means Victor is the right person to look at this, since it was his patch that introduced the code in question. I'll remove MAL from nosy, since I only added him by accident. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19037] mailbox module modifies maildir file times after moving from tmp directory
janzert added the comment: I can certainly write a patch if wanted. It should be simply moving and modifying two lines in each of the two methods. My understanding is that it should be against 2.7 so it can be applied there first then merged forward? Unfortunately while I can consistently reproduce the problem, with a script using pyinotify, I'm pretty lost how to write a test that would catch this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
Alan Hourihane added the comment: Yes, it's a Build issue as mentioned using the Components field. But cut pasting from other files is incorrect in this case because setlocale() is still used outside of the #ifdef. File attached. -- keywords: +patch Added file: http://bugs.python.org/file31801/python-3.3.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
Alan Hourihane added the comment: You'll see the error on any platform that doesn't include locale.h when it should, i.e. a platform that doesn't have NL_LANGINFO. This is the build error. Python/fileutils.c: In function 'check_force_ascii': Python/fileutils.c:101:5: warning: implicit declaration of function 'setlocale' [-Wimplicit-function-declaration] Python/fileutils.c:101:21: error: 'LC_CTYPE' undeclared (first use in this function) Python/fileutils.c:101:21: note: each undeclared identifier is reported only once for each function it appears in You can simulate it on Linux, by just commenting out the #include for locale.h and voila. But for completeness, it's an m68k Atari platform. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19037] mailbox module modifies maildir file times after moving from tmp directory
R. David Murray added the comment: Hopefully a 2.7 patch would also apply to 3.3, so yes, start there. For the test, I was thinking that in 3.3+ we could use mock to introduce a delay. But looking at the code again it isn't obvious that there is a meaningful way to do it that is worth the effort required. So let's forget about the test for this one...a comment about why the time set is done before the move would be worthwhile, though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
STINNER Victor added the comment: Yes, it's a Build issue as mentioned using the Components field. Again, what is your platform (OS name, OS version)? What is the compiler error message? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
Changes by STINNER Victor victor.stin...@gmail.com: -- versions: +Python 3.2, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
STINNER Victor added the comment: Oh by the way, please attach the patch as a file to the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
STINNER Victor added the comment: It looks like a real issue, but on which platform did you get the error? setlocale fails due to locale.h being wrapped up in LANGINFO check. What do you mean by fail? Is it an error at runtime? Or during the compilation? -- The include was added recently: changeset: 81257:c256764e2b3f branch: 3.2 parent: 81253:c4a4863b85b2 user:Victor Stinner victor.stin...@gmail.com date:Thu Jan 03 01:08:58 2013 +0100 files: Misc/NEWS Objects/unicodeobject.c Python/fileutils.c description: Issue #16455: On FreeBSD and Solaris, if the locale is C, the ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice. The commit was integrated in Python 3.2.5 and Python 3.3.2 . If I remember correctly, I copied/pasted the code from Python/pythonrun.c: #ifdef HAVE_LANGINFO_H #include locale.h #include langinfo.h #endif Many other files use #include locale.h without #ifdef HAVE_LANGINFO_H: Modules/main.c, Modules/python.c, Modules/readline.c, Python/frozenmain.c, Python/pystrtod.c and Modules/_localemodule.c. The #include in Modules/main.c was added 5 years ago by changeset 22a74eaf6b22. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17003] Unification of read() and readline() argument names
Roundup Robot added the comment: New changeset 46c1c2b34e2b by Serhiy Storchaka in branch 'default': Issue #17003: Unified the size argument names in the io module with common http://hg.python.org/cpython/rev/46c1c2b34e2b -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17003 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18960] First line can be executed twice
Serhiy Storchaka added the comment: It also makes non-working a common idiom for running Python files on Windows. When add first line @python -x, it will be interpreted by Python and will cause SyntaxError. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18960 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19037] mailbox module modifies maildir file times after moving from tmp directory
Changes by janzert janz...@janzert.com: -- keywords: +patch Added file: http://bugs.python.org/file31802/mailbox.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19038] Fix sort order in Misc/ACKS.
Ezio Melotti added the comment: The Å sorts correctly after the Z. Have you changed anything else other than that? (If you upload a diff file it's better) -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19038 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19038] Fix sort order in Misc/ACKS.
New submission from Tae-Wong SEO: This patch fixes sort order in file Misc/ACKS. -- assignee: docs@python components: Documentation files: ACKS messages: 197945 nosy: docs@python, taewong.seo priority: normal severity: normal status: open title: Fix sort order in Misc/ACKS. type: enhancement Added file: http://bugs.python.org/file31803/ACKS ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19038 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18873] Encoding detected in non-comment lines
Roundup Robot added the comment: New changeset 2dfe8262093c by Serhiy Storchaka in branch '3.3': Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script http://hg.python.org/cpython/rev/2dfe8262093c New changeset 6b747ad4a99a by Serhiy Storchaka in branch 'default': Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script http://hg.python.org/cpython/rev/6b747ad4a99a New changeset 3d46ef0c62c5 by Serhiy Storchaka in branch '2.7': Issue #18873: IDLE, 2to3, and the findnocoding.py script now detect Python http://hg.python.org/cpython/rev/3d46ef0c62c5 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18873] Encoding detected in non-comment lines
Serhiy Storchaka added the comment: If there is not now, it would be nice if there were just one python-coded function in Lib/tokenize.py that could be imported and used by the other python code. Agree. But look how many tokenize issues are opened around. Thank you for your report Paul. I left PEP 263 not fixed yet. Perhaps it needs rewording (especially in the light of other issues, such as #18960 and #18961). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18873] Encoding detected in non-comment lines
Terry J. Reedy added the comment: One of the problem with encoding recognition is that the same logic is more-or-less reproduced multiple places, so any fix needs to be applied multiple places. From the detect_encoding_in_comments_only.patch: Lib/idlelib/IOBinding.py Lib/lib2to3/pgen2/tokenize.py Lib/tokenize.py Tools/scripts/findnocoding.py Any fix for issues *18960 and *18961 may also need multiple applications. If there is not now, it would be nice if there were just one python-coded function in Lib/tokenize.py that could be imported and used by the other python code. (I was going to suggest exposing the function in tokenize.c, but I believe the point of tokenize.py is to not be dependent on CPython.) I believe the Idle support for \r became obsolete when support for MacOS9 was dropped in 2.4. I notice that it is not part of io universal newline support. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19038] Fix sort order in Misc/ACKS.
Tae-Wong SEO added the comment: Letter a-with-ring is used in Swedish, Danish, Norwegian, Finnish and several other languages. You have accentuated some contributor names (for example: Bozon, Donmez and Niksic). You want to make a diff file for this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19038 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19009] Enhance HTTPResponse.readline() performance
Kristján Valur Jónsson added the comment: Ok, I'm adding a more comprehensive patch. It adds support for peek, readline, and read1 for both regular and chunked responses. readline falls back to IOBase.readline for chunked, which again makes use of peek() for performance. read1() is available for other kinds of client buffering, e.g. when reading the stream incrementally using other delimiters than newline. The real work is done by the _read1_or_peek_chunked() method. the code for both cases is almost identical so a dual purpose method is warranted. Added test cases to test this. The test cases don't attempt to test that we don't block on partial resopnses, though. I'm not sure how I would write such a test. I'd probably have to extend FakeSocket to work on some stream that can be appended to... -- Added file: http://bugs.python.org/file31804/httpresponse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19009 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
STINNER Victor added the comment: Updated patch. -- Added file: http://bugs.python.org/file31805/5d8817cc9e69.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file31545/tracemalloc-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file31806/21f7c3df0f15.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file31805/5d8817cc9e69.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file31517/tracemalloc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1615] descriptor protocol bug
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1615 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
STINNER Victor added the comment: Include/tracemalloc.h: PyTraceMalloc_DisableTemporary() and PyTraceMalloc_RestoreTemporary() should be removed, they were tests to try to fix issues with subinterpreter when tracing PyMem_RawMalloc(). Lib/test/regrtest.py: These changes should not be commited, they are just here to create easily snapshot files (./python -X tracemalloc -m test). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18961] Non-UTF8 encoding line
Martin v. Löwis added the comment: One issue at a time, please, and issue18960 is already its own issue. In any case, item 1 in Concepts of PEP 263 is clear that any deviation from the declared encoding should cause a decoding error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18961 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18874] Add a new tracemalloc module to trace memory allocations
STINNER Victor added the comment: TODO list: * remove dependency to psutil * enable PYMEM_RAW: fix subinterpreter issue, check which variables are protected by which lock * test the command line interface? * don't trace objects created by get_stats(), reentrant flag should be a thread-local variable * add an hash table of tracebacks: 86% of tracebacks are duplicated See also the TODO.txt file in the tracemalloc repository. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.
Alan Hourihane added the comment: Sure, Look in the function. check_force_ascii() You'll see a hunk of code that is ifdef'd for ... #if defined(HAVE_LANGINFO_H) defined(CODESET) Then you'll see setlocale() is called outside of that check, just before another hunk of code is ifdef'd with the same #if defined(HAVE_LANGINFO_H) defined(CODESET) Basically making setlocale() outside of the check, and therefore requiring the #include locale.h outside of the above check as well. In pythonrun.c the setlocale() call is already wrapped inside the #ifdef so the problem is bumped into there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19036 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com