Comfy-Org / Comfy-Org/ComfyUI

ValueError exception when requesting an image on a different drive

Open
#1,488 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

https://github.com/comfyanonymous/ComfyUI/blob/9562a6b49e63e63a16f3e45ff4965f72385f51fa/server.py#L270-L271

This code attempts to determine whether the requested file is in the output directory. If not then it returns a 403 error. However, if the requested file is on a different drive to the output dir, then `os.commonpath` will raise a `ValueError`, because files on different drives cannot have any common components.

`os.commonpath` is used in a similar way in various other places.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.