[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-05-14 Thread Nicolai Moore


Change by Nicolai Moore :


--
pull_requests: +13220

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-13 Thread Nicolai Moore


Change by Nicolai Moore :


--
keywords: +patch
pull_requests: +13208
stage: needs patch -> patch review

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-08 Thread Nicolai Moore


Nicolai Moore  added the comment:

I'd be happy too. Would be a first time contribution though, so need to give me 
some time to figure my way around the process.

--

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-07 Thread Nicolai Moore


New submission from Nicolai Moore :

When using the tuple-form of constructing IPv4Network and IPv6Network will 
accept prefixlen outside of the normal allowed ranges.

Example:
>>> import ipaddress
>>> ipaddress.IPv4Network(('172.21.1.0', 400))
IPv4Network('172.21.1.0/400')

If given a negative number, it will error but not with a particularly useful 
error:
>>> x = ipaddress.IPv4Network(('172.21.1.0', -1))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.7/ipaddress.py", line 1532, in __init__
self.netmask, self._prefixlen = self._make_netmask(mask)
  File "/usr/lib64/python3.7/ipaddress.py", line 1112, in _make_netmask
netmask = IPv4Address(cls._ip_int_from_prefix(prefixlen))
  File "/usr/lib64/python3.7/ipaddress.py", line 444, in _ip_int_from_prefix
return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen)
ValueError: negative shift count

Looking at the code, I think all that is needed is a range check within the 
respective _make_netmask methods in _BaseV4 and _BaseV6 classes

--
components: Library (Lib)
messages: 341839
nosy: niconorsk
priority: normal
severity: normal
status: open
title: ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will 
accept out of valid range prefixlen
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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