Repository navigation
Keep caller-owned binary streams open after reading ASCII PLY - #92
xixihaha-ha wants to merge 1 commit into
Conversation
|
Huh...I thought I replied two weeks ago, but apparently I forgot to submit the comment. Sorry about that. Thanks for reporting the bug, although this project doesn't accept AI-generated submissions, so this pull request can't be merged as-is. The Here's some more discussion and info on the problematic I can't give a firm ETA for applying this fix due to events in my personal life, but the most likely possibility is the first half of December. (I definitely won't be able to release the fix before December, whether or not it gets merged into |
Reading ASCII PLY from a caller-supplied binary stream creates a TextIOWrapper that closes the underlying stream when destroyed. Consequently
BytesIO.getvalue()or reusing the file afterPlyData.read()raises ValueError. This also occurs after a parsing error, whereas text streams and binary PLY streams remain open.Detach the internally created text wrapper in finally, leaving externally owned streams open while retaining the existing closure of files opened from paths. Add success and parse-error regression cases.
Validation: both new cases fail on unchanged code because the stream is closed. After the fix the complete test directory passes (123 passed), on Python 3.11 with NumPy 2.
AI assistance was used to investigate, implement and test this change.
📚 Documentation preview 📚: https://python-plyfile--92.org.readthedocs.build/en/92/