One function
normpath in python-zk/kazoo
The author described this change as “Creating a sequential znode under / fails (issue #261)”. It counts as a record because the check below fails on the code as it stood at 0e7c13ed6 and passes on 2e9d33cb5, with nothing else changed between the two runs.
Projectpython-zk/kazoo
Fix saved2014-12-18
Sharing licenceApache-2.0 · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Normalize path, eliminating double slashes, etc.
The change
| 11 | 11 | new_path = '/'.join(new_comps) | |
| 12 | 12 | if trailing is True and path.endswith('/'): | |
| 13 | 13 | new_path += '/' | |
| 14 | - | if path.startswith('/'): | |
| 14 | + | if path.startswith('/') and new_path != '/': | |
| 15 | 15 | return '/' + new_path | |
| 16 | 16 | return new_path |
The check that tells the two apart
fail→pass·kazoo/tests/test_paths.py::NormPathTestCase::test_normpath_trailing
Check file kazoo/tests/test_paths.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 it0e7c13ed61c75c630553495820bb8a8e21f8c6dd
Broken version dated2014-12-16
Modulekazoo.protocol.paths
Units changednormpath
Fingerprinte6281113206ea3a5
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.