Maboroshy / Note-Station-to-markdown

The cross-platform script that converts notes from Synology Note Station to markdown files
Apache License 2.0
240 stars 51 forks source link

OSError: [Errno 63] File name too long #29

Closed cukabeka closed 8 months ago

cukabeka commented 1 year ago

Hi,

I got this OSError: [Errno 63] File name too long on MacOS for a file named /media/b9e5d7dfb4f4315b201e813e77057476_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_36_37_38_39_40_41_42_43_44_45_46_47_48_49_50_51_52_53_54_55_56_57_58_59_60_61_62_63_64_65_66_67_68_69_70_71_72_73_74_75_76.jpeg

Anything possible to at least skip this then? Or better rename it somehow?

Maboroshy commented 1 year ago

Could you post the full text of an error. Looks like an easy fix.

cukabeka commented 1 year ago

Great, thanks!

Here's the traceback:

    Traceback (most recent call last):
      File "/Users/data/nsx2md.py", line 232, in <module>
        while Path(parent_notebook.media_path / name).is_file():
      File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1322, in is_file
        return S_ISREG(self.stat().st_mode)
      File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1097, in stat
        return self._accessor.stat(self, follow_symlinks=follow_symlinks)
    OSError: [Errno 63] File name too long: '/media/b9e5d7dfb4f4315b201e813e77057476_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_36_37_38_39_40_41_42_43_44_45_46_47_48_49_50_51_52_53_54_55_56_57_58_59_60_61_62_63_64_65_66_67_68_69_70_71_72_73_74_75_76.jpeg'
Maboroshy commented 1 year ago

I've updated the script. Please, try the new version.

cukabeka commented 1 year ago

Hi @Maboroshy thanks for looking into this. Still getting that error:

  Traceback (most recent call last):
    File "/Users/data/nsx2md.py", line 232, in <module>
      while Path(parent_notebook.media_path / name).is_file():
    File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1322, in is_file
      return S_ISREG(self.stat().st_mode)
    File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1097, in stat
      return self._accessor.stat(self, follow_symlinks=follow_symlinks)
  OSError: [Errno 63] File name too long: '/Users/data/media/b9e5d7dfb4f4315b201e813e77057476_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_36_37_38_39_40_41_42_43_44_45_46_47_48_49_50_51_52_53_54_55_56_57_58_59_60_61_62_63_64_65_66_67_68_69_70_71_72_73_74_75_76.jpeg'

From what I see, it's still exactly the same. I saw you reduced the name length, but for some reason this seems to not work in that case.

Over at reddit I found some snippet, but my PyKnowledge isn't ready for estimating whether that's useful.

Maboroshy commented 1 year ago

Interesting. I'll look into this.

Maboroshy commented 8 months ago

Fixed error in media files naming that caused the issue.