dotlocalslashbin 0.0.5__tar.gz → 0.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dotlocalslashbin
3
- Version: 0.0.5
3
+ Version: 0.0.7
4
4
  Summary: Download and extract files to ~/.local/bin/
5
5
  Author-email: Keith Maxwell <keith.maxwell@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -23,7 +23,7 @@ from urllib.request import urlopen
23
23
  from zipfile import ZipFile
24
24
 
25
25
 
26
- __version__ = "0.0.5"
26
+ __version__ = "0.0.7"
27
27
 
28
28
 
29
29
  class CustomNamespace(Namespace):
@@ -111,7 +111,7 @@ def _download(
111
111
  downloaded = Path(url)
112
112
 
113
113
  if action is None:
114
- if url.endswith(".tar.gz"):
114
+ if url.endswith(".tar.gz") or url.endswith(".tar"):
115
115
  action = "untar"
116
116
  elif url.endswith(".zip"):
117
117
  action = "unzip"
@@ -140,7 +140,11 @@ def _download(
140
140
  member.path = member.path.removeprefix(prefix)
141
141
  if member.path in ignore:
142
142
  continue
143
- file.extract(member, path=target.parent, filter="tar")
143
+ try:
144
+ file.extract(member, path=target.parent, filter="tar")
145
+ except TypeError: # before 3.11.4 e.g. Debian 12
146
+ file.extract(member, path=target.parent)
147
+
144
148
  elif action == "command" and command is not None:
145
149
  kwargs = dict(target=target, downloaded=downloaded)
146
150
  run(split(command.format(**kwargs)), check=True)