Skip to content

Commit

Permalink
fix(wdi_login): Remove byte-encoding from split
Browse files Browse the repository at this point in the history
The question mark that is part of the oauth callback URL is not
byte-encoded.
Keeping the byte-encoding mark in here leads to

```
    response_qs = self.response_qs.split(b'?')[-1]
TypeError: must be str or None, not bytes
```

This may differ per platform, but then maybe this PR will
spark a discussion that has not yet been started from issue SuLab#181
  • Loading branch information
kwisatz committed Oct 7, 2022
1 parent 069da81 commit 5ea8d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wikidataintegrator/wdi_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def continue_oauth(self, oauth_callback_data=None):
self.response_qs = input("Callback URL: ")

# input the url from redirect after authorization
response_qs = self.response_qs.split(b'?')[-1]
response_qs = self.response_qs.split('?')[-1]

# Step 3: Complete -- obtain authorized key/secret for "resource owner"
access_token = self.handshaker.complete(self.request_token, response_qs)
Expand Down

0 comments on commit 5ea8d76

Please sign in to comment.