[Bug 1202604] Review Request: python-sscg - Self-signed Certificate Generator

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1202604



--- Comment #13 from Stephen Gallagher <sgallagh@xxxxxxxxxx> ---
(In reply to Zbigniew Jędrzejewski-Szmek from comment #12)
> (In reply to Stephen Gallagher from comment #11)

> > Well, the problem here is that pyOpenSSL behaves differently between python2
> > and python3. On python2, crypto.dump_certificate() returns a str, but it
> > returns a binary type on python3. To support both language versions, I just
> > always pipe it through a conversion to UTF-8. I could do it the opposite
> > direction if that seems more sensible.
> UTF-8 *is* binary. Under python 2 you get a sequence of UTF-8 octets which
> you can directly write to a binary file. Under python 3 you get the same
> thing. The difference is that Python 3 makes the distinction between bytes
> and text, and considers this UTF-8-encoded Unicode string to be binary, and
> Python 2 does not make the distinction, so it allows it to be used as both,
> in some circumstances. The distinction is blurry, but under Python 2 'str'
> is binary.
> 
> I haven't tested this, but I'm pretty sure that if use the exact same code
> under Python 2 and 3, and not do any conversions, things should just work.

When I went to print this content in debug mode, I definitely got different
output to the screen. You could of course be correct that it would make no
difference programatically, so if you think it's sensible to only force the
conversion on screen-printing, I don't have a problem with that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
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]