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

username:password@url domains do not work after Python3k conversion. #26

Closed
makefu opened this issue Dec 29, 2015 · 1 comment
Closed

Comments

@makefu
Copy link

makefu commented Dec 29, 2015

With the py3k conversion ( ./convert-to-python3.sh ) for urlwatch URLs with the pattern http://username:password@localhost/ do not work.

urlwatch crashes with:

File "/nix/store/sv62w8czrr5pziwwkgi67xw2vbc3swrs-python3.4-urlwatch-1.18/bin/.urlwatch-wrapped", line 307, in <module>
raise exception
File "/nix/store/4z7g0rlc27nwyq1mfn57kiijnnqn2swk-python3-3.4.3/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/nix/store/sv62w8czrr5pziwwkgi67xw2vbc3swrs-python3.4-urlwatch-1.18/bin/.urlwatch-wrapped", line 288, in process_job
data = job.retrieve(timestamp, filter_func, headers, log)
File "/nix/store/sv62w8czrr5pziwwkgi67xw2vbc3swrs-python3.4-urlwatch-1.18/lib/python3.4/site-packages/urlwatch/handler.py", line 142, in retrieve
parts.password)).encode('base64').strip())
LookupError: 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecs

This issue does not occur when using python2 instead.

Initially i opened a ticket at NixOS/nixpkgs#12021

@jgillich
Copy link

In handler.py#L142:

headers['Authorization'] = 'Basic %s' % (auth_token.encode('base64').strip())

2to3 somehow misses that.

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

No branches or pull requests

3 participants