zowe / zowe/zowe-client-python-sdk

`_encode_uri_path_for_uss` does not skip encoded URIs

Open
#413 1 comment 0 reactions 1 assignee View on GitHub

@aadityasinha-dotcom is already working on this.

Since Sep 10, 2026.

  • #415 by @aadityasinha-dotcom — open
bug priority-low severity-low
Dominant language
Python
Stars
44
Forks
38
Avg merge
1d 3h
Merged PRs (30d)
1

Description

Describe the bug

_encode_uri_path_for_uss function does not acknowledge encoding on a URI given as input, which can result in invalid URI encoding sequences.

Expected and actual results

Expected: _encode_uri_path_for_uss should either skip encoded URIs, or at least have a note on the function clarifying that it should not be used with a URI that's already encoded.
Actual: The function encodes the URI again, causing incorrect URI encoding.

Example Python logic to detect and return early for this case:

from urllib.parse import unquote

def is_uri_encoded(uri: str) -> bool:
    """Returns True if the URI contains percent-encoded characters."""
    return uri != unquote(uri)

# Examples
print(is_uri_encoded("https://example.com%20world"))  # True
print(is_uri_encoded("https://example.com world"))  # False

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.