One function

MarkDownFile in didix21/mdutils

The author described this change as Fix #37: Add .md extension if name contains md word. It counts as a record because the check below fails on the code as it stood at cd35a953c and passes on a32a5d05c, with nothing else changed between the two runs.

Fix saved2020-06-19
Sharing licenceMIT · LICENSE.txt
Change size+1 1

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

MarkDownFile class creates a new file of MarkDown extension. Features available are: - Create a file. - Rewrite a file with new data. - Write at the end of the file.

The change

1010 """Creates a markdown file, if name is not empty.
1111 :param str name: file name"""
1212 if name:
13- self.file_name = name if 'md' in name else name + '.md'
13+ self.file_name = name if name.endswith('.md') else name + '.md'
1414 self.file = open(self.file_name, 'w+', encoding='UTF-8')
1515 self.file.close()
1616

The check that tells the two apart

failpass·tests/test_fileutils/test_fileutils.py::TestMarkdownFile::test_create_file_case_0

Check file tests/test_fileutils/test_fileutils.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 itcd35a953cebf200f4ebfd11b3ed0af4169ac25a7
Broken version dated2020-05-31
Modulemdutils.fileutils.fileutils
Units changedMarkDownFile
Fingerprintf67a4396029f0050
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 didix21/mdutils