[issue16969] test_urlwithfrag fail
Ezio Melotti added the comment: That's because there's no test file called test_urlwithfrag.py. Do you see any failure if you do ./python -m test -v test_urllib2net? -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16969 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15994] memoryview to freed memory can cause segfault
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15989] Possible integer overflow of PyLong_AsLong() results
Serhiy Storchaka added the comment: Changeset 525407d89277: Fix test_socket broken in previous commit (changeset 13e2e44db99d). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15989 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15948] Unchecked return value of I/O functions
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16956] Allow signed line number deltas in the code object's line number table
Mark Shannon added the comment: The interaction between bdb/pdb and the line number table is via the frame.f_lineno attribute. Allowing signed offsets changes the one-to-one line muber = bytecode offset relation into a one-to-many relation. Reading frame.f_lineno is not an issue as each bytecode offset will always refer to exactly one line number. Setting frame.f_lineno requires some thought as each line number could potentially refer to several bytecode offsets. However, the proposed patch retains the one-to-one relation, as the test in the while statement is merely moved, not duplicated. I am reluctant to change frame_setlineno() until there really is a one-to-many relation as it will be untestable. Once a one-to-many relation exists (e.g. duplicating finally blocks to avoid 'pseudo excpetions') then frame_setlineno should be modified (and tests added) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16956 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16086] tp_flags: Undefined behaviour with 32 bits long
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16086 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16954] Add docstrings for ElementTree module
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: serhiy.storchaka - docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16954 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: Adding a failing test. I will supply a patch shortly. -- keywords: +patch stage: - needs patch Added file: http://bugs.python.org/file28731/issue-16468-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16096] Get rid of dangerous integer overflow tricks
Serhiy Storchaka added the comment: Here are updated to current codebase patches for 2.7 and 3.2. It seems that all the rest of overflows are hypothetical bugs and do not appear on the current supported platforms. Fix them is not necessary (rather for purity). If no one can see visible bugs, I'll close this issue soon. -- Added file: http://bugs.python.org/file28732/size_overflow-2.7_2.patch Added file: http://bugs.python.org/file28733/size_overflow-3.2_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16096 ___diff -r f2353e74b335 Modules/_randommodule.c --- a/Modules/_randommodule.c Tue Jan 08 23:12:00 2013 +0200 +++ b/Modules/_randommodule.c Wed Jan 09 19:00:27 2013 +0200 @@ -283,7 +283,8 @@ n = newn; if (keyused = keymax) { unsigned long bigger = keymax 1; -if ((bigger 1) != keymax) { +if ((bigger 1) != keymax || +bigger PY_SSIZE_T_MAX / sizeof(*key)) { PyErr_NoMemory(); goto Done; } diff -r f2353e74b335 Modules/arraymodule.c --- a/Modules/arraymodule.c Tue Jan 08 23:12:00 2013 +0200 +++ b/Modules/arraymodule.c Wed Jan 09 19:00:27 2013 +0200 @@ -423,11 +423,11 @@ return NULL; } -nbytes = size * descr-itemsize; /* Check for overflow */ -if (nbytes / descr-itemsize != (size_t)size) { +if (size PY_SSIZE_T_MAX / descr-itemsize) { return PyErr_NoMemory(); } +nbytes = size * descr-itemsize; op = (arrayobject *) type-tp_alloc(type, 0); if (op == NULL) { return NULL; @@ -1205,13 +1205,10 @@ char *item = self-ob_item; Py_ssize_t itemsize = self-ob_descr-itemsize; size_t nread; -Py_ssize_t newlength; size_t newbytes; -/* Be careful here about overflow */ -if ((newlength = Py_SIZE(self) + n) = 0 || -(newbytes = newlength * itemsize) / itemsize != -(size_t)newlength) +if (n (PY_SSIZE_T_MAX - Py_SIZE(self)) / itemsize) goto nomem; +newbytes = (Py_SIZE(self) + n) * itemsize; PyMem_RESIZE(item, char, newbytes); if (item == NULL) { nomem: diff -r f2353e74b335 Modules/audioop.c --- a/Modules/audioop.c Tue Jan 08 23:12:00 2013 +0200 +++ b/Modules/audioop.c Wed Jan 09 19:00:27 2013 +0200 @@ -1094,8 +1094,7 @@ PyErr_SetString(AudioopError, # of channels should be = 1); return NULL; } -bytes_per_frame = size * nchannels; -if (bytes_per_frame / nchannels != size) { +if (size INT_MAX / nchannels) { /* This overflow test is rigorously correct because both multiplicands are = 1. Use the argument names from the docs for the error msg. */ @@ -1103,6 +1102,7 @@ width * nchannels too big for a C int); return NULL; } +bytes_per_frame = size * nchannels; if (weightA 1 || weightB 0) { PyErr_SetString(AudioopError, weightA should be = 1, weightB should be = 0); diff -r f2353e74b335 Modules/cPickle.c --- a/Modules/cPickle.c Tue Jan 08 23:12:00 2013 +0200 +++ b/Modules/cPickle.c Wed Jan 09 19:00:27 2013 +0200 @@ -218,14 +218,12 @@ size_t nbytes; PyObject **tmp; +if (self-size == 0 || self-size (INT_MAX 1)) +goto nomemory; bigger = self-size 1; -if (bigger = 0)/* was 0, or new value overflows */ -goto nomemory; -if ((int)(size_t)bigger != bigger) +if ((size_t)bigger PY_SSIZE_T_MAX / sizeof(PyObject *)) goto nomemory; nbytes = (size_t)bigger * sizeof(PyObject *); -if (nbytes / sizeof(PyObject *) != (size_t)bigger) -goto nomemory; tmp = realloc(self-data, nbytes); if (tmp == NULL) goto nomemory; diff -r f2353e74b335 Objects/bytearrayobject.c --- a/Objects/bytearrayobject.c Tue Jan 08 23:12:00 2013 +0200 +++ b/Objects/bytearrayobject.c Wed Jan 09 19:00:27 2013 +0200 @@ -357,9 +357,9 @@ if (count 0) count = 0; mysize = Py_SIZE(self); +if (count != 0 mysize PY_SSIZE_T_MAX / count) +return PyErr_NoMemory(); size = mysize * count; -if (count != 0 size / count != mysize) -return PyErr_NoMemory(); result = (PyByteArrayObject *)PyByteArray_FromStringAndSize(NULL, size); if (result != NULL size != 0) { if (mysize == 1) @@ -382,9 +382,9 @@ if (count 0) count = 0; mysize = Py_SIZE(self); +if (count != 0 mysize PY_SSIZE_T_MAX / count) +return PyErr_NoMemory(); size = mysize * count; -if (count != 0 size / count != mysize) -return PyErr_NoMemory(); if (size self-ob_alloc) { Py_SIZE(self) = size; self-ob_bytes[Py_SIZE(self)] = '\0'; /* Trailing null byte */ @@ -1568,7 +1568,7 @@ { char *self_s,
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: Attaching patch. With this patch, passing a non-iterable choices argument to parser.add_argument() raises (for example): Traceback (most recent call last): ... File .../Lib/argparse.py, line 558, in _metavar_formatter choice_strs = [str(choice) for choice in action.choices] TypeError: 'MyChoices' object is not iterable instead of the incorrect: File .../Lib/argparse.py, line 1333, in add_argument raise ValueError(length of metavar tuple does not match nargs) ValueError: length of metavar tuple does not match nargs Is it okay to change this exception type in maintenance releases? The other option is to keep the error as a ValueError but to change the error message, though I think TypeError is the correct exception to allow through. Note that the existing ValueError is preserved for other code paths. Indeed, there are several tests checking for this ValueError and its error message, which the attached patch does not break. If we want to consider accepting non-iterable choices for 3.4, we can still have that discussion as part of a separate patch. -- stage: needs patch - patch review Added file: http://bugs.python.org/file28734/issue-16468-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: Slight doc tweak: s/container/sequence/. -- Added file: http://bugs.python.org/file28735/issue-16468-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16216] Arithmetic operations with NULL
Serhiy Storchaka added the comment: Oh, I forgot to mention the issue number in commit messages. There are changeset ad9b5c69b8b6 (for 3.3) and changeset 1f66fc397c8d (for default). -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16216 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16970] argparse: bad nargs value raises misleading message
New submission from Chris Jerdonek: parser = argparse.ArgumentParser() parser.add_argument('foo', nargs='a') ... File .../Lib/argparse.py, line 1333, in add_argument raise ValueError(length of metavar tuple does not match nargs) ValueError: length of metavar tuple does not match nargs The message should really be about nargs not having a valid value. The nargs value is invalid regardless of the metavar. There is also this: parser.add_argument('foo', nargs=-1) _StoreAction(option_strings=[], dest='foo', nargs=-1, const=None, default=None, type=None, choices=None, help=None, metavar=None) which is not consistent with this: parser.add_argument('foo', nargs=0) ... raise ValueError('nargs for store actions must be 0; if you ' ValueError: nargs for store actions must be 0; if you have nothing to store, actions such as store true or store const may be more appropriate -- components: Library (Lib) keywords: easy messages: 180012 nosy: bethard, chris.jerdonek priority: normal severity: normal stage: needs patch status: open title: argparse: bad nargs value raises misleading message type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16970 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16422] Decimal constants should be the same for py c module versions
Stefan Krah added the comment: In the absence of an enum type, string constants are nicer to read in the REPL, so here's a patch. Translating between strings and ints is fast if you use the module constants. -- keywords: +patch Added file: http://bugs.python.org/file28736/issue16422.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16422 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12939] Add new io.FileIO using the native Windows API
Richard Oudkerk added the comment: New patch reflecting Amaury's comments. -- Added file: http://bugs.python.org/file28737/winfileio.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12939] Add new io.FileIO using the native Windows API
Changes by Richard Oudkerk shibt...@gmail.com: Removed file: http://bugs.python.org/file28707/winfileio.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15994] memoryview to freed memory can cause segfault
Changes by Christian Heimes li...@cheimes.de: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15994 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10527] multiprocessing.Pipe problem: handle out of range in select()
Roundup Robot added the comment: New changeset f07435fa6736 by Richard Oudkerk in branch '2.7': Issue #10527: Remove dead code http://hg.python.org/cpython/rev/f07435fa6736 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10527 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10527] multiprocessing.Pipe problem: handle out of range in select()
Roundup Robot added the comment: New changeset 49d45151b9ed by Richard Oudkerk in branch '3.2': Issue #10527: Remove dead code http://hg.python.org/cpython/rev/49d45151b9ed -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10527 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14850] The inconsistency of codecs.charmap_decode
Roundup Robot added the comment: New changeset 33a8ef498b1e by Serhiy Storchaka in branch '2.7': Issue #14850: Now a chamap decoder treates U+FFFE as undefined mapping http://hg.python.org/cpython/rev/33a8ef498b1e New changeset 13cd78a2a17b by Serhiy Storchaka in branch '3.2': Issue #14850: Now a chamap decoder treates U+FFFE as undefined mapping http://hg.python.org/cpython/rev/13cd78a2a17b New changeset 6ac4f1609847 by Serhiy Storchaka in branch '3.3': Issue #14850: Now a chamap decoder treates U+FFFE as undefined mapping http://hg.python.org/cpython/rev/6ac4f1609847 New changeset 03e22cc9407a by Serhiy Storchaka in branch 'default': Issue #14850: Now a chamap decoder treates U+FFFE as undefined mapping http://hg.python.org/cpython/rev/03e22cc9407a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14850 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16971] Refleaks in charmap decoder
New submission from Serhiy Storchaka: Charmap decoder can leak a reference in case of error. -- components: Unicode files: charmap_decode_leaks-3.3.patch keywords: 3.3regression, patch messages: 180018 nosy: ezio.melotti, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Refleaks in charmap decoder type: resource usage versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28738/charmap_decode_leaks-3.3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16971] Refleaks in charmap decoder
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28739/charmap_decode_leaks-3.4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14850] The inconsistency of codecs.charmap_decode
Serhiy Storchaka added the comment: Fixed. Thank you for your answers, Martin. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14850 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14850] The inconsistency of codecs.charmap_decode
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14850 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16971] Refleaks in charmap decoder
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16971] Refleaks in charmap decoder
Ezio Melotti added the comment: How difficult would it be to write a test for this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
R. David Murray added the comment: Since the line between a type error and a value error is fuzzy anyway, I'd be in favor of maintaining the backward compatibility here. We don't consider exception message content part of the API (though we do occasionally work to preserve it when we know people are depending on it), but the exception *types* generally are. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16972] Useless function call in site.py
New submission from Kirill: In Lib/site.py:149 [1] _init_pathinfo call has no effect. Looks like it's here because in the past _init_pathinfo was changing a global variable [2]. I believe that it should be changed to `known_paths = _init_pathinfo()`, in the same way as it's done in addsitedir function [3]. [1] http://hg.python.org/cpython/file/fb17969ace93/Lib/site.py#l149 [2] http://hg.python.org/cpython/annotate/ac13a6ce13e2/Lib/site.py#l102 [3] http://hg.python.org/cpython/file/fb17969ace93/Lib/site.py#l189 -- components: Library (Lib) files: patch.diff keywords: patch messages: 180022 nosy: x746e priority: normal severity: normal status: open title: Useless function call in site.py type: enhancement Added file: http://bugs.python.org/file28740/patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16972 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: Sounds fine. Does that mean a test should still be added for the message? I was never clear on this because on the one hand we want to be sure we use the right message (and that we're actually fixing the issue), but on the other hand we don't want the message to be part of the API. By the way, to make things slightly less brittle, I could be clever and trigger a TypeError to get the right message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: I guess another option would be to mark the test CPython-only. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13773] Support sqlite3 uri filenames
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13773] Support sqlite3 uri filenames
Antoine Pitrou added the comment: This would definitely be useful. I would have liked to have this feature today. poq, could you sign a contributor agreement? See http://www.python.org/psf/contrib/ Also, it's better if you can use a real name (or at least a well-known pseudonym). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9303] Migrate sqlite3 module to _v2 API to enhance performance
Antoine Pitrou added the comment: This would be nice to have in 3.4. When were the _v2 APIs introduced? See also issue13773 which uses sqlite3_open_v2() to pass some flags. -- nosy: +larry, pitrou versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9303 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15861] ttk.Treeview unmatched open brace in list
Roundup Robot added the comment: New changeset 411bb75be5d1 by Serhiy Storchaka in branch '3.2': Issue #15861: tkinter now correctly works with lists and tuples containing http://hg.python.org/cpython/rev/411bb75be5d1 New changeset 927352d7e994 by Serhiy Storchaka in branch '3.3': Issue #15861: tkinter now correctly works with lists and tuples containing http://hg.python.org/cpython/rev/927352d7e994 New changeset 340e97ebe911 by Serhiy Storchaka in branch 'default': Issue #15861: tkinter now correctly works with lists and tuples containing http://hg.python.org/cpython/rev/340e97ebe911 New changeset 917ae14831ec by Serhiy Storchaka in branch '2.7': Issue #15861: tkinter now correctly works with lists and tuples containing http://hg.python.org/cpython/rev/917ae14831ec -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15861 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15861] ttk.Treeview unmatched open brace in list
Serhiy Storchaka added the comment: Fixed. Thank you for report, Bryan Oakley. -- resolution: - fixed stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15861 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15861] ttk.Treeview unmatched open brace in list
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15861 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16973] Extending the datetime package by adding a workDayMath module
New submission from Grant: This module would allow programmers to perform high level workday addition and subtraction - a commonly needed function in the finance and accounting world not yet provided in a standard python module. -- components: Extension Modules files: workDayMath.py messages: 180029 nosy: belopolsky, grantf priority: normal severity: normal status: open title: Extending the datetime package by adding a workDayMath module type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file28741/workDayMath.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16973 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11290] ttk.Combobox['values'] String Conversion to Tcl
Serhiy Storchaka added the comment: Fixed in issue15861. Thank you for report, Clayton Darwin. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11290 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16973] Extending the datetime package by adding a workDayMath module
Ezio Melotti added the comment: I think it would be better to propose this on the Python-ideas mailing list first. Adding a new module usually requires a PEP, and the module should be tested in the wild beforehand (i.e. it should be published on PyPI and should have a decent user base). The module you attached also doesn't respect some of the guidelines listed in the PEP 8. -- components: +Library (Lib) -Extension Modules nosy: +ezio.melotti resolution: - rejected stage: - committed/rejected status: open - closed versions: +Python 3.4 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16973 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
R. David Murray added the comment: CPython only would not be appropriate, as it is not. What I usually do in such cases is use AssertRaisesRegex looking for some critical part of the message that represents the functionality we are looking for rather than the exact text. In this case, it would be looking for the type name of the problem value in the message, since that is how we are identifying the specific source of the error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9501] Logging shutdown regressions with weakrefs
Xavier de Gaye added the comment: Still randomly getting ignored exceptions on 3.3 and the default branch, got for example: Exception TypeError: TypeError(argument of type 'NoneType' is not iterable,) in function _removeHandlerRef at 0x7fcbe6014200 ignored This happens in a threaded application. The root cause is explained in http://bugs.python.org/issue1722344#msg62078 Instead of building a test case to reproduce the problem, the attached teardown_module.py script is a contrived example that shows the issue 9501 is not fully fixed. Ignored exceptions appear randomly, so teardown_module.py must be run in a loop, for example: $ while [ 1 ]; do python teardown_module.py; sleep .1; done The attached patch fix the issue by testing all the globals used in _removeHandlerRef and teardown_module.py runs fine with this patch applied. -- nosy: +xdegaye Added file: http://bugs.python.org/file28742/teardown_module.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9501] Logging shutdown regressions with weakrefs
Changes by Xavier de Gaye xdeg...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file28743/teardown_module.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6933] Threading issue with Tkinter Frame.insert
Serhiy Storchaka added the comment: Tkinter as perhaps any other GUI library must be used only from one thread. -- nosy: +serhiy.storchaka, terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6933 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6160] Tkinter.Spinbox: fix for bbox and removed some uninteresting returns
Serhiy Storchaka added the comment: It should be self._getints(...) or None as in other methods. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6160 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4333] Reworked Dialog.py
Serhiy Storchaka added the comment: Can you please update the patch for the default branch tip? It looks too outdated. -- nosy: +serhiy.storchaka versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4333 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15019] String termination on Linux
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15019 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6167] Tkinter.Scrollbar: the activate method needs to return a value, and set should take only two args
Serhiy Storchaka added the comment: In versions of Tk before 4.0, the set command accepted 4 arguments. I think this is a new feature and can be applied only to 3.4. Agree with Jim that for backward compatibility we should keep name index and arbitrary number of arguments at least for one release (with deprecation warnings etc). -- nosy: +serhiy.storchaka type: behavior - enhancement versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6167 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6225] Fixing several minor bugs in Tkinter.Canvas and one in Misc._configure
Serhiy Storchaka added the comment: For backward compatibility we must keep accepting arbitrary amount of arguments at least a one release (with warnings). -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6225 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9501] Logging shutdown regressions with weakrefs
Roundup Robot added the comment: New changeset 966887830011 by Vinay Sajip in branch '2.7': Issue #9501: Improved shutdown handling to deal with module attributes correctly. http://hg.python.org/cpython/rev/966887830011 New changeset 8eac88f49cc0 by Vinay Sajip in branch '3.2': Issue #9501: Improved shutdown handling to deal with module attributes correctly. http://hg.python.org/cpython/rev/8eac88f49cc0 New changeset 3161a94ff73c by Vinay Sajip in branch '3.3': Issue #9501: Merged fix from 3.2. http://hg.python.org/cpython/rev/3161a94ff73c New changeset 4fd8c35a05b2 by Vinay Sajip in branch 'default': Issue #9501: Merged fix from 3.3. http://hg.python.org/cpython/rev/4fd8c35a05b2 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16971] Refleaks in charmap decoder
Serhiy Storchaka added the comment: Enough difficult. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16968] Fix test discovery for test_concurrent_futures.py
Zachary Ware added the comment: Hmmm, actually, I was wrong; Brett's suggestion doesn't cover running as part of regrtest. It looks like Chris is right and some kind of load_tests magic will have to happen. I'm looking into it now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16968 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15436] __sizeof__ is not documented
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16643] Wrong documented default value for timefunc parameter in sched.scheduler()
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16643 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16700] Document that bytes OS API can returns unusable results on Windows
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16700 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15984] Wrong documentation for PyUnicode_FromObject()
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15984 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7340] Doc for sys.exc_info has warning that is no longer valid
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +easy versions: +Python 3.3, Python 3.4 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7468] PyErr_Format documentation doesn't mention all format codes
Serhiy Storchaka added the comment: Fixed in r86838. -- nosy: +serhiy.storchaka resolution: - out of date stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9669] regexp: zero-width matches in MIN_UNTIL
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - needs patch versions: +Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9669] regexp: zero-width matches in MIN_UNTIL
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Regular Expressions ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12939] Add new io.FileIO using the native Windows API
Antoine Pitrou added the comment: The current patch does not support overlapped IO, but that could be added easily enough. (Overlapped IO for normal files might be more complicated.) That could be cool. Wouldn't it belong in the fabled winapi module? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9889] PyUnicode_FormatV and Py_UNICODE*?
Serhiy Storchaka added the comment: The Py_UNICODE* representation is deprecated since 3.3. New features can be added only to 3.4. -- nosy: +serhiy.storchaka resolution: - rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9889 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10590] Parameter type error for xml.sax.parseString(string, ...)
Serhiy Storchaka added the comment: Indeed, xml.dom.minidom.parseString() and xml.etree.ElementTree.fromstring() accepts both bytes and strings, xml.dom.minidom.parse(), xml.etree.ElementTree.parse() and even xml.sax.parse() accepts both byte and text streams. Only xml.sax.parseString() rejects strings in contrast to its name. This looks as 2 to 3 porting bug. -- components: +Unicode nosy: +ezio.melotti, serhiy.storchaka stage: - needs patch versions: +Python 3.2, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10590 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10701] Error pickling a dict
Serhiy Storchaka added the comment: It's interesting. The example behaves unstable on 3.3+ with C implementation of picle, sometimes works, sometimes fails. With Python implementation and on 3.2 it works always. On 2.7 it fails always. A difference between C and Python implementations of pickle is a bug and should be fixed. -- nosy: +alexandre.vassalotti, pitrou, serhiy.storchaka versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10701 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11367] xml.etree.ElementTree.find(all): docs are wrong
Serhiy Storchaka added the comment: Already fixed in 3.3+. -- keywords: +easy nosy: +eli.bendersky, serhiy.storchaka stage: - needs patch type: - enhancement versions: +Python 2.7, Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11367 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10701] Error pickling a dict
Antoine Pitrou added the comment: I find the posted code mystifying. As the name suggests, __getstate__ should probably not mutate anything. It would be nice if you could post a simpler example to reproduce issue. Even better if it doesn't have a mutating __getstate__, I would say. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10701 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Terry J. Reedy added the comment: The exception question is messy, but I think it is the wrong question. The doc is correct in that it says what the code should be doing. To test whether an argument is in a collection of choices, the code should just say that: 'arg in choices' (as far as I know, it does -- for the actual check). In other words, I think the original intent of this issue is correct. Clearly the module was written under the assumption (in multiple places) that choices are iterable. I think it should not. We implement 'in' with '__contains__', rather than forcing the use of iteration, for good reason. I discussed some examples in msg175520. As far as I know, the reason argparse iterates is to bypass the object's representation methods and produce custom, one-size-fits-all, usage and error messages. As discussed in #16418, this supposed user-friendliness may not be. To me, restricting input for this reason is a tail-wags-dog situation. If the object is not iterable, just use repr for the messages instead of exiting. Let the app writer be responsible for making them user-friendly and not absurdly long. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely
David Beazley added the comment: I have run into this bug myself. Agree that a file-like object should never report itself as closed unless .close() has been explicitly called on it. HTTPResponse should not return itself as closed after the end-of-file has been reached. I think there is also a bug in the implementation of TextIOWrapper as well. Even if the underlying file reports itself as closed, previously read and buffered data should be processed first before reporting an error about the file being closed. -- nosy: +dabeaz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16723 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9669] regexp: zero-width matches in MIN_UNTIL
Matthew Barnett added the comment: I've attached my attempt at a patch. -- keywords: +patch Added file: http://bugs.python.org/file28744/issue9669.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: I don't disagree that this feature could be useful. I'm just not sure it should go into a maintenance release. It feels like an enhancement to me because to use this feature, the user will have to use the API in a way they haven't before, and we will probably have to do things like add documentation and examples for this new use case (e.g. explaining that users passing non-iterable choices will need to implement a user-friendly repr() for help to render nicely). Also, it introduces new questions like: if we're going to be using repr() for that case, then why wouldn't we allow repr() to be used for iterable choices if the user would like to better control the behavior (e.g. for very long lists)? Why not have a unified way to deal with this situation (e.g. something like __argparse_repr__ with a better name, or else provide or document that certain formatters should be used)? These don't seem like bug-fix questions. As far as I know, the reason argparse iterates is to bypass the object's representation methods and produce custom, one-size-fits-all, usage and error messages. Another possibility is that it was the most helpful message for the use case the writers originally had in mind. Certainly, for example, seeing the available choices '0, 1, 2, 3, 4' is more useful than seeing 'xrange(5)'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: Note that we would also have to deal with not just the error text but also the usage string. From the docs: parser.parse_args('11'.split()) usage: PROG [-h] {5,6,7,8,9} PROG: error: argument foo: invalid choice: 11 (choose from 5, 6, 7, 8, 9) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12983] byte string literals with invalid hex escape codes raise ValueError instead of SyntaxError
Serhiy Storchaka added the comment: Here is a patch which include position number in the invalid bytes exception, wrap it into SyntaxError, and adds tests for bytes and strings. -- keywords: +patch nosy: +serhiy.storchaka stage: test needed - patch review versions: +Python 3.4 Added file: http://bugs.python.org/file28745/parse_strlit_error.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12983 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16974] when python -c command does a traceback, it open the file string
New submission from Eric Lammerts: $ echo lovely spam string $ python -c 'open(nonexistent,r)' Traceback (most recent call last): File string, line 1, in module lovely spam IOError: [Errno 2] No such file or directory: 'nonexistent' I see this in python 2.7.3 and 3.2.3 from Ubuntu 12.04. -- messages: 180055 nosy: eric-bugs-python priority: normal severity: normal status: open title: when python -c command does a traceback, it open the file string type: behavior versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16975] Broken error handling in codecs.escape_decode()
New submission from Serhiy Storchaka: import codecs codecs.escape_decode(r'\x1\x2\x3\x4\x5\x6\x7\x8\x9', 'replace') (b'?\\x1?\\x2?\\x3?\\x4?\\x5?\\x6?\\x', 27) codecs.escape_decode(r'\x1\x2\x3\x4\x5\x6\x7\x8\x9' * 1000, 'replace') Segmentation fault -- components: Interpreter Core messages: 180056 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Broken error handling in codecs.escape_decode() type: crash versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16975 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9669] regexp: zero-width matches in MIN_UNTIL
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7340] Doc for sys.exc_info has warning that is no longer valid
Roundup Robot added the comment: New changeset 3fa3e7975724 by Benjamin Peterson in branch '3.3': remove warning about tb circular reference (closes #7340) http://hg.python.org/cpython/rev/3fa3e7975724 New changeset d866bbdd68e8 by Benjamin Peterson in branch 'default': merge 3.3 (#7340) http://hg.python.org/cpython/rev/d866bbdd68e8 -- nosy: +python-dev resolution: accepted - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16976] Asyncore/asynchat hangs when used with ssl sockets
New submission from Anthony Lozano: If you create a asynchat subclass with a SSL socket asyncore can hang when data larger than the ac_in_buffer_size comes in. What (I think) happens is that asyncore uses a select.select call to determine when to read more data from the socket. On the first call, this will correctly see that there is data to recv and we will continue on to the handle_read function in asynchat. Once there, if there is more than ac_in_buffer_size data to read, handle_read will not find the terminator, and thus not call find_terminator, expecting to find it on the next pass with another self.recv. Unfortunately, the SSL wrapped socket will not play nicely with next select call (the one that should be triggering the next handle_read) because the ssl socket might internally read more data, and select is looking at the raw socket which is empty now thanks to ssl (at least according to an answer here: http://stackoverflow.com/questions/3187565/select-and-ssl-in-python). A solution would be to check the if the socket has any data pending with the sslsock.pending() method and read the rest out. I am doing this in the handle_read function of my child class as attached, but I don't know if that's a generic enough solution for everyone. -- components: None files: asychat_fix.py messages: 180058 nosy: Anthony.Lozano priority: normal severity: normal status: open title: Asyncore/asynchat hangs when used with ssl sockets type: crash versions: Python 2.7 Added file: http://bugs.python.org/file28746/asychat_fix.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16976 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16886] Doctests in test_dictcomp depend on dict order
Frank Wierzbicki added the comment: I have addressed all of the comments, but I don't know the exact procedure here. Does someone need to say Looks good to me before I push? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16886 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16976] Asyncore/asynchat hangs when used with ssl sockets
Changes by Anthony Lozano amloza...@gmail.com: -- type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16976 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16976] Asyncore/asynchat hangs when used with ssl sockets
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16976 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16886] Doctests in test_dictcomp depend on dict order
Serhiy Storchaka added the comment: If you addressed last Ezio's comments, it will be good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16886 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16976] Asyncore/asynchat hangs when used with ssl sockets
Giampaolo Rodola' added the comment: asyncore simply does not support SSL. That is tracked in issue 10084. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16976 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16886] Doctests in test_dictcomp depend on dict order
R. David Murray added the comment: The ideal is if someone says looks good to me. The practical path is that if you have addressed all the comments, and no one objects after a couple-three days, you should feel free to commit (unless you feel like you want another review, in which case you can ask for one). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16886 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16974] when python -c command does a traceback, it open the file string
R. David Murray added the comment: Heh. Nice find. I'm not sure how practical it is to fix, though. We don't have any actual rules about what indicates a 'non-file-stand-in' for the __file__ attribute, just a loose convention that it is an identifier in angle brackets. If we make that a hard rule, though, and someone really has a file named 'string' :) -- nosy: +r.david.murray versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9501] Logging shutdown regressions with weakrefs
Xavier de Gaye added the comment: The reason why this happens in python 3.3.0 and not in 3.2: 1) lastResort holds a reference to an instance of _StderrHandler at module tear down, thus potentially triggering a TypeError in _removeHandlerRef. 2) The logging code has the following two lines that are meant to avoid the occurence of this problem: _defaultLastResort = _StderrHandler(WARNING) lastResort = _defaultLastResort Issue 12637 describes another unrelated problem with lastResort in python 3.2. As a workaround to this issue 12637, my application sets lastResort to None and this works fine in 3.2 (the logging howto states 'To obtain the pre-3.2 behaviour, logging.lastResort can be set to None'). With python 3.3 it is this setting of lastResort to None that causes these spurious 'exception ignored' messages, after removing this setting no messages are printed anymore. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9501] Logging shutdown regressions with weakrefs
Xavier de Gaye added the comment: The initial teardown_module.py can be simply replaced with (not a contrived example anymore) the following statements to print the spurious ignored Exceptions: # Run the script in a loop: # while [ 1 ]; do python3 teardown_module.py; sleep .1; done import logging logging.lastResort = None print('Fin') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16969] test_urlwithfrag fail
Ry Erickson added the comment: ./python -m test -v test_urllib2net == CPython 3.3.0 (default, Jan 14 2013, 20:45:36) [GCC 4.6.1] == Linux-3.0.0-29-generic-i686-with-debian-wheezy-sid little-endian == /home/ry/Desktop/Python-3.3.0/build/test_python_2080 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1) [1/1] test_urllib2net test_urllib2net skipped -- Use of the 'network' resource not enabled 1 test skipped: test_urllib2net Those skips are all expected on linux. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16969 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Terry J. Reedy added the comment: I took a good look at the 3.3 code. With respect to the main purpose of choices -- checking user input -- argparse does not require that choices be iterable, as it *does* use 'in', as it should. Line 2274: if action.choices is not None and value not in action.choices: So unless the usage message is generated even when not needed (I did not delve that far), non-iterables should work now as long as the user does not request the usage message or make an input mistake. If that is so, then this issue is strictly about the string representation of non-iterable choices. A mis-behaving tail is not a reason to kill the dog ;-). The easy answer, and the only sensible one I see, is to use either str() or repr(). But how to do that? I think this and #16418 have to be fixed together. The current format-by-iteration method, used for both usage and exceptions, works well for small iterable collections. But it is obnoxious for non-small collections. As I mentioned before, it will just hang for infinite iterables, which is even worse. So the method needs to be changed anyway. And to do that, it should be factored out of the three places where it is currently done in-line. At 557: elif action.choices is not None: choice_strs = [str(choice) for choice in action.choices] result = '{%s}' % ','.join(choice_strs) To match the code below, so it can be factored out into a function, change the last two lines to choices_str = ','.join(str(c) for c in action.choices) result = '{%s}' % choices_str At 597: (note that 'params' is adjusted action.__dict__) if params.get('choices') is not None: choices_str = ', '.join([str(c) for c in params['choices']]) params['choices'] = choices_str The intermediate list in the 2nd line is not needed choices_str = ', '.join(str(c) for c in params['choices']) I am aware of but do not understand ',' versus ', ' as joiner. I also do not understand why both versions of choices_str are needed. Are there two different usage messages? At 2276: 'choices': ', '.join(map(repr, action.choices))} or, replacing map with comprehension choices_str = ', '.join(repr(c) for c in action.choices) 'choices': choices_str} Now define choices_str(src, joiner, rep), delete 559 and 598, and modify 559: ... result = '{%s}' % choices_str(action.choices, ',', str) 599: ... params['choices'] = choices_str(param['choices'], ', ', str) 2276: ... 'choices': choices_str(action.choices, ', ', repr} (I am assuming that the two joiners are really needed. If not, delete.) Now we should be able to write choices_str to solve all 3 problems in the two issues. My coded suggestion: from itertools import islice N = 21 # maximum number (+1) of choices for the current nice string. # This is just an illustrative value, experiment might show better #. def choices_str(src, joiner, rep): prefix = list(islice(src, N)) if len(prefix) N: # short iterables return joiner.join(rep(c) for c in prefix) # current string else: try: # non-short sliceable finite sequences head = joiner.join(rep(c) for c in src[:N//2]) tail = joiner.join(rep(c) for c in src[N//4:]) return head + ' ..., ' + tail except AttributeError: # no __getindex__(slice), everything else return repr(src) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16977] argparse: mismatch between choices parsing and usage/error message
New submission from Chris Jerdonek: When passing a string for the choices argument, argparse's usage and error messages differ from its behavior: p = argparse.ArgumentParser() p.add_argument('a', choices='abc') p.parse_args(['d']) usage: [-h] {a,b,c} : error: argument a: invalid choice: 'd' (choose from 'a', 'b', 'c') p.parse_args(['bc']) Namespace(a='bc') This is because argparse uses the in operator instead of sequence iteration to check whether an argument value is valid. Any resolution should also consider the behavior for string subclasses as well as perhaps bytes-like objects. -- components: Library (Lib) messages: 180068 nosy: chris.jerdonek priority: normal severity: normal stage: test needed status: open title: argparse: mismatch between choices parsing and usage/error message type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16977 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16977] argparse: mismatch between choices parsing and usage/error message
Chris Jerdonek added the comment: I forgot to mention that argparse uses such cases as examples in its documentation (one of which was replaced in bddbaaf332d7). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16977 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15359] Sockets support for CAN_BCM
Brian Thorne added the comment: I've added a single BCM test. Any feedback on it would be good and then I'll add more complex ones. Should the documentation be updated in this patch as well? -- Added file: http://bugs.python.org/file28747/bcm2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15359 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Chris Jerdonek added the comment: argparse does not require that choices be iterable, as it *does* use 'in', as it should. Line 2274: if action.choices is not None and value not in action.choices: There are cases where it's incorrect for argparse to being using in instead of sequence iteration, which again leads me to think that iteration is what was intended. See issue 16977. So unless the usage message is generated even when not needed (I did not delve that far), non-iterables should work now as long as the user does not request the usage message or make an input mistake. As I said in the second comment of this issue, this doesn't work in any case because the ValueError is raised on add_argument(). So I don't see how the lack of this option can be affecting any users. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16974] when python -c command does a traceback, it open the file string
Ramchandra Apte added the comment: Well, it should't open string IMHO. -- nosy: +ramchandra.apte ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16974] when python -c command does a traceback, it open the file string
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16972] Useless function call in site.py
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16972 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5773] Crash on shutdown after os.fdopen(2) in debug builds
Ramchandra Apte added the comment: Is this still valid because this seems fixed in latest Python 3.4 tip. -- nosy: +ramchandra.apte ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5773 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16974] when python -c command does a traceback, it open the file string
Eric Lammerts added the comment: Does it have to be an identifier in angle brackets? An empty string makes more sense to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16978] fix grammar in 'threading' documentation
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- assignee: docs@python components: Documentation files: grammar.diff keywords: patch nosy: docs@python, tshepang priority: normal severity: normal status: open title: fix grammar in 'threading' documentation versions: Python 2.7 Added file: http://bugs.python.org/file28748/grammar.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16978 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16468] argparse only supports iterable choices
Terry J. Reedy added the comment: _Actions_container(object) [1198 in 3.3.0 code] .add_argument() [1281] does not directly check for choices.__iter__ ('__iter__' is not in the file). Nor does it use the 3.x-only alternative isinstance(choices, collections) ('Iterable' is also not in the file). Rather it formats the help string for each argument as added. The complete statement that raises the error is (now at 1321): try: self._get_formatter()._format_args(action, None) except TypeError: raise ValueError(length of metavar tuple does not match nargs) def _get_formatter is part of class ArgumentParser(_AttributeHolder, _ActionsContainer): so 'self' has to be an ArguementParser for the above exception. _format_args calls get_metavar, which is returned by _metavar_formatter. The last contains the first of the three choices iterations that I propose to factor out and revise. So that proposal should eliminate the particular exception from add_argument. The docstring for class Action mirrors the doc: ''' - choices -- A container of values that should be allowed. If not None, after a command-line argument has been converted to the appropriate type, an exception will be raised if it is not a member of this collection. ''' This directly translates to the code line if action.choices is not None and value not in action.choices: Trying to prettily format messages peripheral to the main goal should not take indefinitely or infinitely long, nor make the message worse, nor raise an exception. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16969] test_urlwithfrag fail
Ezio Melotti added the comment: Sorry, the right command is: ./python -m test -v -uall test_urllib2net -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16969 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16697] argparse kwarg 'choices' documentation
Changes by wim glenn wim.gl...@gmail.com: -- nosy: -wim.glenn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16697 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com