Kozea/Pyphen

ResourceWarning: unclosed file

gregorias opened this issue · 1 comments

Since 1795d65#diff-c99bbcfc0e7112a9ae7a56a9af9b33a1b503dafc3bbdaf6f2a753bd62fd2a6e4R122, Pyphen opens a dictionary without properly closing it at

encoding = path.open('rb').readline().decode()
.

This results in a resource warning:

/Users/grzesiek/Code/anki/anki-word-hyphenator/deps/Pyphen/pyphen/__init__.py:118: ResourceWarning: unclosed file <_io.BufferedReader name='/Users/grzesiek/Code/anki/anki-word-hyphenator/deps/Pyphen/pyphen/dictionaries/hyph_en_US.dic'>
  encoding = path.open('rb').readline().decode()
liZe commented

Thanks for the report!