Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 524024

Summary: sys-apps/pcsc-lite-1.8.12 with >dev-lang/python-3 - pcsc-spy: SyntaxError: Missing parentheses in call to 'print'
Product: Gentoo Linux Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: [OLD] Core systemAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: pcsc-spy-python3.patch

Description Arfrever Frehtes Taifersar Arahesis 2014-09-29 13:15:33 UTC
$ /usr/bin/pcsc-spy --help
  File "/usr/bin/pcsc-spy", line 167
    print self.indent + PCSCspy.color_red + data + PCSCspy.color_normal + time
             ^
SyntaxError: Missing parentheses in call to 'print'
Comment 1 Alon Bar-Lev (RETIRED) gentoo-dev 2014-09-30 05:49:57 UTC
Created attachment 385790 [details, diff]
pcsc-spy-python3.patch

Can you please checkout if this patch works for you?
Comment 2 Arfrever Frehtes Taifersar Arahesis 2014-09-30 08:56:08 UTC
Many (but not all) changes for print() result in changed output with Python 2.

Python 2:

>>> print "ab", "cd"
ab cd
>>> print("ab", "cd")
('ab', 'cd')

Python 3:

>>> print("ab", "cd")
ab cd


All instances of print("some string", something) should be changed to e.g. print("some string %s" % something), which results in identical output with Python 2 and 3.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2014-09-30 08:58:55 UTC
Also behavior of Python 3 can be achieved in Python 2 by adding the following line at the beginning of script:

from __future__ import print_function

(This works only with Python >=2.6. It is ignored in Python 3.)
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2014-09-30 09:04:48 UTC
Can you please provide workable patch, work with upstream to resolve and submit it here as well?

Thanks!
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2014-09-30 11:34:10 UTC
ok, for now I forced python2.