On May 18, 2012, at 04:41 PM, Martin Pitt wrote:

>I just uploaded Apport 2.1 to Quantal. A big change in that version is
>that the whole code now works with both Python 2 and 3, except for the
>launchpadlib crash database backend (as we do not yet have a
>python3-launchpadlib package).

More great Python 3 porting news, thanks Martin!

(FWIW, I'm currently working on the launchpadlib stack.  There are a bunch of
dependencies to get ported first.  Ping me on irc if you want to help.)

>However, you need to watch out if you use projects or scripts which
>directly use python-apport to process reports: The open(), write(),
>and write_mime() methods now require the passed file descriptors to be
>open in binary mode. You will get an exception otherwise.
>
>A common pattern so far has been code like
>
>  report = apport.Report()
>  report.load(open('myfile.crash'))
>
>This needs to be changed to
>
>  report = apport.Report()
>  with open('myfile.crash', 'rb') as f:
>      report.load(f)

I've added some of these recommendations to the quick porting guide:

https://wiki.ubuntu.com/Python/3

Cheers,
-Barry

Attachment: signature.asc
Description: PGP signature

-- 
ubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel

Reply via email to