bootphon / phonemizer

Simple text to phones converter for multiple languages
https://bootphon.github.io/phonemizer/
GNU General Public License v3.0
1.18k stars 165 forks source link

Espeak Backend in Docker tmp file error #109

Closed LEECHOONGHO closed 1 year ago

LEECHOONGHO commented 2 years ago

Describe the bug I Installed phonemizer and espeak in docker container by $ pip install phonemizer $ apt-get update && apt-get upgrade -y $ apt-get install espeak

When I try to run any function related to phonemizer, the following error message appears.

Exception ignored in: <finalize object at 0x7f08c6529a20; dead>
Traceback (most recent call last):
  File "/opt/conda/envs/lee/lib/python3.8/weakref.py", line 566, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
  File "/opt/conda/envs/lee/lib/python3.8/site-packages/phonemizer/backend/espeak/api.py", line 116, in _delete
    shutil.rmtree(tempdir)
  File "/opt/conda/envs/lee/lib/python3.8/shutil.py", line 722, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/opt/conda/envs/lee/lib/python3.8/shutil.py", line 720, in rmtree
    os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/tmp/tmpw4cld8sd'

And Some files pile up in /tmp folder.

Phonemizer version phonemizer-3.0.1 available backends: espeak-1.48.3, segments-2.2.0 uninstalled backends: espeak-mbrola, festival

System Ubuntu 20.04

To reproduce $ phonemize --version

Expected behavior tmp/tmp[~~] folder is deleted without error message

Additional context Is it a file delete permission issue?

mmmaat commented 1 year ago

Hi, sorry for the late answer. I cannot reproduce your bug in a fresh python:3.8 Docker image:

$ docker run -it python:3.8 bash
# pip install phonemizer
# apt-get update && apt-get upgrade -y
# apt-get install espeak
# phonemizer --version
phonemizer-3.2.1
available backends: espeak-1.48.15, segments-2.2.1
uninstalled backends: espeak-mbrola, festival
# python
>>> from phonemizer import phonemize
>>> phonemize('hello world', language='en-us', backend='espeak')
'həloʊ wɜːld '

Feel to re-open the issue with more details.