[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 file: http://bugs.python.org/file41460/type_name_null_fix.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 can be added to PEP 
101, and then the release manager can simply create an issue about it and let 
someone else take care of it (this kind of issues are good for beginners).

--
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 zero-padded values across 
different platforms.

--
keywords: +easy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the point of the odd __getitem__() method in test_enumerate.py? 
Maybe you should use assertRaisesRegex() to check that the intended TypeError 
is actually raised.

--
nosy: +martin.panter
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, abstractmethod and 
get_cache_token.

29.7.2 Syntactic ABCs

New section containing the documentation for the ABCs relocated from 
collections.abc

29.7.3 Deprecated decorator API

The docs for abstractclassmethod, abstractstaticmethod and abstractproperty can 
be moved out of the main ABC definition docs, since the only reason to use them 
now is for single source Python 2/3 compatibility, or compatibility with Python 
3.2.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 write() is not a problem with 
mocks.

--
nosy: +rbcollins
resolution: out of date -> fixed
stage: needs patch -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 .keys() not only should make 
the code work again, but also make it more explicit and understandable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 warnings are ignored only by people that are already familiar with the 
module and its limitation/issues, and that know what they are doing.  If the 
warning is not evident, people are going to miss it [0].

If warnings are used correctly, people will spot them easily and read them (or 
ignore them if they already know what they are warning against).

[0]: I know I missed it in e.g. https://api.jquery.com/die/ -- the function is 
deprecated, but (currently) this is only written in the top right corner and in 
small in the category at the top -- two places that are easily overlooked.  
https://api.jquery.com/toggle-event/ on the other hand has a clearly visible 
yellow box at the top that immediately says that the method is deprecated.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
keywords: patch
messages: 257279
nosy: dstufft, eric.araujo, lemburg, serhiy.storchaka, tarek
priority: normal
severity: normal
stage: patch review
status: open
title: Use sys.version_info instead of sys.version
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file41463/use_version_info.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 __getitem__(), your class is both iterable and a 
container, but it is neither an Iterable nor a Container. :)

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com