Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f5400fa

Browse filesBrowse files
committed
more diff-friendly disabling xz
1 parent b6c0101 commit f5400fa
Copy full SHA for f5400fa

File tree

Expand file treeCollapse file tree

2 files changed

+14
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-9
lines changed

‎Lib/tarfile.py

Copy file name to clipboardExpand all lines: Lib/tarfile.py
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,13 @@ def __init__(self, name, mode, comptype, fileobj, bufsize,
392392

393393
elif comptype == "xz":
394394
try:
395-
# TODO: RUSTPYTHON remove underscore
396-
import lzma_
395+
import lzma
397396
except ImportError:
398397
raise CompressionError("lzma module is not available") from None
398+
399+
# XXX: RUSTPYTHON; xz is not supported yet
400+
raise CompressionError("lzma module is not available") from None
401+
399402
if mode == "r":
400403
self.dbuf = b""
401404
self.cmp = lzma.LZMADecompressor()
@@ -1924,11 +1927,13 @@ def xzopen(cls, name, mode="r", fileobj=None, preset=None, **kwargs):
19241927
raise ValueError("mode must be 'r', 'w' or 'x'")
19251928

19261929
try:
1927-
# TODO: RUSTPYTHON remove underscore
1928-
from lzma_ import LZMAFile, LZMAError
1930+
from lzma import LZMAFile, LZMAError
19291931
except ImportError:
19301932
raise CompressionError("lzma module is not available") from None
19311933

1934+
# XXX: RUSTPYTHON; xz is not supported yet
1935+
raise CompressionError("lzma module is not available") from None
1936+
19321937
fileobj = LZMAFile(fileobj or name, mode, preset=preset)
19331938

19341939
try:

‎Lib/test/support/__init__.py

Copy file name to clipboardExpand all lines: Lib/test/support/__init__.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,11 @@ def requires_bz2(reason='requires bz2'):
494494
return unittest.skipUnless(bz2, reason)
495495

496496
def requires_lzma(reason='requires lzma'):
497-
# try:
498-
# import lzma
499-
# except ImportError:
500-
# lzma = None
501-
# TODO: RUSTPYTHON
497+
try:
498+
import lzma
499+
except ImportError:
500+
lzma = None
501+
# XXX: RUSTPYTHON; xz is not supported yet
502502
lzma = None
503503
return unittest.skipUnless(lzma, reason)
504504

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.