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

paths with ":" are encoded to "%3A" #3806

Closed
Freyert opened this issue Aug 3, 2023 · 3 comments
Closed

paths with ":" are encoded to "%3A" #3806

Freyert opened this issue Aug 3, 2023 · 3 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional information or feedback.

Comments

@Freyert
Copy link

Freyert commented Aug 3, 2023

Describe the bug

I have files in S3 with times in the name for example: "10:20.json". This is allowed even though : is a reserved character as specified in RFCS:

Unfortunately python encodes : to %3A. Which is incorrect and makes it impossible for me to work with my files in S3.

Expected Behavior

10:20.json should encode to 10:20.json.

Current Behavior

10:20.json is encoded to 10%3A20.json.

Reproduction Steps

I've looked around in the code and I can't quite figure out where this encoding happens, but I'm sure someone who knows the project can find it easily.

❯ python3
Python 3.11.3 (main, Apr  7 2023, 20:13:31) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.parse as parse
>>> parse
<module 'urllib.parse' from '/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/parse.py'>
>>> parse.quote_plus("10:12:15.json")
'10%3A12%3A15.json'

Possible Solution

Not sure.

Additional Information/Context

No response

SDK version used

boto3==1.28.4 botocore==1.31.4

Environment details (OS name and version, etc.)

aws lambda?

@Freyert Freyert added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2023
@tim-finnigan tim-finnigan self-assigned this Aug 4, 2023
@tim-finnigan
Copy link
Contributor

Hi @Freyert thanks for reaching out. Here's a related issue that I commented on a while back: #3584

As mentioned there you could use unquote_plus to replace encoded characters. Is that sufficient for addressing your use case or could you share more details regarding what you're trying to do? If you can provide a code snippet example that would help provide more context.

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. and removed bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Aug 4, 2023
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 10, 2023
@Freyert
Copy link
Author

Freyert commented Aug 10, 2023

👉 turns out that the lambda messages are url encoding things so this is not the source.

@Freyert Freyert closed this as completed Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional information or feedback.
Projects
None yet
Development

No branches or pull requests

2 participants