
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-08-25 15:14 bymoritzs, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| ipaddress-improvement.patch | moritzs,2016-08-25 15:14 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12774 | closed | methane,2019-04-11 06:24 | |
| PR 12832 | merged | methane,2019-04-15 06:21 | |
| PR 12836 | merged | methane,2019-04-15 10:47 | |
| PR 14200 | merged | methane,2019-06-18 12:20 | |
| Messages (13) | |||
|---|---|---|---|
| msg273655 -(view) | Author: Moritz Sichert (moritzs)* | Date: 2016-08-25 15:14 | |
This patch fixes the following minor issues with the ipaddress module:- Removed unused property _BaseV4._valid_mask_octets- Removed unused methods _BaseV4._is_valid_netmask() and _BaseV4._is_hostmask()- Replaced several calls to superclass constructors by super()It also refactors the constructors of IPv4Network, IPv4Interface, IPv6Network, and IPv6Interface.They all now use the new method _get_addr_prefix_tuple() to parse the argument. It now matches the following sentence of the documentation of IPv4/6Interface:"The meaning of address is as in the constructor of IPv4Network".Additionally they now also accept a bytes or an IPv4/6Address object representing a netmask (or a hostmask [only IPv4]) as second element of an address/netmask tuple. This makes it easier to work with C-APIs that provide netmasks only as bytes object.This patch does not try to solveissue 27683. | |||
| msg279600 -(view) | Author: Moritz Sichert (moritzs)* | Date: 2016-10-28 12:46 | |
Any updates? | |||
| msg279607 -(view) | Author: Alyssa Coghlan (ncoghlan)*![]() | Date: 2016-10-28 14:27 | |
Peter, are you able to take a look at this or indicate you're happy for someone else to take it? (I relinquished my co-maintainer role for the ipaddress module a while back, so you're the only currently listed maintainer) | |||
| msg339845 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-04-10 10:32 | |
@moritzs Would you create a pull request on GitHub?Or may I create a pull request for your patch? | |||
| msg340240 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-04-15 07:01 | |
New changeset2430d532e240dea55f0082d1e9bf2e0f3d7505be by Inada Naoki in branch 'master':bpo-27860: use cached_property (GH-12832)https://github.com/python/cpython/commit/2430d532e240dea55f0082d1e9bf2e0f3d7505be | |||
| msg340259 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-04-15 10:59 | |
I am not owner of ipaddress module, so I don't know we shouldsupport more form of masks.On the other hand, IPv4Interface and IPv6Interface exposenetmask and hostmask attributes when address is not bytes or int.These attributes are not documented. I assume it was addedaccidentally, when coping some code from Network classes.But there are test for these attributes.NetmaskTestMixin_v4.test_valid_netmask runs for IPv4Network and IPv4Interface.It checks these attributes when constructor argument is string.https://github.com/python/cpython/blob/3c7931e514faf509a39c218c2c9f55efb434628f/Lib/test/test_ipaddress.py#L422-L440For safety, I added these attributes always, instead of remove them.PR-12836 is fixing it, and extracts methods for Network/Interface constructor(a part ofPR-12774). It doesn't add additional mask form support. | |||
| msg340307 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-04-15 23:32 | |
New changeset6fa84bd12c4b83bee6a41b989363230d5c03b96c by Inada Naoki in branch 'master':bpo-27860: ipaddress: fix Interface missed some attributes (GH-12836)https://github.com/python/cpython/commit/6fa84bd12c4b83bee6a41b989363230d5c03b96c | |||
| msg340308 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-04-15 23:37 | |
I merged all cleanups.I don't merge accepting any IP representations as mask, because I'm not expert of this module.At least, I don't want to pass prefix/netmask by something like IPv4Network("0.0.255.255"). | |||
| msg343349 -(view) | Author: SilentGhost (SilentGhost)*![]() | Date: 2019-05-24 08:06 | |
I was wondering why it was decided against backporting to 3.7?6fa84bd12c4b83bee6a41b989363230d5c03b96c fixes an actual bug#35990 (string mask in tuple argument for IPv4Interfaces). Incidentally, there are also no tests for this behaviour.Just to note: both merged PRs lacked news entry. | |||
| msg343537 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-05-26 08:02 | |
> I was wondering why it was decided against backporting to 3.7?Because I treats this is just a code cleanup.>6fa84bd12c4b83bee6a41b989363230d5c03b96c fixes an actual bug#35990 (string mask in tuple argument for IPv4Interfaces).I didn't thought it was a bug.I don't know it is real bug which should be backported to 3.7 for now.> Incidentally, there are also no tests for this behavior.Because I thought there are no change about public (documented) behavior.> Just to note: both merged PRs lacked news entry.NEWS entry is not needed for code cleanup. | |||
| msg343671 -(view) | Author: Jack (Jacktose) | Date: 2019-05-27 19:04 | |
I for one have encountered#35990 in my work and would appreciate a backport. | |||
| msg345983 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-06-18 12:16 | |
OK, I thought I improved only undocumented behavior, but it was documented and previous behavior didn't follow the document.I'll backportPR 12836. | |||
| msg346038 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-06-19 11:47 | |
New changesetf532fe5583d29d21e12aa22d8fca13e3bca94fb3 by Inada Naoki in branch '3.7':bpo-27860: ipaddress: fix Interface constructor (GH-14200)https://github.com/python/cpython/commit/f532fe5583d29d21e12aa22d8fca13e3bca94fb3 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:35 | admin | set | github: 72047 |
| 2019-06-19 11:48:12 | methane | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-06-19 11:47:45 | methane | set | messages: +msg346038 |
| 2019-06-18 12:20:55 | methane | set | pull_requests: +pull_request14038 |
| 2019-06-18 12:16:41 | methane | set | messages: +msg345983 |
| 2019-05-27 19:10:40 | berker.peksag | set | nosy: -berker.peksag |
| 2019-05-27 19:04:57 | Jacktose | set | messages: +msg343671 |
| 2019-05-26 08:02:16 | methane | set | messages: +msg343537 |
| 2019-05-24 17:29:52 | Jacktose | set | nosy: +Jacktose |
| 2019-05-24 08:06:10 | SilentGhost | set | nosy: +SilentGhost messages: +msg343349 versions: + Python 3.7 |
| 2019-05-24 08:00:30 | SilentGhost | link | issue35990 superseder |
| 2019-04-15 23:37:38 | methane | set | messages: +msg340308 |
| 2019-04-15 23:32:37 | methane | set | messages: +msg340307 |
| 2019-04-15 10:59:18 | methane | set | messages: +msg340259 versions: + Python 3.8, - Python 3.7 |
| 2019-04-15 10:47:38 | methane | set | pull_requests: +pull_request12761 |
| 2019-04-15 07:01:06 | methane | set | messages: +msg340240 |
| 2019-04-15 06:21:39 | methane | set | pull_requests: +pull_request12757 |
| 2019-04-11 06:24:50 | methane | set | pull_requests: +pull_request12701 |
| 2019-04-10 10:32:12 | methane | set | nosy: +methane messages: +msg339845 |
| 2016-11-07 13:46:49 | berker.peksag | set | nosy: +berker.peksag |
| 2016-10-28 14:44:12 | serhiy.storchaka | set | versions: + Python 3.7, - Python 3.6 |
| 2016-10-28 14:27:51 | ncoghlan | set | messages: +msg279607 |
| 2016-10-28 12:46:46 | moritzs | set | messages: +msg279600 |
| 2016-08-26 02:47:28 | xiang.zhang | set | nosy: +xiang.zhang |
| 2016-08-25 16:26:52 | serhiy.storchaka | set | nosy: +ncoghlan,serhiy.storchaka |
| 2016-08-25 16:13:56 | SilentGhost | set | nosy: +pmoody stage: patch review |
| 2016-08-25 15:14:28 | moritzs | create | |