You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see issue palewire/django-bakery#156. In one commit, I changed a couple places where that code uses os.path.join() for a path that will be validated by PyFilesystem2. However, there is still a validation issue with paths that start with C:/ and it is not clear to me how the abstraction is supposed to work.
PyFilesystem is always expecting paths with forward slashes, and you should not use fs.path with filesystem paths. In theory, the idea would be that you do:
defprep_directory(self, target_dir):
""" Prepares a new directory to store the file at the provided path, if needed. """dirname=path.dirname(target_dir)
ifdirname:
withfs.open_fs(settings.BUILD_DIR) asbuild_dir:
ifnotbuild_dir.exists(dirname):
logger.debug("Creating directory at {}".format(build_dir.getsyspath(dirname)))
build_dir.makedirs(dirname)
Please see issue palewire/django-bakery#156. In one commit, I changed a couple places where that code uses os.path.join() for a path that will be validated by PyFilesystem2. However, there is still a validation issue with paths that start with C:/ and it is not clear to me how the abstraction is supposed to work.
The issue is that when the BUILD_DIR is set to a path such as "C:\Users\davisda4\workdir\build", then the path is not valid according to
fs.path.validatepath
. The error occurs when checking whether the path exists at https://github.com/palewire/django-bakery/blob/master/bakery/views/base.py#L62.In this code,
self.fs
is an OSFS filesystem initialized from "osfs:///", which may not be valid on Windows.The text was updated successfully, but these errors were encountered: