Closed
Description
Describe the bug
This happens in python 3.7 but seemingly not earlier versions.
>>> from rethinkdb import RethinkDB
>>> r = RethinkDB()
>>> r.now()
Traceback (most recent call last):
File "/Users/nlevitt/workspace/doublethink/doublethink-ve37/lib/python3.7/site-packages/rethinkdb/errors.py", line 246, in __iter__
for sub in next(itr):
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/nlevitt/workspace/doublethink/doublethink-ve37/lib/python3.7/site-packages/rethinkdb/ast.py", line 147, in __repr__
return "<RqlQuery instance: %s >" % str(self)
File "/Users/nlevitt/workspace/doublethink/doublethink-ve37/lib/python3.7/site-packages/rethinkdb/ast.py", line 144, in __str__
return printer.print_query()
File "/Users/nlevitt/workspace/doublethink/doublethink-ve37/lib/python3.7/site-packages/rethinkdb/errors.py", line 202, in print_query
return ''.join(self.compose_term(self.root))
File "/Users/nlevitt/workspace/doublethink/doublethink-ve37/lib/python3.7/site-packages/rethinkdb/errors.py", line 251, in __iter__
for sub in token:
RuntimeError: generator raised StopIteration
Can be a major problem if code tries to log a query before running it, for example.
To Reproduce
Steps to reproduce the behavior:
- see above
Expected behavior
Return a reasonable stringification.
Screenshots
If applicable, add screenshots to help explain your problem.
System info
- OS: tested on mac, linux
- RethinkDB Version: any
- Python client version: 2.4.1, 2.3.0
Additional context
Add any other context about the problem here.