[issue25985] Use sys.version_info instead of sys.version

2015-12-31 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch replaces all occurrences of sys.version[:3] with '%d.%d' % sys.version_info[:2]. The former doesn't work with non-one-digit versions (such as 3.10 and 10.1). -- components: Distutils, Library (Lib) files: use_version_info.patch keywo

[issue17756] test_syntax_error fails when run in the installed location

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: I'm going to close this since the reported issue has been fixed. In the test sys.stderr was mocked, and Mock.method_calls simply records the calls done to the mock. Therefore the fact that 'NameError' and ':' were written on sys.stderr on two separate calls to

[issue25958] Implicit ABCs have no means of "anti-registration"

2015-12-31 Thread Martin Panter
Martin Panter added the comment: I don’t think you need to define __len__() to get an iterable, only __getitem__(). Also, if I understand your problem, Container would also be susceptible in theory, because membership testing via “in” and “not in” falls back to iteration. If you only define _

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-31 Thread Martin Panter
Martin Panter added the comment: If this patch goes ahead, I think the ABC documentation should clarify which methods are checked for None and which aren’t. The datamodel.rst file will suggest None for any method, but ABC will only support it for Iterable and Hashable (I think). Also, what is

[issue13253] 2to3 fix_renames renames sys.maxint only in imports

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: Nikita, did you manage to find a solution? If not, do you have a patch (even if not complete) to share? -- versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker _

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-12-31 Thread Nick Coghlan
Nick Coghlan added the comment: >From a documentation perspective, I'd suggest breaking the ABC module >documentation at https://docs.python.org/3/library/abc.html into three >subsections: 29.7.1 Defining Abstract Base Classes This would include the existing docs for ABC, ABCMeta, abstractmet

[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: If there is consensus about adding this to sys, then the latest patch LGTM (module a couple of unaddressed comments on Rietveld). If not, you should probably bring this up to python-dev. -- ___ Python tracker

[issue19006] UnitTest docs should have a single list of assertions

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: Here's a patch. -- assignee: docs@python -> ezio.melotti keywords: +patch stage: -> commit review versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4 Added file: http://bugs.python.org/file41462/issue19006.diff _

[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: See msg146972 -- AFAIU the padding of %Y is inconsistent for years <1000 (e.g. 0042 vs 42), and this is not documented in the note (2) of https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior Also, using %4Y seems to consistently produce

[issue18174] Make regrtest with --huntrleaks check for fd leaks

2015-12-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> patch review type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue18162] Add index attribute to IndexError

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: And PEP 473. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue25409] fnmatch.fnmatch normalizes slashes/backslashes on Windows

2015-12-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- assignee: -> docs@python components: +Documentation, Windows keywords: +easy nosy: +docs@python ___ Python tracker ___ _

[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-12-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18162] Add index attribute to IndexError

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: See also #1182143. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue1182143] making builtin exceptions more informative

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: I would suggest you to bring this up to python-dev (or perhaps python-ideas?). Also note that Brett proposed something similar in #18162 and other related issues (#18156, #18163, #18165, #18166). -- versions: +Python 3.6 -Python 3.5 _

[issue17006] Add advice on best practices for hashing secrets

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: > People are going to skip warning boxes if they occur too often. I'm not sure I agree. This would be true if they were abused for trivial things ("Warnings: using .pop() on a empty list will return an IndexError!"), but I don't think they are. I think warning

[issue25439] Add type checks to urllib.request.Request

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: > But maybe I am being too nitpicky and paranoid. Ezio? IIUC your last example used to work because technically it is an iterable of bytes, but the patch would give an error instead. Even in the unlikely case someone is relying on this behavior, simply adding .

[issue25520] unittest load_tests protocol not working as documented

2015-12-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Library (Lib) versions: +Python 3.5, Python 3.6 -Python 3.4 ___ Python tracker ___ ___ Pytho

[issue19316] devguide: compiler - wording

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: Stéphane, did you forget to attach the patch? -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue25704] Update the devguide to 3.5

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: With rst is possible to define replacements once like: .. |current_branch| replace:: 3.6 .. |prev_branch| replace:: 3.5 and use them across the devguide, however I'm afraid this won't work with code blocks. Perhaps a new entry about updating the devguide ca

[issue25320] unittest loader.py TypeError when code directory contains a socket

