bootphon / phonemizer

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

logger is None #47

Closed padmalcom closed 4 years ago

padmalcom commented 4 years ago

Hi, it seems that logger can be None in espeak.py. I get the following error:

  File "C:\Users\admin\Anaconda3\envs\TransformerTTS\lib\site-packages\phonemizer\backend\espeak.py", line 290, in _phonemize_aux
    self.logger.warning(
AttributeError: 'NoneType' object has no attribute 'warning'

The method get_logger appears to handle the initialization of a logger or do I have to initialize it manually?

mmmaat commented 4 years ago

You should use get_logger indeed. The log cannot be None.

padmalcom commented 4 years ago

I did not modify espeak.py in any way. get_logger is used in the init method (line 52) but it seems to return None. Since I'm using phonemizer in https://github.com/as-ideas/TransformerTTS it could be the case that it is initialized with a None logger... I'll check that.

padmalcom commented 4 years ago

I could bet it to work by replacing all logger.warning calls by print. Neither beautiful, nor a real solution but it works.