4
4
from __future__ import print_function
5
5
from __future__ import unicode_literals
6
6
7
- import operator
8
7
import os
9
8
import tarfile
10
9
import typing
11
10
from collections import OrderedDict
12
- from typing import cast , IO
13
11
14
12
import six
15
13
from six .moves import map
@@ -309,7 +307,7 @@ def _directory_entries(self):
309
307
310
308
# add all implicit dirnames if not in the cache already
311
309
for partial_name in map (relpath , recursepath (_name )):
312
- dirinfo = tarfile .TarInfo (self . _encode (partial_name ))
310
+ dirinfo = tarfile .TarInfo (_encode (partial_name ))
313
311
dirinfo .type = tarfile .DIRTYPE
314
312
_cache .setdefault (partial_name , dirinfo )
315
313
@@ -391,7 +389,6 @@ def getinfo(self, path, namespaces=None):
391
389
raw_info ["details" ] = {"type" : int (ResourceType .directory )}
392
390
393
391
else :
394
-
395
392
_realpath = self ._resolve (_path )
396
393
if _realpath is None :
397
394
raise errors .ResourceNotFound (path )
@@ -406,10 +403,10 @@ def getinfo(self, path, namespaces=None):
406
403
407
404
if "link" in namespaces :
408
405
if member .issym ():
409
- target = join (
406
+ target = normpath ( join (
410
407
dirname (self ._decode (member .name )),
411
408
self ._decode (member .linkname ),
412
- )
409
+ )) # type: Option[Text]
413
410
else :
414
411
target = None
415
412
raw_info ["link" ] = {"target" : target }
0 commit comments