jonashaag / klaus

docker run klaus / pip install klaus — the first Git web viewer that Just Works™.
http://klausdemo.lophus.org
Other
685 stars 101 forks source link

Printing file name as bytes object to URL #236

Closed tato closed 5 years ago

tato commented 5 years ago

I downloaded klaus from pip for python 3. Ran it simply with klaus git-test.git --host [redacted]. I can access the web view for the repository. When clicking on a file or a commit, I get a 404 http error. If the URL is inspected it's clear that the file name / commit id are being printed as byte objects. Here are a couple of sample URLs I got.

http://[redacted]:8080/git-test/blob/master/b'main.c'
http://[redacted]:8080/git-test/commit/b'd5988f88d5d406d996394c2032e2dfb8a07f6bb6'/

If the extra characters are removed the page renders correctly. Unless I did something wrong, it looks like a difference between python 2 and python 3 to me. If that is the case, it should not be hard to fix using bytes.decode() or manually removing the extra characters, provided you are trying to support python 3 as well.

jonashaag commented 5 years ago

Thanks for the report. Looks like a duplicate of #233. I’ll make a new release soon.