[Bug 920778] Review Request: python-MultipartPostHandler2 - A handler for urllib2 to enable multipart form uploading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Product: Fedora
https://bugzilla.redhat.com/show_bug.cgi?id=920778

Bohuslav "Slavek" Kabrda <bkabrda@xxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |fedora-review+

--- Comment #6 from Bohuslav "Slavek" Kabrda <bkabrda@xxxxxxxxxx> ---
The newlines are actually a correct behaviour. In Python 3, the read() method
of the opener object returns 'bytes' object. This is because it can't determine
the encoding of the URL content prior to reading it.
When you print a 'bytes' object in Python 3, this is exactly what happens. As
mentioned in [1], it is up to your program to determine the encoding from the
'bytes' object and then decode it properly into string. Therefore, if you use

print(opener.open(validatorURL, params).read().decode('utf-8'))

everything will work as you expect and it is also actually the "correct"
behaviour, so to say.

[1] http://docs.python.org/3/library/urllib.request.html#examples

Anyway, the specfile and SRPM look good, so please fix this nit before
importing, the package is


APPROVED

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=utBMPGoiwQ&a=cc_unsubscribe
_______________________________________________
package-review mailing list
package-review@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/package-review



[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]