Open zhuokun opened 5 months ago
Please can you show the full error traceback and a small snippet of code that causes this?
I'm also having trouble with 3.11.7. Downgrading to 3.10.13 works. It looks like something changed with calling string methods on items when iterating over file handles opened 'rb'.
pronouncing 0.2.0 cmudict 0.4.0 (I also tried the latest cmudict)
File "/opt/homebrew/lib/python3.11/site-packages/pronouncing/__init__.py", line 51, in init_cmu
pronunciations = parse_cmu(filehandle)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pronouncing/__init__.py", line 28, in parse_cmu
if line.startswith(';'):
^^^^^^^^^^^^^^^^^^^^
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Can you share a minimal code example that causes that?
It was just
import pronouncing as P
P.init_cmu()
However, I just tried force-reinstalling pronouncing 0.2.0 with pip on 3.11 and it works. Something must have been wrong with my particular installation.
AttributeError: partially initialized module 'pronouncing' has no attribute 'rhymes' (most likely due to a circular import)