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

urlwatch: username:password@url domains do not work #12021

Closed
makefu opened this issue Dec 29, 2015 · 5 comments
Closed

urlwatch: username:password@url domains do not work #12021

makefu opened this issue Dec 29, 2015 · 5 comments

Comments

@makefu
Copy link
Contributor

makefu commented Dec 29, 2015

With the py3k patch for urlwatch ( pkgs/tools/networking/urlwatch/default.nix ) 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 in the package Building:

  nixpkgs.config.packageOverrides = pkgs: {
    urlwatch = with pkgs.pythonPackages; buildPythonPackage rec {
      name = "urlwatch-1.18";

      propagatedBuildInputs =  [ futures ];

      src = pkgs.fetchurl {
        url = "http://thp.io/2008/urlwatch/${name}.tar.gz";
        sha256 = "090qfgx249ks7103sap6w47f8302ix2k46wxhfssxwsqcqdl25vb";
      };

      postFixup = ''
        wrapProgram "$out/bin/urlwatch" --prefix "PYTHONPATH" : "$PYTHONPATH"
      '';
    };
  }

I am not sure what the inital idea was behind the patch to py3k and i am therefore not sure if i should open an PR for this issue.

@jgillich
Copy link
Member

This is an upstream bug, the conversion script is part of their source tree.

@makefu
Copy link
Contributor Author

makefu commented Dec 29, 2015

@jgillich i see, i will open a ticket in urlwatch upstream.
see Above :)

@jgillich
Copy link
Member

That being said, maybe using Python 2 here is just better overall, 2to3 was never meant to be fully automatic AFAIK.. @domenkozar

@4z3
Copy link
Contributor

4z3 commented Jan 17, 2016

#12445 bumps urlwatch to 2.0, which has dropped Python 2 support. It is still unable to fetch URLs with embedded username and password (thp/urlwatch#31), but I think we can close the issue here as it is not related to nixpkgs.

@globin
Copy link
Member

globin commented Jan 17, 2016

Yup this is an upstream issue, closing here.

(But I'll be happy to apply a patch temporarily)

@globin globin closed this as completed Jan 17, 2016
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

4 participants