Skip to content

bpo-47218: add name to lzma fileobject - #32312

Closed
ellaellela wants to merge 2 commits into
python:mainfrom
ellaellela:add-name-lzma
Closed

bpo-47218: add name to lzma fileobject#32312
ellaellela wants to merge 2 commits into
python:mainfrom
ellaellela:add-name-lzma

Conversation

@ellaellela

@ellaellela ellaellela commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

@MaxwellDupre MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ran 119 tests in 20.603s
OK (skipped=2)
Looks ok.

Comment thread Lib/lzma.py
trailing_error=LZMAError, format=format, filters=filters)
self._buffer = io.BufferedReader(raw)

if not isinstance(filename, (str, bytes)):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What if it is a path-like object?

Also, if it is a file, we perhaps can use its name. Actually, we perhaps can simply use self._fp.name.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Thank you for your PR @ellaellela, but this is a part of more complex issue #115961. It is better to solve it all in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment