One function

make_dirs_for_file in fabiocaccamo/python-fsutil

The author described this change as Fix `FileNotFoundError` when calling `make_dirs_for_file` with filename only.. It counts as a record because the checks below fail on the code as it stood at dadf1e697 and pass on d47bcbf70, with nothing else changed between the two runs.

Fix saved2023-01-11
Sharing licenceMIT · LICENSE.txt
Change size+2 1

What the code was meant to do, written into the code itself as a docstring

Create the directories needed to ensure that the given path exists. If a directory already exists at the given path an OSError is raised.

The change

88 return
99 assert_not_dir(path)
1010 dirpath, _ = split_filepath(path)
11- make_dirs(dirpath)
11+ if dirpath:
12+ make_dirs(dirpath)

The check that tells the two apart

failpass·tests/test.py::fsutil_test_case::test_make_dirs_for_file_with_filename_only
failpass·tests/test.py::fsutil_test_case::test_write_file_with_filename_only

Check file tests/test.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 itdadf1e6971be1c56a69d1ab2df1940baee123ea8
Broken version dated2023-01-11
Modulefsutil.__init__
Units changedmake_dirs_for_file
Fingerprint94403ddf9760ef17
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 fabiocaccamo/python-fsutil