Skip to content

fixed bug with reserved characters in filename on windows - #25

Open
arag0re wants to merge 1 commit into
yyyyyyyan:mainfrom
arag0re:main
Open

fixed bug with reserved characters in filename on windows#25
arag0re wants to merge 1 commit into
yyyyyyyan:mainfrom
arag0re:main

Conversation

@arag0re

@arag0re arag0re commented Oct 27, 2024

Copy link
Copy Markdown

fixes crashs on Windows when the track includes reserved characters

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\bandcamper.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\bandcamper\__main__.py", line 169, in main
    bandcamp_downloader.download_all(destination, output, output_extra, *audio_formats)
  File "C:\Python311\Lib\site-packages\bandcamper\bandcamper.py", line 351, in download_all
    self.download_from_url(
  File "C:\Python311\Lib\site-packages\bandcamper\bandcamper.py", line 310, in download_from_url
    file_paths = self.download_fallback_mp3(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\bandcamper\bandcamper.py", line 258, in download_fallback_mp3
    self.download_to_file(
  File "C:\Python311\Lib\site-packages\bandcamper\bandcamper.py", line 155, in download_to_file
    with file_path.open("wb") as file:
         ^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\pathlib.py", line 1044, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\user\\Artist - Song (Remix \\ Someting).mp3

Signed-off-by: arag0re.eth <arag0re@sternburg.beer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant