Skip to content

Commit

Permalink
fix: remote xlsx file reading with python 3.12 (#1684)
Browse files Browse the repository at this point in the history
- fixes #1642 

Adapt to changes of API of `_TemporaryFileWrapper` in python 3.12,
unfortunately not intercepted by pyright (see issue for details). The
fix does not rely on this class's API, as the value is already stored in
a local variable.
  • Loading branch information
pierrecamilleri authored Sep 27, 2024
1 parent 207e4f4 commit 80f03c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frictionless/formats/excel/parsers/xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def read_loader(self):
target = tempfile.NamedTemporaryFile(delete=delete)
shutil.copyfileobj(loader.byte_stream, target)
target.seek(0)
if not target.delete:

if not delete:
control.workbook_cache[path] = target.name # type: ignore
atexit.register(os.remove, target.name)
# TODO: rebase on using resource without system?
Expand Down

0 comments on commit 80f03c6

Please sign in to comment.