Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure support for .. in path #495

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed `CloudPath(...) / other` to correctly attempt to fall back on `other`'s `__rtruediv__` implementation, in order to support classes that explicitly support the `/` with a `CloudPath` instance. Previously, this would always raise a `TypeError` if `other` were not a `str` or `PurePosixPath`. (PR [#479](https://github.com/drivendataorg/cloudpathlib/pull/479))
- Fixed `AzureBlobPath(...).blob` to correctly resolves path to the blob for situations when specified path contains `..`.

## v0.20.0 (2024-10-18)

Expand Down
6 changes: 5 additions & 1 deletion cloudpathlib/azure/azblobpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ def container(self) -> str:

@property
def blob(self) -> str:
key = self._no_prefix_no_drive
key = (
Path(self._no_prefix_no_drive).resolve().as_posix()
if self._no_prefix_no_drive
else self._no_prefix_no_drive
)

# key should never have starting slash for
if key.startswith("/"):
Expand Down