Whole file
python-hyper/hyperlink
The author described this change as “Don't fail when child gets no segments.”. It counts as a record because the check below fails on the code as it stood at 12e22d9bf and passes on c6c2a9db8, with nothing else changed between the two runs.
Projectpython-hyper/hyperlink
Fix saved2017-10-26
Sharing licenceMIT · LICENSE
Change size+3 −0
What the code was meant to do, written into the code itself as a save note
Don't fail when child gets no segments.
The change
| 1093 | 1093 | URL: A copy of the current URL with the extra path segments. | |
| 1094 | 1094 | ||
| 1095 | 1095 | """ | |
| 1096 | + | if not segments: | |
| 1097 | + | return self | |
| 1098 | + | ||
| 1096 | 1099 | segments = [_textcheck('path segment', s) for s in segments] | |
| 1097 | 1100 | new_segs = _encode_path_parts(segments, joined=False, maximal=False) | |
| 1098 | 1101 | new_path = self.path[:-1 if (self.path and self.path[-1] == u'') |
The check that tells the two apart
fail→pass·hyperlink/test/test_url.py::TestURL::test_emptyChild
Check file hyperlink/test/test_url.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 it12e22d9bf2f1037fa2bf4c617d5094cf01ff5ca8
Broken version dated2017-08-29
Modulehyperlink._url
Units changedURL
Fingerprint8a306d1a795d29ed
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.