[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ 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
paul j3 added the comment: chris.jerdonek wrote: Also, to answer a previous question, the three places in which the choices string is used are: in the usage string (separator=','), in the help string when expanding %(choices)s (separator=', '), and in the error message text (separator=', ' with repr() instead of str()). In the usage string, the ',' is used to make a compact representation of the choices. The ', ' separator is used in the help line, where space isn't as tight. This 'choices formatting' is called during 'add_argument()' simply as a side effect of checking for valid parameters, especially 'nargs' (that it, is an integer or an acceptable string). Previously 'nargs' errors were not caught until 'parse_args' was used. This is discussed in http://bugs.python.org/issue9849 Argparse needs better error handling for nargs http://bugs.python.org/issue16970 argparse: bad nargs value raises misleading message On the issue of what error type to raise, my understanding is that 'ArgumentError' is the preferred choice when it affects a particular argument. parse_args() nearly always raises an ArgumentError. Once add_argument has created an action, it too can raise an ArgumentError. ArgumentError provides a standard way of identifying which action is giving the problem. While testing 'metavar=range(0,20)', I discovered that the usage formatter strips off parenthesis. A regex expression that removes excess 'mutually exclusive group' notation is responsible for this. The simple fix is to modify the regex so it distinguishes between ' (...)' and 'range(...)'. I intend to create a new issue for this, since it affects any metavar the includes (). -- ___ 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
[issue18336] codecs: Link to readline module (history) instead of fd.readline()
New submission from Thomas Guettler: The documentation of codecs.readline() has a link to the readline module. That the same word with a total different meaning! http://docs.python.org/2/library/codecs.html?highlight=readline#codecs.StreamReader.readline The GNU readline module is about the history like bash or interactive python. -- assignee: docs@python components: Documentation messages: 192111 nosy: docs@python, guettli priority: normal severity: normal status: open title: codecs: Link to readline module (history) instead of fd.readline() versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18336 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18337] codecs: StremReader readline() breaks on undocumented characters
New submission from Thomas Guettler: The stream reader of codecs.open() breaks on undocumented characters: http://docs.python.org/2/library/codecs.html?highlight=codecs%20readline#codecs.StreamReader.readline import tempfile temp=tempfile.mktemp() fd=open(temp, 'wb') fd.write('abc\ndef\x85ghi') fd.close() import codecs fd=codecs.open(temp, 'rb', 'latin1') while True: line=fd.readline() if not line: break print repr(line) Result: u'abc\n' u'def\x85' u'ghi' Related: http://stackoverflow.com/questions/16227114/utf-8-files-read-in-python-will-line-break-at-character-x85 -- assignee: docs@python components: Documentation messages: 192112 nosy: docs@python, guettli priority: normal severity: normal status: open title: codecs: StremReader readline() breaks on undocumented characters versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18337 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute
Nick Coghlan added the comment: Unfortunately, it's not that simple, as calling type(name, bases, namespace) is *exactly* what a subclass will do as part of creating the type object. From inside the type implementation, we can't tell the difference between properly called from the child type and improperly called without preparing the namespace first. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Nick Coghlan added the comment: It turns out there's one slight wrinkle in this grand plan: it won't work for docstrings without some additional tweaking to allow for method calls in the docstring detection. def f(): ... example.lower() ... print(f.__doc__) None import dis dis.dis(f) 2 0 LOAD_CONST 1 ('example') 3 LOAD_ATTR0 (lower) 6 CALL_FUNCTION0 (0 positional, 0 keyword pair) 9 POP_TOP 10 LOAD_CONST 0 (None) 13 RETURN_VALUE -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Nick Coghlan added the comment: I still think the methods are worth adding regardless - I just anticipate a request to allow method calls on docstrings to follow not long after ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18336] codecs: Link to readline module (history) instead of fd.readline()
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: docs@python - serhiy.storchaka keywords: +easy nosy: +serhiy.storchaka stage: - needs patch versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18336 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Serhiy Storchaka added the comment: str already have too many methods. Who uses str.swapcase() or str.zfill() now? I'm -0.5 for adding any new str methods. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18337] codecs: StremReader readline() breaks on undocumented characters
Serhiy Storchaka added the comment: Thank you for your report. This is a duplicate of issue18291. -- nosy: +serhiy.storchaka resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - codecs.open interprets space as line ends versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18337 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18291] codecs.open interprets space as line ends
Serhiy Storchaka added the comment: In contrary to documentation str.splitlines() splits lines not only on '\n', '\r\n' and '\r'. 'a'.join(chr(i) for i in range(32)).splitlines(True) ['\x00a\x01a\x02a\x03a\x04a\x05a\x06a\x07a\x08a\ta\n', 'a\x0b', 'a\x0c', 'a\r', 'a\x0ea\x0fa\x10a\x11a\x12a\x13a\x14a\x15a\x16a\x17a\x18a\x19a\x1aa\x1ba\x1c', 'a\x1d', 'a\x1e', 'a\x1f'] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering
Changes by Łukasz Langa luk...@langa.pl: Added file: http://bugs.python.org/file30738/issue18244.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18338] option --version should send output to STDOUT
New submission from Jari Aalto: C.f. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603851 When user is calling program with options, it is not an error condition to run: python --version The output is now sent to stderr. Please change to send to stdout as in other *nix utilities, in order to collect in shell scrips: version=$(python --version) -- components: Interpreter Core messages: 192119 nosy: jaalto priority: normal severity: normal status: open title: option --version should send output to STDOUT versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18240] hmac unnecessarily restricts input to bytes
Roundup Robot added the comment: New changeset 636947fe131e by Christian Heimes in branch 'default': Issue 18240: The HMAC module is no longer restricted to bytes and accepts http://hg.python.org/cpython/rev/636947fe131e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18240 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18240] hmac unnecessarily restricts input to bytes
Christian Heimes added the comment: Your CLA came through and I have applied your patch. Thank you very much for your contribution! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18240 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18338] option --version should send output to STDOUT
Christian Heimes added the comment: Your proposal is reasonable. I'm flagging it for Python 3.4+ as it's a backward incompatible modification. -- nosy: +christian.heimes stage: - needs patch type: - behavior versions: +Python 3.4 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18236] str.isspace should use the Unicode White_Space property
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18236 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18291] codecs.open interprets space as line ends
R. David Murray added the comment: There are two issues that I could find related to these characters, one of them still open: #18236 and #7643. The latter contains a fairly complete discussion of the underlying issue, but on a quick read through it is not clear to me if the linebreak issue was actually completely addressed. It would be good if someone unicode knowledgeable would read through that issue and see if the current state of affairs is in fact correct, and if so (as seems likely, given that there were unicode experts weighing in on that issue) we need to improve the splitlines docs at least (as was suggested in that issue but not done). How tightly related that issue is to this one depends on how codecs and IO implement their linebreak algorithms Perhaps we should retitle this issue make Python's treatment of 'information separator' and other line break characters consistent. Since backward compatibility is an issue, if there are changes to be made there may be changes that can only be made in 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18339] Segfault in Unpickler_set_memo()
New submission from Christian Heimes: Unpickler_set_memo() crashes when the unpickler's memo attribute is set to a dict with negative numbers. The descriptor uses _Unpickler_MemoPut() which uses the dict key as index to a C array. Python 3.3.0 (v3.3.0:bd8afb90ebf2, Feb 8 2013, 00:38:29) [GCC 4.7.2] on linux Type help, copyright, credits or license for more information. import sys, pickle p = pickle.Unpickler(sys.stdin) p.memo = {-1: None} segfault The issue was found be Coverity Scan: CID 486776 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS) negative_returns: Passing variable idx to a parameter that cannot be negative. 5955if (_Unpickler_MemoPut(self, idx, value) 0) -- files: memo.patch keywords: patch messages: 192124 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: Segfault in Unpickler_set_memo() type: crash versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30739/memo.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18339 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18312] make distclean deletes files under .hg directory
STINNER Victor added the comment: Is there at least one developer against my change make_distclean.patch? If not, I suggest to apply this patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18312 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18312] make distclean deletes files under .hg directory
R. David Murray added the comment: Yes, I am against it. See python-dev for reason (it would no longer be a 'distclean'). -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18312 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18339] Segfault in Unpickler_set_memo()
Roundup Robot added the comment: New changeset 17b7af660f82 by Christian Heimes in branch '3.3': Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a http://hg.python.org/cpython/rev/17b7af660f82 New changeset f3372692ca20 by Christian Heimes in branch 'default': Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a http://hg.python.org/cpython/rev/f3372692ca20 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18339 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18339] Segfault in Unpickler_set_memo()
Changes by Christian Heimes li...@cheimes.de: -- resolution: - fixed stage: needs patch - commit review status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18339 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18244] Adopt C3-based linearization for improved ABC support in functools.singledispatch
Changes by Łukasz Langa luk...@langa.pl: -- title: singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering - Adopt C3-based linearization for improved ABC support in functools.singledispatch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18244] Adopt C3-based linearization for improved ABC support in functools.singledispatch
Roundup Robot added the comment: New changeset a2672dc7c805 by Łukasz Langa in branch 'default': Issue #18244: Adopt C3-based linearization in functools.singledispatch for improved ABC support http://hg.python.org/cpython/rev/a2672dc7c805 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14455] plistlib unable to read json and binary plist files
Ronald Oussoren added the comment: I've attached a slightly updated version of the patch. The documentation now lists dump and load as the primary API, with the old API as a deprecated alternative. The code hasn't been changed to relect this yet, but does contain a number of tweaks and bugfixes (and a new testcase that ensures that decoding UTF-16 and UTF-32 files actually works, after testing that those encodings are supported by Apple's tools). NOTE: no review of this version is needed, I'm mostly posting as backup. -- Added file: http://bugs.python.org/file30740/issue-14455-v6.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14455 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18339] Segfault in Unpickler_set_memo()
Serhiy Storchaka added the comment: Sorry that I was late with review. Here is some nitpicks from me. Using assertRaises() as context manager in this case looks cleaner to me: with self.assertRaises(ValueError): unpickler.memo = {-1: None} Moving the `if (idx == -1 PyErr_Occurred())` check inside the `if (idx 0)` block will increase the perfomance a little. -- nosy: +serhiy.storchaka status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18339 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5308] cannot marshal objects with more than 2**31 elements
Serhiy Storchaka added the comment: Good catch. There is another resource leak for general bytes-like object (the buffer can be not released). Here is a patch. -- Added file: http://bugs.python.org/file30741/marshal_string_leak.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18244] Adopt C3-based linearization for improved ABC support in functools.singledispatch
Łukasz Langa added the comment: I committed the patch with minor docstring and comment fixes; one test was tweaked to be hash randomization-proof. Edward, thanks for taking the time to file the bug. Guido, thanks for a thorough and illuminating review process. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Barry A. Warsaw added the comment: .dedent() is a no-brainer. JFDI. +1 .indent() I guess makes sense for symmetry, although I've rarely used it. -0 As for docstrings, I can imagine other alternatives, so let's let someone interested in that go through the PEP process. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18341] enhancements zlib.compress/decompress to accept Py_buffer
New submission from Jim Carroll: We were looking to squeak maximum performance out of zlib.compress. We noticed in py3k, zlib.compress already accepts Py_buffer’s, but in 2.x, compress required strings. We’ve modified the compress (and decompress for orthogonal completeness), see the attached patch. -- components: Extension Modules files: zlibmodule.c.patch keywords: patch messages: 192135 nosy: jamercee priority: normal severity: normal status: open title: enhancements zlib.compress/decompress to accept Py_buffer type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file30742/zlibmodule.c.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18341 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
New submission from V.E.O: With Intel Compiler's default options or GCC with -mfpmath=sse, the built Python failed at float related test. For failures in test_strtod: Traceback (most recent call last): File .\test_strtod.py, line 190, in test_boundaries self.check_strtod(s) File .\test_strtod.py, line 104, in check_strtod expected {}, got {}.format(s, expected, got)) AssertionError: '0x0.fp-1022' != '0x0.0p+0' - 0x0.fp-1022 + 0x0.0p+0 : Incorrectly rounded str-float conversion for 22250738585072008690e-327: expected 0x0.fp-1022, got 0x0.0p+0 22250738585072008690e-327 is less than positive normalize float 2250738585072014e-308 in sys.float_info, that is denormal float With SSE optimization opened on current compilers, Denormal Flush to Zero feature will flush all denormal float to 0 to avoid hardware unsupport and increase performance. The tests here better be skipped on DFZ opened binaries. http://bugs.python.org/issue1672332 is related to this problem. Reference: http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-3A5C3E47-250D-4178-A0D4-6C4ACDDA5EB8.htm -- components: Tests messages: 192134 nosy: V.E.O, mark.dickinson priority: normal severity: normal status: open title: float related test has problem with Denormal Flush to Zero compiler options type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Todd Rovito added the comment: Here is a uncompleted patch but works for the most part. I thought I would post just in case somebody wanted to provide me comments on the general direction of the patch. The naming might have to change but this follows Terry Reedy's model of monkey patching. -- keywords: +patch Added file: http://bugs.python.org/file30743/18226IDLEUnitTestFormatParagraph.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18292] IDLE Improvements: Unit test for AutoExpand.py
Changes by Todd Rovito rovit...@gmail.com: -- nosy: +Todd.Rovito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18302] test_multiprocessing: test.support.import_module() does not ignore the ImportError on SemLock
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18302 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
Mark Dickinson added the comment: What operating system and hardware is this on? Is there a good reason for wanting to compile with optimisations that break IEEE 754 behaviour? If Python's configure script isn't using the right options, then that's a build problem rather than a problem with the tests. I'm rather surprised if these optimizations are turned on by default on mainstream systems. By the way, what do you mean by DFZ? It's not a TLA that I'm familiar with. Do you mean FTZ (subnormal *results* get replaced by zero)? Or DAZ (subnormal *inputs* get replaced by zero)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16272] C-API documentation clarification for tp_dictoffset
Changes by Martin Kysel mar...@martinkysel.com: -- nosy: +mkysel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16272 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18342] Use the repr of a module name for ModuleNotFoundError in ceval.c
New submission from Brett Cannon: from re import bogus Traceback (most recent call last): File stdin, line 1, in module ModuleNotFoundError: cannot import name bogus Should have 'bogus' using the repr to match the other cases of ModuleNotFoundError -- assignee: brett.cannon components: Interpreter Core keywords: easy messages: 192138 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Use the repr of a module name for ModuleNotFoundError in ceval.c versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18342 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16665] doc for builtin hex() is poor
Changes by Martin Kysel mar...@martinkysel.com: -- nosy: +mkysel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17845] Clarify successful build message
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17845 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15767] add ModuleNotFoundError
Brett Cannon added the comment: Obviously no worries for opening this up again; if something isn't clear better to get it sorted out now rather than after 3.4 is out that door. So I see two questions: why isn't ImportError being raised in the ``import re.bogus`` case and why the subtle difference in exception messages. Let's deal with the latter first since it's the easiest: it's because that's how it was in Python 3.3:: python3.3 ~ Python 3.3.2 (default, Jun 19 2013, 13:30:51) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin Type help, copyright, credits or license for more information. import bogus Traceback (most recent call last): File stdin, line 1, in module ImportError: No module named 'bogus' from re import bogus Traceback (most recent call last): File stdin, line 1, in module ImportError: cannot import name bogus import re.bogus Traceback (most recent call last): File frozen importlib._bootstrap, line 1521, in _find_and_load_unlocked AttributeError: 'module' object has no attribute '__path__' During handling of the above exception, another exception occurred: Traceback (most recent call last): File stdin, line 1, in module ImportError: No module named 're.bogus'; re is not a package All I did for ModuleNotFoundError is change what exception is raised. I didn't muck with any messages in adding this exception to keep the change minimal (at least to start with). It also doesn't help that in your case [2] (the ``from re import bogus`` case) is actually not handled by importlib but ceval.c. I really hate the semantics of ``from ... import`` and __import__ in this specific instance. Hopefully it can be something I can clean up in Python 4. Anyway, it can be updated to match: http://bugs.python.org/issue18342 As for the ``import re.bogus`` case not raising ModuleNotFoundError, I'm fine with changing it. I don't have a clear recollection as to why I chose to leave it as-is, but I also can't come up with a good reason to not change it. And to explain why the ``from ... import`` case raises ModuleNotFoundError even when re is a module and obviously not a package is that while that might be true now, that does not necessarily hold in the future. If you have been using something like an object to hold attributes but then decide to switch to a module, this instance would break. Plus ``from ... import`` has never directly distinguished between a missing attribute and a missing module. Once again, something I would like to change in Python 4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17630] Create a pure Python zipfile importer
Brett Cannon added the comment: Paul's review did find one non-optimal thing the code is doing. I'll fix it the next time there's a need to upload a new patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7136] Idle File Menu Option Improvement
Todd Rovito added the comment: Terry I am sorry the push didn't go smooth. I thought I had checked the patch with 2.7 and 3.4 and it applied for me but maybe I missed something? For sure I didn't check 3.3 but from here on out I will. Awhile ago I worked on a issue to synchronize the documentation here: http://bugs.python.org/issue5066 Mr. Andrew Svetlov was kind enough to push the patch but he only pushed it for 3.4 which I am not sure why? Then Zachary Ware had the excellent suggestion of making the help.txt generate from the rst file http://bugs.python.org/issue16893. So with all that being said I am confused about the direction of IDLE documentation. Maybe we should reopen issue 5066 or create a new issue to sync help.txt and idle.rst across all version from 2.7 - 3.4? Then apply Zachary's patch to automate the creation of help.txt. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7136 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15767] add ModuleNotFoundError
Guido van Rossum added the comment: Ok, the history of all that makes sense, except now I wonder if ModuleNotFoundError is useful at all. I just reviewed a patch for 3.4 and in the latest revision all ImportError checks were replaced with ModuleNotFoundError checks. What purpose does that have except encouraging code churn? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15767] add ModuleNotFoundError
Antoine Pitrou added the comment: Le lundi 01 juillet 2013 à 16:54 +, Brett Cannon a écrit : As for the ``import re.bogus`` case not raising ModuleNotFoundError, I'm fine with changing it. +1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18327] swapped arguments in compatible_for_assignment()?
Amaury Forgeot d'Arc added the comment: Fortunately, compatible_for_assignment() handles both arguments exactly the same way, except maybe in error messages. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18327 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17097] multiprocessing BaseManager serve_client() does not check EINTR on recv
Roundup Robot added the comment: New changeset bc34fe4a0d58 by Richard Oudkerk in branch '2.7': Issue #17097: Make multiprocessing ignore EINTR. http://hg.python.org/cpython/rev/bc34fe4a0d58 New changeset 3ec5267f51ff by Richard Oudkerk in branch '3.3': Issue #17097: Make multiprocessing ignore EINTR. http://hg.python.org/cpython/rev/3ec5267f51ff New changeset 035577781505 by Richard Oudkerk in branch 'default': Issue #17097: Merge. http://hg.python.org/cpython/rev/035577781505 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17097 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18342] Use the repr of a module name for ModuleNotFoundError in ceval.c
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18342 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
Changes by Christian Heimes li...@cheimes.de: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17097] multiprocessing BaseManager serve_client() does not check EINTR on recv
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17097 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18112] PEP 442 implementation
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file30744/39731f1d2d38.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18112 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18112] PEP 442 implementation
Antoine Pitrou added the comment: Updated patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18112 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18112] PEP 442 implementation
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file30604/1d47c88412ac.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18112 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9938] Documentation for argparse interactive use
paul j3 added the comment: The exit and error methods are mentioned in the 3.4 documentation, but there are no examples of modifying them. 16.4.5.9. Exiting methods ArgumentParser.exit(status=0, message=None) ArgumentParser.error(message) test_argparse.py has a subclass that redefines these methods, though I think it is more complex than necessary. class ErrorRaisingArgumentParser(argparse.ArgumentParser): In http://bugs.python.org/file30204/test_intermixed.py , part of http://bugs.python.org/issue14191 , which creates a parser mode that is closer to optparse in style, I simply use: def error(self, message): usage = self.format_usage() raise Exception('%s%s'%(usage, message)) ArgumentParser.error = error to catch errors. https://github.com/nodeca/argparse a Javascript port of argparse, adds a 'debug' option to the ArgumentParser, that effectively redefines this error method. They use that extensively in testing. Another approach is to trap the sysexit. Ipython does that when argparse is run interactively. Even the simple try block works, though the SystemExit 2 has no information about the error. try: args = parser.parse_args('X'.split()) except SystemExit as e: print(e) Finally, plac ( https://pypi.python.org/pypi/plac ) is a pypi package that is built on argparse. It has a well developed interactive mode, and integrates threads and multiprocessing. -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9938 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Éric Araujo added the comment: IMO it’s fine that docstrings continue to live as pure string literals, and documentation tools continue to follow PEP 257’s advice. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18339] Segfault in Unpickler_set_memo()
Roundup Robot added the comment: New changeset fa0a03afe359 by Christian Heimes in branch '3.3': Issue #18339: use with self.assertRaises() to make test case more readable http://hg.python.org/cpython/rev/fa0a03afe359 New changeset de44cd866bb0 by Christian Heimes in branch 'default': Issue #18339: use with self.assertRaises() to make test case more readable http://hg.python.org/cpython/rev/de44cd866bb0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18339 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18339] Segfault in Unpickler_set_memo()
Christian Heimes added the comment: I don't think that a reordered idx 0 check is going to make any measurable difference. I like the separate checks as they make the code easier to understand. The first check tests for error in PyLong_AsSsize_t() and the second one checks for positive integers. -- stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18339 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18328] Use after free in pystate.c
Christian Heimes added the comment: I was talking about memory address reuse, too. After all the code doesn't access data at the pointer's address but rather uses the address as an identifier. I agree that the code should not behave erroneous under current circumstances. The GIL ensures serialization and provides a memory barrier. But it's hard to tell what might happen in the future and in embedded applications. It smells fishy. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18328 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18328] Use after free in pystate.c
Roundup Robot added the comment: New changeset ff30bf84b378 by Christian Heimes in branch '3.3': Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the http://hg.python.org/cpython/rev/ff30bf84b378 New changeset ebe064e542ef by Christian Heimes in branch 'default': Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the http://hg.python.org/cpython/rev/ebe064e542ef -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18328 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18328] Use after free in pystate.c
Changes by Christian Heimes li...@cheimes.de: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18328 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
Christian Heimes added the comment: I'm not able to reproduce the error on my system $ CFLAGS=-mfpmath=sse ./configure --config-cache --with-pydebug $ make $ ./python -m test test_strtod [1/1] test_strtod 1 test OK. Linux 3.5.0-28 X86_64 gcc-Version 4.7.2 Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHz -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18343] faulthandler_register_py() may use _Py_sighandler_t previous with initialization
New submission from Christian Heimes: faulthandler_register_py() may use the variable previous uninitialized if user-enabled is set. Excerpt from Coverity log: var_decl: Declaring variable previous without initializer. 711_Py_sighandler_t previous; 8. Condition !user-enabled, taking false branch 738if (!user-enabled) { CID 984060 (#1 of 1): Uninitialized scalar variable (UNINIT) 12. uninit_use: Using uninitialized value previous: field previous.sa_restorer is uninitialized. 752user-previous = previous; -- assignee: haypo messages: 192154 nosy: christian.heimes, haypo priority: normal severity: normal stage: needs patch status: open title: faulthandler_register_py() may use _Py_sighandler_t previous with initialization type: behavior versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18343 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Terry J. Reedy added the comment: The test passes as written, so I am not sure what 'mostly works' means. I said elsewhere, and revised README to match, that I changed my mind about test case names starting with 'Test'. Ending with 'Test' is much more common in /test and I decided from experience that it works better in verbose listings. A complete test of FormatParagraph might have these test cases: Is_Get_Test (with methods for is_ and get_ functions) FindTest ReformatFunctionTest ReformatClassTest I am assuming that the latter 3 will each need multiple tests. You can add blank subclasses, possibly with comments on what to do, as I did in test_grep. (While reviewing reformat_paragraph, you might consider whether you think the 'xxx Should' comments are valid.) Guido just reminded pydev readers that a proper docstring is a single summary line, with period, optionally followed by a blank line and more explanation. For multiple lines, the closing ''' should be on its own line. Idle is deficient in this regard, either omitting docstrings where needed or writing docstrings as comments or mis-formatting multiple lines. Writing tests is a good time to add or revise them because one has to understand the function to test it. See comments on review. I think putting a mock text widget and mock editor class together is one file. They should eventually be filled out, but starting with pass is ok. But see next message. -- 'Monkey-patching' is importing a module and changing a binding within the module. For Idle testing, a reason to do this is to avoid using tkinter. For example, test_config_name imports configSectionNameDialog and rebinds tkMessageBox to a mock_tk.Mbox*. This is necessary because even though methods are rebound as attributes of a dummy class in the test module, their read-only .__globals__ attribute still points to the module where they are defined. Monkey patching is only needed for global names used within the method tested. All self.xyx attribute references are resolved with the dummy instance and class. Hence mock Var is used in the dummy class but not monkey-patched into the imported module. This test does not monkey patch and does not need too. The only imported glogals are re and idleConf, and the latter does not (I presume) involve tkinter. Neither do any of the objects defined in the module. It is really handy for testing that FormatParagraph is initialized with a passed-in editwin argument, so we can simply pass in a non-gui substitute for testing. * This is done is a setup function so it can and will be undone in a matching teardown function. -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18343] faulthandler_register_py() may use _Py_sighandler_t previous with initialization
STINNER Victor added the comment: Thanks for the report! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18343 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18343] faulthandler_register_py() may use _Py_sighandler_t previous with initialization
Roundup Robot added the comment: New changeset 229dde749ed6 by Victor Stinner in branch '3.3': Issue #18343: faulthandler.register() now keeps the previous signal handler http://hg.python.org/cpython/rev/229dde749ed6 New changeset 74b7ff20e0e4 by Victor Stinner in branch 'default': (Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signal http://hg.python.org/cpython/rev/74b7ff20e0e4 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18343 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
Stefan Krah added the comment: With gcc I cannot reproduce this either. For icc perhaps we should just set -fp-model strict in ./configure. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18333] Memory leak in _pickle.c:Unpickler_set_memo()
Christian Heimes added the comment: After a good night sleep I realized it's a false positive. All gotos are inside the while block. The while block is only entered when PyDict_Size(obj) 0. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18333 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18344] _bufferedreader_read_all() may leak reference to data
New submission from Christian Heimes: Modules/_io/bufferedio.c:_bufferedreader_read_all() doesn't call Py_XDECREF(data) multiple times and may leak a reference in an error case. For example the ref leak occurs when current_size 0 and PyObject_CallMethodObjArgs(self-raw, _PyIO_str_readall, NULL) fails orbuffered_flush_and_rewind_unlocked(self) fails. There are a few more places where data isn't decrefed on return, too. CID 715364 (#2 of 2): Resource leak (RESOURCE_LEAK) leaked_storage: Variable data going out of scope leaks the storage it points to. -- components: Extension Modules messages: 192160 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: _bufferedreader_read_all() may leak reference to data type: resource usage versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18344 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18344] _bufferedreader_read_all() may leak reference to data
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +pitrou, sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18344 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15767] add ModuleNotFoundError
Brett Cannon added the comment: The impetus of ModuleNotFoundError is the need for something similar in importlib thanks to ``from ... import``. When you do something like __import__('os', fromlist=['path']), any ImportError must be silenced **if** it relates only to the fact that the module can't be found. Other errors directly related to technical errors which also raised ImportError are supposed to propagate. Before ModuleNotFoundError I was setting a made-up attribute called _not_found on ImportError and then raising the exception. I could then catch the exception and introspect for that case as necessary. See http://hg.python.org/cpython/file/3e10025346c1/Lib/importlib/_bootstrap.py for the last revision that contained _not_found. Since I had a legitimate case of wanting to differentiate between ImportError (which represents both technical errors and an inability to find a module) and the more specific case of simply not finding a module, I decided to formalize the distinction. It made sense to me so that the old try/except ImportError trick to ignore missing module could not accidentally catch the technical error use of ImportError by accident and mask the problem. Now if you still think the subclass is not worth it then I probably need a better solution than a faked private attribute on ImportError to delineate the technical error/module not found difference as I had already received one bug report asking to define what _not_found was. ImportError could grow a not_found attribute formally or even a 'reason' attribute which could be set to some enum value representing the fact the exception was triggered because the module simply wasn't found (although that seems unnecessary and more like errno from OSError). To summarize, the options I see are: 1. Back to _not_found on ImportError (only existed to start with as it was too late in 3.3 to come up with a better solution) 2. Keep ModuleNotFoundError (this option can include reverting all of the ``except ImportError`` changes I made and just allow the exception to exist if you want) 3. Add a not_found attribute to ImportError more formally (defaults to None for undefined, set to True/False to clearly signal when an obvious answer is known) 4. Add a 'reason' attribute that can be set to an enum which has a value which represents module not found I can't easily make it a private exception that I prevent from escaping importlib thanks to trying to allow the accelerated version of import to use importlib's fromlist code (see how _handle_fromlist is called with its import_ argument). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Terry J. Reedy added the comment: The patch models Text.data as a single string. But a tkinter Text contains a sequence of strings. While the single sequence works for the one test of the ...event method, a list of strings is needed for .get and many other methods with position parameters to actually work. And .get is needed for testing find_paragraph and, I am sure, other methods of other classes. I am not sure of the correct initialization, but it mostly will not matter. More troublesome is that tkinter lines start at 1, not 0. Possible responses are 1) add a dummy first line to self.data, 2) added all line number by -1 before indexing, or 3) ignore the difference as it will not matter for most tests. I like 3). Any test that cares can prepend an extra \n to the beginning of the text is loads into the editor. Choosing 3, the methods would be def __init__(self): self.data = [''] # I think def setData(self, text) self.data = text.split('\n) def getData(self): return '\n'.join(self.data) # easy so far ;-) def _decode(self, position): # private helper line, col = position.split('.') line = int(line) col = len(self.data[line]) if col == '0 lineend' else int(col) return line, col Doc string for Text.get(self, index1, index2=None) is Return the text from INDEX1 to INDEX2 (not included). Interpreting this gives def get(self, start, end=None): line, col = self._decode(start) if end is None: return self.data[line][col] else: endline, endcol = self._decode(end) if line == endline: return self.data[line][col:endcol] else: lines = [self.data[line][col:]] for i in range(line+1, endline): lines.append(self.data[i]) lines.append(self.data[endline][:endcol]) return '\n'.join(lines) This .get code can be used or adapted for .count, .dump, .delete, .replace, and even .insert. At this point, we need a test for the mock Text class. Maybe we can extract something from tkinter.Text tests. I am not sure how far to go with this; at some point (use of marks or tags?), we say Use tkinter.Text and make it a gui test.. But handling as least basic indexing and pairs of indexes seems essential to me. For gui methods like .see and .scan*, the docstring should be something short like Gui method, do nothing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function
STINNER Victor added the comment: Updated patch (version 3), addressing last issues of Mark's review: - add a simple unit test in _testcapi: check that PyLong_AsIntMax_t(INTMAX_INT - 1), PyLong_AsIntMax_t(INTMAX_MAX + 1) and PyLong_AsUintMax_t(UINTMAX_MAX + 1) fail with OverflowError - rely on stdint.h on Windows, with a fallback on __int64 for Visual Studio 2008 - PyLong_AsIntMax_t() and PyLong_AsUintMax_t() compute directly the result (rather than calling _PyLong_AsByteArray) I give you one or two days for a last review, and then I'm going to commit the new functions. -- Added file: http://bugs.python.org/file30745/intmax_t-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17870 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18342] Use the repr of a module name for ModuleNotFoundError in ceval.c
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18342 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18338] python --version should send output to STDOUT
Changes by STINNER Victor victor.stin...@gmail.com: -- title: option --version should send output to STDOUT - python --version should send output to STDOUT ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18338] python --version should send output to STDOUT
Changes by STINNER Victor victor.stin...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: I'm not sure if this is worth pursuing, but I made a mock Text Widget that behaves more like an actual Text Widget. I've attached my modified mock_tk.py which I used to create a mock editor window. This works for the test I made in #18279, but I am also working on a version similar to Todd's for that issue. -- Added file: http://bugs.python.org/file30746/mock_tk.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18042] Provide enum.unique class decorator
STINNER Victor added the comment: The documentation still contains an Interesting example: UniqueEnum. I would prefer to only have one obvious way to get unique enum, so please just drop this example. Or at least, mention the new decorator in the example. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18042 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11016] Re-implementation of the stat module in C
STINNER Victor added the comment: Can we re-close this issue? Or is there still something to do? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11016 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17206] Py_XDECREF() expands its argument multiple times
STINNER Victor added the comment: So it seems that the best option would be to increase the stack size used when linking (/STACK:). I would suggest increasing it to 3MB using /STACK:3145728. Does Python allocate the whole stack (physical pages) at startup, or is it done on demand as on Linux? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11016] Re-implementation of the stat module in C
Christian Heimes added the comment: Let's close it. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11016 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7267] format method: c presentation type broken
STINNER Victor added the comment: u'{0:c}'.format(256) calls 256.__format__('c') which returns a str (bytes) object, so we must reject value outside range(0, 256). The real fix for this issue is to upgrade to Python 3. Attached patch works around the inital issue (u'{0:c}'.format(256)) by raising OverflowError on int.__format__('c') if the value is not in range(0, 256). -- Added file: http://bugs.python.org/file30747/int_format_c.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7267 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12520] spurious output in test_warnings
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16499] CLI option for isolated mode
Nick Coghlan added the comment: I've come around to the idea of having this available as an option in the default interpreter. A separate binary could then just make it the default behaviour (leaning on PEP 432 to do so), which is more shebang line friendly and allows Linux distros to better distinguish between default behaviour of Python when running user scripts and default behaviour of Python when running system applications in a way that simple symlinks can't. However, whether or not to provide such a binary (and whether or not to rewrite shebang lines in system packages to use it) would become our problem rather than an upstream problem. So +1 from me for a -I isolated mode, and I'll adjust PEP 432 as necessary to cope. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16499 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16499] CLI option for isolated mode
Barry A. Warsaw added the comment: On Jul 02, 2013, at 02:12 AM, Nick Coghlan wrote: So +1 from me for a -I isolated mode, and I'll adjust PEP 432 as necessary to cope. PEP 394 is probably related to any such additional binary. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16499 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15767] add ModuleNotFoundError
Guido van Rossum added the comment: [switching to gmail-powered account] I'm sorry, but this seems like it should be an importlib internal affair. The new exception is too much in everyone's face, because the exception name gets printed on every traceback. I like #4, #3 is also acceptable. But #4 seems best because it can obviate a bunch of exception message parsing in user code, I'm sure. Though we shouldn't go overboard with distinguishing cases, the two different places where you currently raise MNFE should be distinguished IMO. -- nosy: +Guido.van.Rossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Todd Rovito added the comment: Terry, Thank you for the feedback this helps me alot! I will work with Phil Webster and will use his Text Widget and EditorWindow classes. Hopefully this will help us converge on a strong unit test for FormatParagraph.py. Thanks for the reminder about triple quoted strings I think your idea to make sure those strings are in place now is excellent. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18340] float related test has problem with Denormal Flush to Zero compiler options
V.E.O added the comment: Hi Mark, Sorry for unclear DFZ abbreviation, that is when compiler opened with FTZ and DAZ feature. My operating system is Linux X64, I only tried Intel Compiler. In default optimization mode, the FTZ option is opened. Don't known why Intel make it the default option, maybe they think performance handling Subnormal number values and compatibility with some hardware. https://en.wikipedia.org/wiki/Subnormal_number#Disabling_denormal_floats_at_the_code_level The configure script of Python may not have precise detection on Intel Compiler, that feature can be closed with -no-ftz options. Hi Christian, I've not test GCC's DFZ/FTZ options, I'd like to test it myself and report here. Maybe '-ffast-math' is the right option. Hi Stefan, Tried to change the mode, but not work, seems the right options is '-no-ftz'. Regards, V.E.O -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com