try:
if stat.S_ISLNK(st.st_mode):
self.symlink_target = os.readlink(path)
+ # might have read a different link than the
+ # one that was in place when we did stat()
+ self.size = len(self.symlink_target)
except OSError as e:
add_error('readlink: %s' % e)
def from_path(path, statinfo=None, archive_path=None,
save_symlinks=True, hardlink_target=None,
normalized=False):
+ # This function is also a test hook; see test-save-errors
"""Return the metadata associated with the path. When normalized is
true, return the metadata appropriate for a typical save, which
may or may not be all of it."""