Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.7: RuntimeError: generator raised StopIteration #145

Closed
tillea opened this issue Oct 25, 2018 · 3 comments
Closed

Python 3.7: RuntimeError: generator raised StopIteration #145

tillea opened this issue Oct 25, 2018 · 3 comments

Comments

@tillea
Copy link

tillea commented Oct 25, 2018

Hi,
there is a bug reported against the Debian packaged version. The packaged version is lagging behind (unfortunately) but I took this as reason to package the latest version. When doing so I was running into the same issue:

======================================================================
ERROR: test_fetch_whole_fasta (test_FastaRecord_iter.TestFastaRecordIter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyfaidx-0.5.5.1/pyfaidx/__init__.py", line 825, in __iter__
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/build/python-pyfaidx-0.5.5.1/tests/test_FastaRecord_iter.py", line 21, in test_fetch_whole_fasta
    result = list(chain(*([line for line in record] for record in Fasta('data/genes.fasta', as_raw=True))))
  File "/build/python-pyfaidx-0.5.5.1/tests/test_FastaRecord_iter.py", line 21, in <genexpr>
    result = list(chain(*([line for line in record] for record in Fasta('data/genes.fasta', as_raw=True))))
  File "/build/python-pyfaidx-0.5.5.1/tests/test_FastaRecord_iter.py", line 21, in <listcomp>
    result = list(chain(*([line for line in record] for record in Fasta('data/genes.fasta', as_raw=True))))
RuntimeError: generator raised StopIteration

======================================================================
ERROR: test_reverse_iter (test_FastaRecord_iter.TestFastaRecordIter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyfaidx-0.5.5.1/pyfaidx/__init__.py", line 825, in __iter__
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/build/python-pyfaidx-0.5.5.1/tests/test_FastaRecord_iter.py", line 30, in test_reverse_iter
    expect = list(chain(*([line[::-1] for line in record][::-1] for record in Fasta('data/genes.fasta', as_raw=True))))
  File "/build/python-pyfaidx-0.5.5.1/tests/test_FastaRecord_iter.py", line 30, in <genexpr>
    expect = list(chain(*([line[::-1] for line in record][::-1] for record in Fasta('data/genes.fasta', as_raw=True))))
  File "/build/python-pyfaidx-0.5.5.1/tests/test_FastaRecord_iter.py", line 30, in <listcomp>
    expect = list(chain(*([line[::-1] for line in record][::-1] for record in Fasta('data/genes.fasta', as_raw=True))))
RuntimeError: generator raised StopIteration

Name                  Stmts   Miss  Cover   Missing
---------------------------------------------------
pyfaidx/__init__.py     712    146    79%   14-15, 165, 170, 293, 336-347, 350, 360-367, 377-381, 389, 393, 418-419, 444, 447, 483, 485, 491, 545-546, 590, 597-600, 665-668, 711,    724, 726, 746, 761-772, 778, 803, 810, 850, 893-904, 927, 939, 943, 945, 947, 952, 1007, 1015-1016, 1019, 1054, 1061, 1083-1122, 1125, 1134-1154, 1198-1203, 1211-1212, 1250, 1258, 1264- 1265
pyfaidx/cli.py          256    128    50%   31-36, 47-50, 78, 80, 91-106, 120-140, 181-182, 186, 190, 192, 195, 202-207, 211-217, 231, 234, 240-242, 251-253, 259, 268-281, 285, 289- 290, 293-296, 311-318, 324-331, 337-345, 351-361, 364
---------------------------------------------------
TOTAL                   968    274    72%
----------------------------------------------------------------------
Ran 139 tests in 14.694s

FAILED (SKIP=36, errors=2)

Kind regards, Andreas.

@mdshw5
Copy link
Owner

mdshw5 commented Oct 27, 2018

Fantastic. Thanks for reporting! Guess I need to add 3.7 to my test suite.

@mdshw5
Copy link
Owner

mdshw5 commented Oct 27, 2018

I’ve pushed a 3.7 compatible version to CI, and it should be released to PyPI within the hour. Thanks for propagating the bug report over here!

@tillea
Copy link
Author

tillea commented Oct 27, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants