Skip to content

Conversation

@dstrain115
Copy link
Collaborator

  • The option 'r|xz' opens an lzma compressed stream for reading.
  • This causes a StreamError: "seeking backwards is not allowed".
  • This changes it to 'r:xz' which opens it as a normal file so it is seekable.
  • This fixes a problem with rendering the documentation for reCirq
- The option 'r|xz' opens an lzma compressed stream for reading. - This causes a StreamError: "seeking backwards is not allowed". - This changes it to 'r:xz' which opens it as a normal file so it is seekable. - This fixes a problem with rendering the documentation for reCirq
@mhucka
Copy link
Collaborator

mhucka commented Aug 17, 2025

This is peculiar. When I run pytest recirq/documentation_utils_test.py on MacOS under Python 3.11, it passes, yet it does contain a test that invokes fetch_guide_data_collection_data. The test is evidently insufficient. @dstrain115 How did you get the stream error? We should improve the test.

@dstrain115
Copy link
Collaborator Author

This is peculiar. When I run pytest recirq/documentation_utils_test.py on MacOS under Python 3.11, it passes, yet it does contain a test that invokes fetch_guide_data_collection_data. The test is evidently insufficient. @dstrain115 How did you get the stream error? We should improve the test.

The function fetch_guide_data_collection_data downloads data from the internet, so the test patches @mock.patch('urllib.request.urlopen') so somehow this error doesn't manifest then.

I ran it in a colab.

@mhucka
Copy link
Collaborator

mhucka commented Aug 18, 2025

It check and it works with either way (using : or |) from a command-line invocation. Since it works in more places (apparently) with :, this change is certainly worth making.

Thanks for finding & fixing this!

Copy link
Collaborator

@mhucka mhucka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhucka mhucka merged commit 976191d into quantumlib:master Aug 18, 2025
5 checks passed
mhucka pushed a commit to snichet/ReCirq that referenced this pull request Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants