[issue5996] abstract class instantiable when subclassing dict

2016-05-31 Thread Luiz Poleto

Changes by Luiz Poleto :


--
nosy: +luiz.poleto

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



[issue27124] binascii.a2b_hex raises binascii.Error and ValueError, not TypeError

2016-05-25 Thread Luiz Poleto

Luiz Poleto added the comment:

binascii.Error is used throughout the module for most of the validations, with 
only a few of them using TypeError/ValueError. I guess it would make more sense 
to update these to raise binascii.Error (unless they were left on purpose) to 
make it consistent with the rest of the module, although changing from 
TypeError to binascii.Error might break existing code.

Anyway, since a2b_hex is currently raising binascii.Error for an odd-length 
input, the attached patch fixes the documentation to reflect it.

--
keywords: +patch
nosy: +luiz.poleto
Added file: http://bugs.python.org/file43009/issue27124.patch

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



[issue24235] ABCs don't fail metaclass instantiation

2016-05-24 Thread Luiz Poleto

Luiz Poleto added the comment:

This seems to be related to issues #5996 and #26306.

--
nosy: +luiz.poleto

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



[issue26306] Can't create abstract tuple

2016-05-24 Thread Luiz Poleto

Luiz Poleto added the comment:

Same as reported on issue #5996. Apparently this happens not only with tuple 
but with any builtin type.

There is a patch on that issue but there hasn't been any activity since 2011.

--
nosy: +luiz.poleto

___
Python tracker 
<http://bugs.python.org/issue26306>
___
___
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

2016-04-27 Thread Luiz Poleto

Luiz Poleto added the comment:

The change to os.rst is already committed so I modified the patch to remove it 
and keep only the change to os.py, which looks good and ready to be committed.

--
Added file: http://bugs.python.org/file42635/issue25461.patch

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Luiz Poleto

Luiz Poleto added the comment:

As for urlparse_empty_bad_arg_disallow.patch, I didn't go too deep into testing 
it but I found that calling urlparse with different non-str args are producing 
different results:

urlparse({})
TypeError: unhashable type: 'slice'

urlparse([])
AttributeError: 'list' object has no attribute 'decode'

urlparse(())
AttributeError: 'tuple' object has no attribute 'decode'

I thought they should all raise a TypeError but again, I am not sure it is 
working as expected by the patch's author.

--

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Luiz Poleto

Luiz Poleto added the comment:

I am seeing some results when running urlparse with patch 
urlparse_empty_bad_arg_deprecation2.patch applied:

>>> urllib.parse.urlparse({})
__main__:1: DeprecationWarning: Use of {} is deprecated
__main__:1: DeprecationWarning: Use of '' is deprecated
ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', 
fragment=b'')

>>> urllib.parse.urlparse('', b'')
__main__:1: DeprecationWarning: Use of b'' is deprecated
/home/poleto/SCMws/python/latest/cpython/Lib/urllib/parse.py:378: 
DeprecationWarning: Use of b'' is deprecated
  splitresult = urlsplit(url, scheme, allow_fragments)
ParseResult(scheme=b'', netloc='', path='', params='', query='', fragment='')
Will bytes be deprecated if used as a default_schema?

>>> urllib.parse.urlparse(b'', '')
ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', 
fragment=b'')
Shouldn't it complain that the types are different? In fact it does, if you 
don't provide empty strings:

>>> urllib.parse.urlparse(b'www.python.org', 'http')
Traceback (most recent call last):
  File "", line 1, in 
  File "(...)/cpython/Lib/urllib/parse.py", line 377, in urlparse
url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "(...)/cpython/Lib/urllib/parse.py", line 120, in _coerce_args
raise TypeError("Cannot mix str and non-str arguments")
TypeError: Cannot mix str and non-str arguments

>>> urllib.parse.urlparse({'a' : 1})
__main__:1: DeprecationWarning: Use of '' is deprecated
Traceback (most recent call last):
  File "", line 1, in 
  File "(...)/cpython/Lib/urllib/parse.py", line 377, in urlparse
url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "(...)/cpython/Lib/urllib/parse.py", line 128, in _coerce_args
return _decode_args(args) + (_encode_result,)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in _decode_args
return tuple(x.decode(encoding, errors) if x else '' for x in args)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in 
return tuple(x.decode(encoding, errors) if x else '' for x in args)
AttributeError: 'dict' object has no attribute 'decode'

>>> urllib.parse.urlparse(['a', 'b', 'c'])
__main__:1: DeprecationWarning: Use of [] is deprecated
Traceback (most recent call last):
  File "", line 1, in 
  File "(...)/cpython/Lib/urllib/parse.py", line 377, in urlparse
url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "(...)/cpython/Lib/urllib/parse.py", line 128, in _coerce_args
return _decode_args(args) + (_encode_result,)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in _decode_args
return tuple(x.decode(encoding, errors) if x else '' for x in args)
  File "(...)/cpython/Lib/urllib/parse.py", line 98, in 
return tuple(x.decode(encoding, errors) if x else '' for x in args)
AttributeError: 'list' object has no attribute 'decode'

I thought about writing test cases but I wasn't a 100% sure if the above is 
working as expected so I thought I should ask first.

--

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Luiz Poleto

Luiz Poleto added the comment:

As discussed on the Mentors list, the attached patch (issue22234_37.patch) 
changes the urlparse function to handle non-str and non-bytes arguments and 
adds a new test case for it.

--
Added file: http://bugs.python.org/file42592/issue22234_37.patch

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Luiz Poleto

Luiz Poleto added the comment:

As discussed on the Mentors list, the attached patch (issue22234_36.patch) 
includes the deprecation warning (and related test) on the urlparse function.

--
keywords: +patch
versions: +Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file42591/issue22234_36.patch

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-21 Thread Luiz Poleto

Changes by Luiz Poleto :


--
nosy: +luiz.poleto

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



[issue26041] Update deprecation messages of platform.dist() and platform.linux_distribution()

2016-04-21 Thread Luiz Poleto

Changes by Luiz Poleto :


--
nosy: +luiz.poleto

___
Python tracker 
<http://bugs.python.org/issue26041>
___
___
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

2016-04-20 Thread Luiz Poleto

Luiz Poleto added the comment:

The Doc/library/os.rst bit in the current patch fails to apply in all versions 
specified in this bug report (it seems that it was generated before the commit 
that included an earlier version of it).

--
nosy: +luiz.poleto

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



[issue20116] urlparse.parse_qs should take argument for query separator

2016-04-20 Thread Luiz Poleto

Luiz Poleto added the comment:

Based on the example provided by the OP, it appears that he would expect
the output to be:
{'family': ['citrus'], 'fruits': ['lemon;lime']}

Since the W3C recommendation for the application/x-www-form-urlencoded type
specify using '&' to separate the parameters in the query string (';' is
not mentioned there), I recommended a parameter for disabling the use of
';' as a separator (but '&' will still be the separator to be used).

The only thing I see against using the RFC is that although it specifies
which characters are valid in a query string, it does not define how they
should be used; that is done by W3C's application/x-www-form-urlencoded and
it is very specific about using '&' as a separator.

--

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



[issue17233] http.client header debug output format

2016-04-19 Thread Luiz Poleto

Luiz Poleto added the comment:

The attached patch fixes 2 of the main issues reported:

- Missing header values
- Missing newline at the end of the header line

I thought about the suggestion to include the response headers with the reply 
but considering that they are two different elements in an HTTP response 
message, I think it makes more sense to keep them on separate lines. The names, 
however, could be changed; perhaps from reply to response-body and headers to 
response-headers but maybe it could affect other users already expecting these 
values?

--
keywords: +patch
Added file: http://bugs.python.org/file42528/issue17233.patch

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



[issue17233] http.client header debug output format

2016-04-18 Thread Luiz Poleto

Changes by Luiz Poleto :


--
nosy: +luiz.poleto

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



[issue26775] Improve test coverage on urllib.parse

2016-04-15 Thread Luiz Poleto

New submission from Luiz Poleto:

urllib.parse has two methods, parse_qs and parse_qsl to parse a query string 
and return its parameters/values as a dictionary or a list, respectively. 
However, the unit tests only tests parse_qsl, which is also incomplete since 
both parse_qs and parse_qsl support & and ; as separators for key=value pairs 
and there are only test scenarios using &.

The attached patch add a new test for parse_qs as well as new scenarios 
including ; as separator.

