mirror of https://github.com/borgbackup/borg.git
deal with unicode errors for symlinks in same way as for regular files, fixes #382
This commit is contained in:
parent
ba67b96434
commit
5595d56ecf
|
@ -342,7 +342,10 @@ Number of files: {0.stats.nfiles}'''.format(self)
|
|||
source = item[b'source']
|
||||
if os.path.exists(path):
|
||||
os.unlink(path)
|
||||
try:
|
||||
os.symlink(source, path)
|
||||
except UnicodeEncodeError:
|
||||
raise self.IncompatibleFilesystemEncodingError(source, sys.getfilesystemencoding())
|
||||
self.restore_attrs(path, item, symlink=True)
|
||||
elif stat.S_ISFIFO(mode):
|
||||
if not os.path.exists(os.path.dirname(path)):
|
||||
|
|
Loading…
Reference in New Issue