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

Fix so that the uriIsPrivate takes a str #32

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

debbiedub
Copy link
Contributor

Here is a fix to be able to enter the private URI when creating a site.

base64.decodestring is deprecated and replaced by decodebytes.

@@ -3251,8 +3251,8 @@ def uriIsPrivate(uri):
if "/" in extra:
extra = extra.split("/")[0]
extra += "/"
extrabytes = base64.decodestring(extra)
isprivate = ord(extrabytes[1])
extrabytes = base64.decodebytes(extra.encode())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need an explicit encoding = "utf-8" argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the help of str.encode 'utf-8' is the default encoding so adding encoding='utf-8' will not add any value.

Another question it if this could have some other encoding. It should be an URI and as such I assume it is limited to ASCII (32 - 126) or perhaps even (33-126) so any utf-coding will probably work just as well.

@ArneBab
Copy link
Contributor

ArneBab commented Nov 4, 2022

Thank you!

@ArneBab ArneBab merged commit 1bce632 into hyphanet:py3 Nov 4, 2022
@debbiedub debbiedub deleted the fix_uriIsPrivate branch January 29, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants