#90 Fix urlparse and encoding for python3
Merged by cverna. Opened by cverna.
cverna/pagure-importer fix_py3  into  master

Download 90.patch

Make urlparse and attachment filename encoding compatible with python3

:thumbsup:

This is running with py3 but the content of the attachment is not correct :(. I am trying to fix that

rebased

This PR fixes the import of images to pagure and get pagure to display the images in the comment :monkey_face:

just like that --> https://stg.pagure.io/test_image/issue/27

1 new commit added

  • Replace re.match by re.search

shouldn't this be encode? http://stackoverflow.com/a/6048203/3181759 (i don't fully understand encode/decode)

5 new commits added

  • Fixed the way we write the data to the attachment file.
  • Nice display of images in pagure
  • Fixing missing space in prompt
  • Fixed image decoding/encoding from trac to pagure
  • Fix urlparse and encoding for python3

the content of the attachment is a bytes b'i am a bytes' so when using decode I try to deocde the bytes to a sting in that case using UTF-8. If it fails I leave the content in bytes.

This should be ok now :p
Tested using fedora-websites which has a lot of attachment :)

Results is here

:thumbsup:

Thanks ;)

Pull-Request has been merged by cverna

Metadata