--
components: Tests
files: urllib.parse_test_coverage.patch
keywords: patch
messages: 263538
nosy: luiz.poleto
priority: normal
severity: normal
status: open
title: Improve test coverage on urllib.parse
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42477/urllib.parse_test_coverage.patch

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



[issue20116] urlparse.parse_qs should take argument for query separator

2016-04-15 Thread Luiz Poleto

Luiz Poleto added the comment:

If this bug is to be moved forward, we should consider this:

The RFC 3986 defines that a query can have any of these characters:
/?:@-._~!$&'()*+,;= ALPHA DIGIT %HH (encoded octet)

But does not define how the data should be interpreted, leaving that to the 
naming authority and the URI schema (although http/https doesn't specify it as 
well; see RFC 7230).

OTOH, parse_qs (both on 2.x and 3.x) is very specific that the query string is 
of type application/x-www-form-urlencoded; which defines that the name is 
separated from the value by '=' and name/value pairs are separated from each 
other by '&', although the use of ';' to separate the pairs is only suggested 
to be supported by HTTP server implementors.

It could be that adding support to the characters specified by RFC 3986 pose as 
a challenge since there is no fixed schema and they can be freely used by the 
naming authority so perhaps we could add a parameter to enable/disable ';' as a 
pair separator?

--
nosy: +poleto

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



[issue26749] Update devguide to include Fedora's DNF

2016-04-14 Thread Luiz Poleto

Luiz Poleto added the comment:

Nice! Thanks!

On Thu, Apr 14, 2016, 5:16 AM Berker Peksag  wrote:

>
> Berker Peksag added the comment:
>
> Committed in 0ed2497e5aa4. Thanks for the patch, Luiz.
>
> --
> components: +Devguide -Documentation
> nosy: +berker.peksag, ezio.melotti, willingc
> resolution:  -> fixed
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> <http://bugs.python.org/issue26749>
> ___
>

--

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



[issue26749] Update devguide to include Fedora's DNF

2016-04-13 Thread Luiz Poleto

Luiz Poleto added the comment:

The attached patch contains the instructions on how to use DNF to install the 
system headers.

--
keywords: +patch
Added file: http://bugs.python.org/file42457/issue26749.patch

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



[issue26749] Update devguide to include Fedora's DNF

2016-04-13 Thread Luiz Poleto

New submission from Luiz Poleto:

Starting with Fedora 22, yum is no longer the default packaging tool, being 
replaced by the new DNF (Dandified Yum).

Section 1.1.3.1 of the devguide, Build dependencies, has instructions to 
install system headers using popular Linux distributions, including Fedora, 
however, it only covers using yum to do it.

This section should be updated to include the usage of the new DNF packaging 
tool to perform that task.

--
assignee: docs@python
components: Documentation
messages: 263350
nosy: docs@python, poleto
priority: normal
severity: normal
status: open
title: Update devguide to include Fedora's DNF
type: enhancement

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



[issue26699] locale.str docstring is incorrect: "Convert float to integer"

2016-04-11 Thread Luiz Poleto

Changes by Luiz Poleto :


--
keywords: +patch
Added file: http://bugs.python.org/file42440/issue26699.patch

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



[issue19771] runpy should check ImportError.name before wrapping it

2014-04-21 Thread Luiz Poleto

Changes by Luiz Poleto :


Added file: http://bugs.python.org/file34995/issue_19771.patch.v2

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



[issue19771] runpy should check ImportError.name before wrapping it

2014-04-20 Thread Luiz Poleto

Luiz Poleto added the comment:

As suggested by Nick, the fix is done be verifying the name attribute of the 
raised ImportError exception; the exception is then re-raised with the 
appropriate description.

--
Added file: http://bugs.python.org/file34989/issue_19771.patch

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



[issue19771] runpy should check ImportError.name before wrapping it

2014-04-20 Thread Luiz Poleto

Luiz Poleto added the comment:

The attached patch provide test cases to validate this error. As noted by R. 
David Murray in a discussion in the Core-Mentorship list, this error in fact 
happens then __init__.py throws an ImportError.

--
keywords: +patch
nosy: +poleto
Added file: http://bugs.python.org/file34988/issue_19771_tests.patch

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