Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1561 closed defect (fixed)

The py-compile script crashes during installation

Reported by: vorner Owned by: vorner
Priority: medium Milestone: Sprint-20120207
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 2.75 Internal?: no

Description

Hello

I don't know when it happened (due to other problem with installation I had), but whenever I try to install bind10, it fails with this error:

make[7]: Nothing to be done for `install-exec-am'.
test -z "/home/vorner/testing/bind10/lib64/python3.1/site-packages/isc/util" || /bin/mkdir -p "/home/vorner/testing/bind10/lib64/python3.1/site-packages/isc/util"
 /usr/bin/install -c -m 644 __init__.py process.py socketserver_mixin.py file.py '/home/vorner/testing/bind10/lib64/python3.1/site-packages/isc/util'
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: 'module' object has no attribute 'OpenWrapper'
../../../../../py-compile: line 119: 15118 Aborted                 (core dumped) $PYTHON -c "
import sys, os, py_compile

files = '''$files'''

sys.stdout.write('Byte-compiling python modules...\n')
for file in files.split():
    $pathtrans
    $filetrans
    if not os.path.exists(filepath) or not (len(filepath) >= 3
                                            and filepath[-3:] == '.py'):
            continue
    sys.stdout.write(file)
    sys.stdout.flush()
    py_compile.compile(filepath, filepath + 'c', path)
sys.stdout.write('\n')"
make[7]: *** [install-pythonPYTHON] Error 134
make[7]: Leaving directory `/home/vorner/work/bind10/src/lib/python/isc/util'

I use python 3.2, but downgrading to 3.1 didn't help. This is a gentoo system and I tried it on another gentoo system and it fails there as well. When looking at the substituted $files and others, they look fine. The error itself sounds like the python is not able to open its stdin/out/err for some reason (or, better, create the wrappers around them).

Subtickets

Change History (9)

comment:1 Changed 8 years ago by vorner

  • Milestone changed from New Tasks to Sprint-20120124

comment:2 Changed 8 years ago by vorner

  • Owner changed from UnAssigned to vorner
  • Status changed from new to accepted

comment:3 Changed 8 years ago by vorner

First experiments show it is because the folder contains a folder called io. Then it tries to search for some modules to handle stdio, but they are called io.something and they are not found there. I'm going to look if I have a strange $PYTHON_PATH or if it is default thing on gentoo.

comment:4 Changed 8 years ago by vorner

  • Milestone changed from Sprint-20120207 to Sprint-20120124
  • Owner changed from vorner to UnAssigned
  • Status changed from accepted to reviewing

Hello

As noted above, the problem was because py-compile was run under python3, and there was a directory io containing the __init__.py file. So it picked up this one instead of system level io module, and it didn't contain the basic modules for stdio.

So, the solution is to rename the module. I changed it to cio, as it is a wrapper around C++ IO stuff. But I'm not sure it is the best name.

I'd propose this changelog:

[bug]		vorner
Installation no longer fails because of an io directory colliding with
python standard module io.

Thank you

comment:5 Changed 8 years ago by vorner

  • Milestone changed from Sprint-20120124 to Sprint-20120207

comment:6 Changed 8 years ago by stephen

  • Owner changed from UnAssigned to stephen

comment:7 Changed 8 years ago by stephen

  • Owner changed from stephen to vorner

Appears to be OK - units tests pass and it installs without problems. Would perhaps phrase the ChangeLog message something like:

[bug]		vorner
Fixed problem whereby a directory named "io" conflicted with the Python
standard module "io" and caused the installation to fail.  The offending
directory has been renamed.

Please merge.

comment:8 Changed 8 years ago by vorner

  • Resolution set to fixed
  • Status changed from reviewing to closed

Thank you, merged.

comment:9 Changed 8 years ago by vorner

  • Total Hours changed from 0 to 2.75
Note: See TracTickets for help on using tickets.