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

Bug 398479

Summary: dev-python/simplegeneric-0.8 with system python 3.2 - NameError: global name 'file' is not defined
Product: Gentoo Linux Reporter: arnk <ludo.arnk>
Component: [OLD] DevelopmentAssignee: Python Gentoo Team <python>
Status: RESOLVED DUPLICATE    
Severity: normal CC: Bernd.Feige, ludo.arnk
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description arnk 2012-01-11 04:46:22 UTC
* Package:    dev-python/simplegeneric-0.8
 * Repository: gentoo
 * Maintainer: python@gentoo.org
 * USE:        elibc_glibc kernel_linux userland_GNU x86
 * FEATURES:   ccache sandbox
>>> Unpacking source...
>>> Unpacking simplegeneric-0.8.zip to /var/tmp/portage/dev-python/simplegeneric-0.8/work
>>> Source unpacked in /var/tmp/portage/dev-python/simplegeneric-0.8/work
>>> Preparing source in /var/tmp/portage/dev-python/simplegeneric-0.8/work/simplegeneric-0.8 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/simplegeneric-0.8/work/simplegeneric-0.8 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/simplegeneric-0.8/work/simplegeneric-0.8 ...
 * Building of dev-python/simplegeneric-0.8 with CPython 2.6...
python2.6 setup.py build -b build-2.6
running build
running build_py
creating build-2.6
creating build-2.6/lib
copying simplegeneric.py -> build-2.6/lib
warning: build_py: byte-compiling is disabled, skipping.
 * Building of dev-python/simplegeneric-0.8 with CPython 2.7...
python2.7 setup.py build -b build-2.7
running build
running build_py
creating build-2.7
creating build-2.7/lib
copying simplegeneric.py -> build-2.7/lib
warning: build_py: byte-compiling is disabled, skipping.

 * Building of dev-python/simplegeneric-0.8 with CPython 3.2...
python3.2 setup.py build -b build-3.2
Traceback (most recent call last):
  File "setup.py", line 31, in <module>
    long_description = get_description(),
  File "setup.py", line 14, in get_description
    f = file('README.txt')
NameError: global name 'file' is not defined
 * ERROR: dev-python/simplegeneric-0.8 failed (compile phase):
 *   Building failed with CPython 3.2 in distutils_building() function
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 3613:  Called distutils_src_compile
 *   environment, line  967:  Called python_execute_function 'distutils_building'
 *   environment, line 2001:  Called die
 * The specific snippet of code:
 *                       die "${failure_message}";
 * 
 * If you need support, post the output of 'emerge --info =dev-python/simplegeneric-0.8',
 * the complete build log and the output of 'emerge -pqv =dev-python/simplegeneric-0.8'.
 * The complete build log is located at '/var/log/portage/elog/dev-python:simplegeneric-0.8:20120111-035001.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/simplegeneric-0.8/temp/environment'.
 * S: '/var/tmp/portage/dev-python/simplegeneric-0.8/work/simplegeneric-0.8'


Reproducible: Always
Comment 1 arnk 2012-01-11 04:47:38 UTC
python 3.2 deesn't have the file function.
replace it with open maybe fix it.
Comment 2 Bernd Feige 2012-01-11 15:36:49 UTC
(In reply to comment #1)
> python 3.2 deesn't have the file function.
> replace it with open maybe fix it.

Same problem here, and replacing "file" by "open" in setup.py really fixes it.
Note that ipython0.12-r1 pulls simplegeneric, so right now it cannot be installed if python3 is present.
Comment 3 Sébastien Fabbro (RETIRED) gentoo-dev 2012-01-11 17:58:28 UTC

*** This bug has been marked as a duplicate of bug 398457 ***