Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2020-12-31 20:03:29 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2021-01-04 17:43:04 +0300
commit6f8f0d86e4a66e6b43c2f9676619f3d89fae6acb (patch)
tree4225ddc40344fe92944ad3aebd150c437de34051 /calm/pkg2html.py
parentb146f244ce0f015948cff181188b2696c6c996eb (diff)
Add zstd to permitted archive compressions
Use the xtarfile module to handle zstd compressed archive. Note this isn't quite as straightforward as 'import xtarfile as tarfile', because it isn't precisely a drop-in replacement for tarfile, because: (i) the 'mode' argument to xtarfile.open() is mandatory, and (ii) it doesn't re-export tarfile exception classes such as tarfile.ReadError
Diffstat (limited to 'calm/pkg2html.py')
-rwxr-xr-xcalm/pkg2html.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/calm/pkg2html.py b/calm/pkg2html.py
index 32709bb..ffd16b0 100755
--- a/calm/pkg2html.py
+++ b/calm/pkg2html.py
@@ -49,9 +49,9 @@ import os
import re
import string
import sys
-import tarfile
import textwrap
import time
+import xtarfile
from .version import SetupVersion
from . import common_constants
@@ -482,7 +482,7 @@ def write_arch_listing(args, packages, arch):
pass
else:
try:
- with tarfile.open(tf) as a:
+ with xtarfile.open(tf, mode='r') as a:
for i in a:
print(' %-16s%12d %s' % (time.strftime('%Y-%m-%d %H:%M', time.gmtime(i.mtime)), i.size, i.name), file=f, end='')
if i.isdir():