One function
uri_to_iri in wbond/asn1crypto
The author described this change as “Fix type issue parsing IRI with explicit port on Python 3”. It counts as a record because the check below fails on the code as it stood at db9a86b53 and passes on 0ca5d03ac, with nothing else changed between the two runs.
Projectwbond/asn1crypto
Fix saved2016-03-29
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a docstring
Converts an ASCII URI byte string into a unicode IRI :param value: An ASCII-encoded byte string of the URI :return: A unicode string of the IRI
The change
| 29 | 29 | if hostname: | |
| 30 | 30 | hostname = hostname.decode('idna') | |
| 31 | 31 | port = parsed.port | |
| 32 | - | if port: | |
| 32 | + | if port and not isinstance(port, int_types): | |
| 33 | 33 | port = port.decode('ascii') | |
| 34 | 34 | ||
| 35 | 35 | netloc = '' | |
| ⋯ | |||
| 41 | 41 | if hostname is not None: | |
| 42 | 42 | netloc += hostname | |
| 43 | 43 | if port is not None: | |
| 44 | - | netloc += ':' + port | |
| 44 | + | netloc += ':' + str_cls(port) | |
| 45 | 45 | ||
| 46 | 46 | path = _urlunquote(parsed.path, remap=['/'], preserve=True) | |
| 47 | 47 | query = _urlunquote(parsed.query, remap=['&', '='], preserve=True) | |
The check that tells the two apart
fail→pass·tests/test_x509.py::X509Tests::test_iri_with_port
Check file tests/test_x509.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itdb9a86b532b6ffa8a6846d9ef7a56e0afdea0e82
Broken version dated2016-03-29
Moduleasn1crypto._iri
Units changeduri_to_iri
Fingerprint77623520335b5ace
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in wbond/asn1crypto
- 2021-12-05Fix Clearance type definition
- 2021-11-21Fix tagging for RoleSyntax and SecurityCategory
- 2021-08-14_parse
- 2019-09-23_dump_header
- 2017-11-28Fix type checking in pem.armor()
- 2017-02-07_parse