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

Bug#807104: python-apt-doc: Use of print statements not compatible with python3



Control: severity -1 wishlist

On Sat, Dec 05, 2015 at 12:25:02PM +0100, Felix Dietrich wrote:
> Package: python-apt-doc
> Version: 1.1.0~beta1
> Severity: normal
> Tags: patch
> 
> The examples make use of the print statements such that it is
> incompatible with python3, e.g.:
> 
>     print "Essential packages:"
>     print >> sys.stderr, "need filename argument"
> 
> The attached patch modifies these lines to read:
> 
>     print("Essential packages:")
>     sys.stderr.write("need filename argument\n")

Thanks for your patch. It looks good, but I'd rather prefer
to use print(..., file=sys.stderr) instead of 
sys.stderr.write().

This might need more changes though: I'm not sure if the
pep8 test accepts this (tests/testmanual_pep8.py). 

Importing print_function from __future__ should make it
work in both Python 2 and 3.

Downgrading to wishlist, as that is more like a feature
request to translate the scripts from Python 2 to Python 3
and not really a bug.

> 
> --
> 

> >From 331782006251adb25118cd1343c74a1765280b4f Mon Sep 17 00:00:00 2001

There is an extra > in front of the first attachement line, causing
git am to fail applying it.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to (`inline'). Thank you.


Reply to: