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
As of v0.3.8, http directories are incorrectly identified as a regular file.
Reproducing snippet
import upath
known_dir = upath.UPath("https://data.lsdb.io/hats/")
f"as of {upath.__version__}, known dir {'IS' if known_dir.is_dir() else 'is NOT'} is a directory, known dir {'IS' if known_dir.is_file() else 'is NOT'} is a regular file"
And outputs from running under two most recent versions:
'as of 0.3.7, known dir IS is a directory, known dir is NOT is a regular file'
'as of 0.3.8, known dir IS is a directory, known dir IS is a regular file'
The reason it behaves like this is, that directories on http filesystems are html files with <a> link tags in them, that are relative or share a common prefix.
I know this is confusing when thinking about it in terms of the local filesystem, but on many remote filesystems is_file() and is_dir() are not mutually exclusive.
Let me know if you need a recommendation if this bug fix broke some of your code. I am happy to look over it to recommend a more robust way to check this in a compatible manner for remote filesystems.
Activity
ap-- commentedon Jan 12, 2026
Thank you for reporting @delucchi-cmu 🙏
This is actually correct behavior for the http filesystem and was incorrect in earlier versions. If you check this with plain fsspec:
The reason it behaves like this is, that directories on http filesystems are html files with
<a>link tags in them, that are relative or share a common prefix.I know this is confusing when thinking about it in terms of the local filesystem, but on many remote filesystems is_file() and is_dir() are not mutually exclusive.
Let me know if you need a recommendation if this bug fix broke some of your code. I am happy to look over it to recommend a more robust way to check this in a compatible manner for remote filesystems.