pymystem3 icon indicating copy to clipboard operation
pymystem3 copied to clipboard

\0 causes freeze

Open nokados opened this issue 5 years ago • 2 comments

If the input string contains \0 character, Mystem does not respond.

Code to reproduce:

from pymystem3 import Mystem
m = Mystem()
m.lemmatize('тест\u0000')

After that, the program freezes. No errors, no warnings. When I send KeyboardInterrupt (^C), I see the next Traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nokados/anaconda3/lib/python3.6/site-packages/pymystem3/mystem.py", line 250, in lemmatize
    infos = self.analyze(text)
  File "/home/nokados/anaconda3/lib/python3.6/site-packages/pymystem3/mystem.py", line 235, in analyze
    result.extend(self._analyze_impl(line))
  File "/home/nokados/anaconda3/lib/python3.6/site-packages/pymystem3/mystem.py", line 273, in _analyze_impl
    select.select([self._procout_no], [], [])
KeyboardInterrupt

Python 3.6.5 pymystem3 0.1.5, 0.1.10 , 0.2.0 (all 3 were tested) Mystem 3.0

nokados avatar Apr 21 '20 15:04 nokados

Hello, Did you try to run MyStem binary on such data? If yes, what is the result?

alexanderpanchenko avatar Apr 27 '20 19:04 alexanderpanchenko

MyStem works correctly

nokados avatar May 01 '20 15:05 nokados