Skip to content

Commit

Permalink
upath.implementations.memory: normalize to two slashes for py312
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Jan 26, 2024
1 parent f6718b4 commit 69b3391
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions upath/implementations/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,17 @@ def iterdir(self):
def path(self):
path = super().path
return "/" if path == "." else path

@classmethod
def _format_parsed_parts(
cls,
drv: str,
root: str,
parts: list[str],
url: SplitResult | None = None,
**kwargs: Any,
) -> str:
s = super()._format_parsed_parts(drv, root, parts, url=url, **kwargs)
if s.startswith("memory:///"):
s = s.replace("memory:///", "memory://", 1)
return s

0 comments on commit 69b3391

Please sign in to comment.