FS#31171 - [python-sip] Uses “file” instead of “open”, which isn’t available on python3

Attached to Project: Arch Linux
Opened by Phil Schaf (flying-sheep) - Friday, 17 August 2012, 14:44 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 30 September 2012, 10:04 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Andrea Scarpino (BaSh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

As soon as you try to use this package on python3 with distutils, it will crash with a stacktrace ending like this:

File "/usr/lib/python3.2/site-packages/sipdistutils.py", line 111, in build_extension
build_ext_base.build_extension(self, ext)
File "/usr/lib/python3.2/distutils/command/build_ext.py", line 480, in build_extension
sources = self.swig_sources(sources, ext)
File "/usr/lib/python3.2/site-packages/sipdistutils.py", line 153, in swig_sources
out = self._get_sip_output_list(sbf)
File "/usr/lib/python3.2/site-packages/sipdistutils.py", line 58, in _get_sip_output_list
for L in file(sbf):
NameError: global name 'file' is not defined

this is due to “file” being exclusively available as “open” in python3, while both names are available in python3.

this bug can be fixed by replacing each call to “file” with an “open” call. to do this during the 2to3 call, one can use this method: http://www.devx.com/opensource/Article/42380/1763/page/5

else we could just patch the offending line.

PS: is there seriously no python 3 package using SIP?
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Sunday, 30 September 2012, 10:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-sip 4.14-1
Comment by Andrea Scarpino (BaSh) - Friday, 17 August 2012, 15:50 GMT
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Category (Packages: Extra → Upstream Bugs)
  • Field changed: Severity (High → Medium)
  • Task assigned to Andrea Scarpino (BaSh)
Please report this upstream and report the link here.
Comment by Phil Schaf (flying-sheep) - Friday, 17 August 2012, 18:26 GMT
riverbank computing doesn’t seem to have a public bugtracker…

also, sip, python2-sip, and python-sip are one package, built from the same sources. are you sure that http://www.riverbankcomputing.com/static/Downloads/sip4/sip-4.13.3.tar.gz is intended for use with python3?
Comment by Andrea Scarpino (BaSh) - Wednesday, 05 September 2012, 14:25 GMT
Did they reply?

If sip python bindings aren't meant to be used with python3 I should remove the package.

Loading...