does not work with python 3.7.1 raises StopIteration
See original GitHub issuei am trying to run the example with python 3.7.1 but it raises a generator StopIteration
example:
s = u"John is a cat"
t = scrubadub.clean(s)
output
Traceback (most recent call last):
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 365, in _read
raise StopIteration
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 20, in <module>
t = scrubadub.clean(s)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/scrubadub/__init__.py", line 16, in clean
return scrubber.clean(text, **kwargs)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/scrubadub/scrubbers.py", line 57, in clean
for next_filth in self.iter_filth(text):
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/scrubadub/scrubbers.py", line 76, in iter_filth
for filth in detector.iter_filth(text):
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/scrubadub/detectors/name.py", line 29, in iter_filth
for word, part_of_speech in blob.tags:
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/decorators.py", line 24, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/blob.py", line 447, in pos_tags
for word, t in self.pos_tagger.tag(self.raw)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/en/taggers.py", line 21, in tag
return pattern_tag(text, tokenize)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/en/__init__.py", line 115, in tag
for sentence in parse(s, tokenize, True, False, False, False, encoding).split():
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/en/__init__.py", line 99, in parse
return parser.parse(unicode(s), *args, **kwargs)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 1240, in parse
s[i] = self.find_tags(s[i], **kwargs)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/en/__init__.py", line 49, in find_tags
return _Parser.find_tags(self, tokens, **kwargs)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 1188, in find_tags
map = kwargs.get( "map", None))
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 978, in find_tags
tagged.append([token, lexicon.get(token, i == 0 and lexicon.get(token.lower()) or None)])
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 104, in get
return self._lazy("get", *args)
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 85, in _lazy
self.load()
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 382, in load
dict.update(self, (x.split(" ")[:2] for x in _read(self._path) if x.strip()))
File "/Users/nihil/.pyenv/versions/emailbin/lib/python3.7/site-packages/textblob/_text.py", line 382, in <genexpr>
dict.update(self, (x.split(" ")[:2] for x in _read(self._path) if x.strip()))
RuntimeError: generator raised StopIteration
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:8
Top Results From Across the Web
does not work with python 3.7.1 raises StopIteration · Issue #40
i am trying to run the example with python 3.7.1 but it raises a generator StopIteration example: s = u"John is a cat"...
Read more >Python 3.7: StopIteration could be your next headache
Our library implements a tiny wrapper over the official python client library. Right, probably raising a StopIteration instead of simply return ...
Read more >generator raised StopIteration" every time I try to run app ...
To judge from the file paths, it looks like you're running Python 3.7. ... This won't execute RuntimeError: generator raised StopIteration ...
Read more >PEP 479 – Change StopIteration handling inside generators
This PEP proposes a change to generators: when StopIteration is raised inside a generator, it is replaced with RuntimeError . (More precisely, this...
Read more >Iterators - The Conservative Python 3 Porting Guide
Since Python 3.7, generators cannot raise StopIteration directly, but must stop with return (or at the end of the function). This change was...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I appear to be having the same issue in Python 3.8.0, with all dependencies updated to the latest version:
Not sure what’s raising the error so early on, unless there’s something obvious I’m missing or a formatting issue.
Hey. I am having the same error for python 3.8.2 Any fixes?