Skip to content

How to solve the directory error problem #21

@suifengtec

Description

@suifengtec

After run the command:

edge-srt-to-speech --voice zh-CN-XiaoxiaoNeural test.srt test.mp3

I got an error as follow:

`
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Python\Python310\lib\runpy.py", line 196, in run_module_as_main
return run_code(code, main_globals, None,
File "D:\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\Python\Python310\Scripts\edge-srt-to-speech.exe_main
.py", line 7, in
File "D:\Python\Python310\lib\site-packages\edge_srt_to_speech_main
.py", line 323, in main
asyncio.get_event_loop().run_until_complete(
File "D:\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "D:\Python\Python310\lib\site-packages\edge_srt_to_speech_main
.py", line 190, in _main
with tempfile.TemporaryDirectory() as temp_dir:
File "D:\Python\Python310\lib\tempfile.py", line 869, in exit
self.cleanup()
File "D:\Python\Python310\lib\tempfile.py", line 873, in cleanup
self._rmtree(self.name, ignore_errors=self._ignore_cleanup_errors)
File "D:\Python\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "D:\Python\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "D:\Python\Python310\lib\shutil.py", line 620, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "D:\Python\Python310\lib\tempfile.py", line 846, in onerror
cls._rmtree(path, ignore_errors=ignore_errors)
File "D:\Python\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "D:\Python\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "D:\Python\Python310\lib\shutil.py", line 601, in _rmtree_unsafe
onerror(os.scandir, path, sys.exc_info())
File "D:\Python\Python310\lib\shutil.py", line 598, in _rmtree_unsafe
with os.scandir(path) as scandir_it:
NotADirectoryError: [WinError 267] 目录名称无效。: 'C:\Users\suife\AppData\Local\Temp\tmpeph4xjnc\50.mp3'
Generating audio: 94%|███████████████████████████████████████████████████████▌ | 80/85 [00:28<00:01, 2.83it/s]
`
7851

the command line tool show "目录名称无效", it means "Directory name is invalid", how to solve this problem?

Thank you!

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