mdsplit icon indicating copy to clipboard operation
mdsplit copied to clipboard

Truncate file path length

Open davide-grheco opened this issue 1 year ago • 0 comments

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:

davide-grheco avatar May 07 '24 09:05 davide-grheco