pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 88 forks source link

io.UnsupportedOperation when running from CLI #298

Closed pushfoo closed 1 hour ago

pushfoo commented 8 months ago

Overview

Converting RST from the CLI breaks if run as follows:

python -m readme_renderer ~/src/python-benedict/README.rst

Python versions tried: 3.9, 3.10, 3.12

Environment Info

Software Version / Comments
OS Debian 11
Python 3.9 System default
Python 3.11 Built from source
Python 3.12 Built from source

Replication Steps

  1. Install from source or pip install readme_renderer
  2. python -m readme_renderer README.rst per the --help instructions
  3. Observe the following (3.12 output below, exact formatting varies):
    <string>:297: (WARNING/2) Inline literal start-string without end-string.
    Traceback (most recent call last):
     File "<frozen runpy>", line 198, in _run_module_as_main
     File "<frozen runpy>", line 88, in _run_code
     File "/home/user/src/readme_renderer/readme_renderer/__main__.py", line 62, in <module>
       main()
     File "/home/user/src/readme_renderer/readme_renderer/__main__.py", line 50, in main
       rendered = render_rst(source, stream=sys.stderr)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/home/user/src/readme_renderer/readme_renderer/rst.py", line 133, in render
       if not stream.tell():
              ^^^^^^^^^^^^^
    io.UnsupportedOperation: underlying stream is not seekable
miketheman commented 8 months ago

I cannot reproduce this issue. Can you provide the RST source that is causing this error?

miketheman commented 1 hour ago

Closing due to lack of response.