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

Regression: basic authentication in URL does not work #84

Closed
dottedmag opened this issue Jan 20, 2020 · 13 comments · Fixed by #188
Closed

Regression: basic authentication in URL does not work #84

dottedmag opened this issue Jan 20, 2020 · 13 comments · Fixed by #188
Labels
blocked is:bug Nasty little bugger. is:upstream tracking an upstream issue

Comments

@dottedmag
Copy link

% r2e list  | grep netch
23: [*] netch (https://dottedmag:<redacted password>@netch.dreamwidth.org/data/atom?auth=digest -> dottedmag@dottedmag.net)
% r2e run --no-send
processing error: expected bytes-like object, not str: netch (https://dottedmag:<redacted password>@netch.dreamwidth.org/data/atom?auth=digest -> dottedmag@dottedmag.net)
% r2e --version
rss2email 3.9
%

It used to work in an ancient Python 2 version of rss2email.

@Ekleog
Copy link
Member

Ekleog commented Jan 21, 2020

Are there non-ascii characters in the <redacted password>? That sounds like something that could cause this issue, and be due to the 2->3 switch.

@dottedmag
Copy link
Author

Nope, purely uppercase and lowercase ASCII Latin and digits.

@Profpatsch
Copy link
Contributor

That’s a classic issue; we are probably using a bytes-based function and passing a unicode string.

@Ekleog Ekleog added good first issue An easy task to tackle if you want to contribute. help wanted is:bug Nasty little bugger. needs:code needs:tests labels Sep 11, 2020
@lkmorlan
Copy link

URLs of this format used to work:
https://user:pass@example.com/path

Now I get "processing error: nonnumeric port: 'pass'". It is not correctly parsing the URL and interprets the password to be the port.

@Ekleog
Copy link
Member

Ekleog commented Sep 15, 2020

With what version of feedparser is this new error? Also, do you remember with what versions of rss2email/feedparser the “previously working” behavior was?

@lkmorlan
Copy link

I think it was a 2.x version of rss2email. I copied that comment from my 2017 report in the wking repository.

@Ekleog
Copy link
Member

Ekleog commented Sep 15, 2020

Hmm ok, thank you :) just, do you know whether this is happening with feedparser 5 or 6 ?

@lkmorlan
Copy link

I am seeing this problem in the rss2email package in Debian which depends on python3-feedparser 5.2.

@auouymous
Copy link
Contributor

http://test:password@foo.com/bar.php can be used to test this since nothing is sent to the server.

[ERROR] processing error: a bytes-like object is required, not 'str': test (http://test:password@foo.com/bar.php -> rss2email)

The problem is entirely in feedparser. Encoding user_passwd (in feedparser) fixes the initial error and then throws the same error in return opener.open(request). That code is different in 6.0 so it might have been fixed.

-    auth = base64.standard_b64encode(user_passwd).strip()
+    auth = base64.standard_b64encode(user_passwd.encode()).strip()

@Ekleog
Copy link
Member

Ekleog commented Sep 17, 2020

Hmm ok, so I guess let's block this on #73 and see whether it still happens after that is fixed, and then reevaluate whether it's an upstream issue or a local one :)

@Ekleog Ekleog added blocked and removed good first issue An easy task to tackle if you want to contribute. help wanted needs:code needs:tests labels Sep 17, 2020
@auouymous
Copy link
Contributor

Feedparser 6.0.1 has the same problem, kurtmckee/feedparser#234 fixes it.

@Ekleog Ekleog added the is:upstream tracking an upstream issue label Mar 19, 2021
@auouymous
Copy link
Contributor

This is fixed with feedparser 6.0.5. After #188 is merged the required version in setup.py and pyproject.toml should be bumped.

@Ekleog
Copy link
Member

Ekleog commented Jun 15, 2021

Should hopefully be fixed now :) Thank you all for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked is:bug Nasty little bugger. is:upstream tracking an upstream issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants