Convert BlendPath to pathlib.Path using local filesystem encoding
UTF-8 is tried first, and if that fails the local filesystem encoding is used.
This commit is contained in:
@@ -59,8 +59,7 @@ class _Tracer:
|
||||
abspath = lib_block.bfile.abspath(relpath)
|
||||
|
||||
# Convert bytes to pathlib.Path object so we have a nice interface to work with.
|
||||
# This assumes the path is encoded in UTF-8.
|
||||
path = pathlib.Path(abspath.decode())
|
||||
path = abspath.to_path()
|
||||
try:
|
||||
path = path.resolve()
|
||||
except FileNotFoundError:
|
||||
|
||||
@@ -98,7 +98,7 @@ class BlockUsage:
|
||||
"""
|
||||
|
||||
bpath = self.block.bfile.abspath(self.asset_path)
|
||||
path = pathlib.Path(bpath.decode())
|
||||
path = bpath.to_path()
|
||||
if not self.is_sequence:
|
||||
if not path.exists():
|
||||
log.warning('Path %s does not exist for %s', path, self)
|
||||
|
||||
Reference in New Issue
Block a user