question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DeprecationWarning: generator ... raised StopIteration

See original GitHub issue

FYI, I’m getting a DepreciationWarning in two places when usingpysmt.shortcuts.read_smtlib():

.../env/lib/python3.6/site-packages/pysmt/smtlib/parser.py:179: DeprecationWarning: generator 'Tokenizer.create_generator' raised StopIteration
  return next(self.generator)
.../env/lib/python3.6/site-packages/pysmt/smtlib/parser.py:796: DeprecationWarning: generator 'SmtLibParser.get_command' raised StopIteration
  for cmd in self.get_command(tokens):

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
marcogariocommented, May 30, 2018

Thanks for reporting this. This is an issue that comes after python 3.4, that we have not yet cleaned-up. See https://www.python.org/dev/peps/pep-0479/#consequences-for-existing-code

We fall in the slightly more complex example discussed there. Wrapping the calls to next with a try/except should be sufficient to avoid the exception to surface. If you want to try to create a patch for this issue, I would be glad to support you!

0reactions
samuelkolbcommented, Jan 11, 2019

Steps to reproduce the error:

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get rid of warning "DeprecationWarning generator ...
This is happening because ngrams is raising StopIteration exception to end a generator, and this is deprecated from Python 3.5.
Read more >
Python deprecationwarning generator raised StopIteration, Python ...
This is happening because ngrams is raising StopIteration exception to end a generator, and this is deprecated from Python 3.5. You could get...
Read more >
PEP 479 – Change StopIteration handling inside generators
This PEP proposes a change to generators: when StopIteration is raised inside ... silent deprecation warning if StopIteration bubbles out of a generator...
Read more >
Python 3.7: StopIteration could be your next headache
Flag generator is exhausted raise StopIteration ... As I upgraded from 3.5 to 3.7, I didn't get any deprecation warning.
Read more >
Python agent throwing noisy deprecation warning in logs
/usr/local/lib/python3.6/contextlib.py:99: DeprecationWarning: generator 'common_exception_handling' raised StopIteration ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found