2015-12-31 Thread Ezio Melotti
Ezio Melotti added the comment: The fix looks ok, however the test seem to contain unnecessary code and it duplicates most of the previous test. I left a more detailed review on rietveld (see the "review" link next to the patch). -- type: -> behavior _

[issue25963] strptime not parsing some timezones

2015-12-31 Thread Martin Panter
Martin Panter added the comment: I suspect the datetime module’s %Z parsing depends on the locale, just like time.strptime() does: . -- nosy: +martin.panter ___ Python tracker

[issue25916] wave module readframes now returns bytes not str

2015-12-31 Thread Martin Panter
Martin Panter added the comment: Two of the changes don’t seem right to me; see the review. In the other two cases, IMO “string of bytes” is a reasonable description of :class:`bytes`, but being explicit is better. -- nosy: +martin.panter ___ Python

[issue25984] Expose a simple "is IEEE 754" flag in sys.float_info

2015-12-31 Thread random832
Changes by random832 : -- components: +Library (Lib) type: -> enhancement versions: +Python 3.6 ___ Python tracker ___ ___ Python-bug

[issue25984] Expose a simple "is IEEE 754" flag in sys.float_info

2015-12-31 Thread random832
New submission from random832: I think it would be useful for programs to be able to detect whether a system uses IEEE-754 double-precision values for the 'float' type. There is lots of detailed information about the float type in sys.float_info, but no simple "is IEEE" flag. On some C impleme

[issue25983] Add tests for multi-argument type()

2015-12-31 Thread Brett Cannon
Brett Cannon added the comment: LGTM and I think test_builtins works well enough (unless you really wanted to go through the effort of consolidating all type-related types into a single test_type module). -- assignee: -> serhiy.storchaka nosy: +brett.cannon stage: patch review -> comm

[issue25981] Intern namedtuple field names

2015-12-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now, after you pointed out that the keys in the dictionary already interned, I'm not sure anymore that it is needed to intern the _fields items. I'm wondering, why short identifier-like string literals in compiled _fields are not interned? -- _

[issue25983] Add tests for multi-argument type()

2015-12-31 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: I had not added tests for issue25961 because couldn't find a good place for adding new tests. It looks that there are no special tests for creating new type with type() at all. Proposed patch adds separate class with tests in test_builtin (may be this is

[issue25463] 2.7.10 glibc double free detected

2015-12-31 Thread William D Colburn
William D Colburn added the comment: wcolburn@anotheruvula$ strace doublefree 2>&1 | grep site.py open("/home/anotheruvula/python/debug/pybug/lib/python2.7/site.py", O_RDONLY) = 3 open("/home/anotheruvula/python/debug/pybug/lib/python2.7/site.pyc", O_RDONLY) = 4 *** glibc detected *** doublefr

[issue18911] minidom does not encode correctly when calling Document.writexml

2015-12-31 Thread R. David Murray
R. David Murray added the comment: It means a function defined in the module namespace, as opposed to as a method on a class, so that 'from xml.dom.minidom import ' will get you that function. This issue should be for documentation of the problem, since we won't add the function to 2.7. A ne

[issue25463] 2.7.10 glibc double free detected

2015-12-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I don't reproduce the crash, but I noticed that the binary imports and executes the system's /usr/lib/python2.7/site.py. I think it's cython's fault (or maybe the way you use it): "cython --embed" is not really isolated from the rest of the system, so it

[issue18911] minidom does not encode correctly when calling Document.writexml

2015-12-31 Thread Upendra Kumar
Upendra Kumar added the comment: I am trying to resolve a issue for the first time. Can anybody please tell me or elaborate what is "module level function" specifically in this context. -- nosy: +upendra-k14 ___ Python tracker

[issue25961] Disallow the null character in type name

2015-12-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 57fea6f75ac2 by Serhiy Storchaka in branch '2.7': Issue #25961: Fixed compilation error and a leak in type constructor. https://hg.python.org/cpython/rev/57fea6f75ac2 -- ___ Python tracker

[issue25961] Disallow the null character in type name

2015-12-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Florin. How could I miss this? But your patch is not correct. It leads to double free and deallocating using non-initialized pointer. It also contains trailing spaces and incorrect indentation. -- ___ P

[issue25961] Disallow the null character in type name

2015-12-31 Thread Florin Papa
Florin Papa added the comment: Hi all, I fixed a compile error introduced in Python 2.7 by this issue. There is a jump made to an nonexistent label "error" in type_new function in Objects/typeobject.c. Please see the attached patch. Regards, Florin Papa -- nosy: +florin.papa Added fi