Skip to content

Truncate file path length #9

@davide-grheco

Description

@davide-grheco

If one heading is very long, the software will fail due to OSError in linux.

Traceback (most recent call last):
File "mdsplit", line 8, in
sys.exit(main())
^^^^^^
File "mdsplit.py", line 342, in main
splitter.process()
File "mdsplit.py", line 148, in process
self.process_file(self.in_path, self.out_path)
File "mdsplit.py", line 167, in process_file
self.process_stream(stream, in_file_path.name, out_path)
File "mdsplit.py", line 75, in process_stream
if not chapter_path.exists():
^^^^^^^^^^^^^^^^^^^^^
File "pathlib.py", line 1235, in exists
self.stat()
File "pathlib.py", line 1013, in stat
return os.stat(self, follow_symlinks=follow_symlinks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 36] File name too long:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions