Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38127 - Can't compile portage and others due to python (TypeError: unsuported operand types for + 'NoneType' and 'str')
Summary: Can't compile portage and others due to python (TypeError: unsuported operand...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-01-13 18:41 UTC by André Brioso
Modified: 2004-02-08 17:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge -v portage log (emerge-portage.txt,2.38 KB, text/plain)
2004-01-13 18:42 UTC, André Brioso
Details
example reproduction of error (at,2.47 KB, text/plain)
2004-01-13 21:30 UTC, Jason A. Mobarak (RETIRED)
Details
python emerge log as requested (emerge python 2>&1 | tee /tmp/python.log) (python.log,516.14 KB, application/octet-stream)
2004-01-14 20:53 UTC, André Brioso
Details
python emerge log after re-emerging coreutils (python.log,516.21 KB, application/octet-stream)
2004-01-15 04:36 UTC, André Brioso
Details
Log of removing basename then trying to compile Python (log,25.60 KB, text/plain)
2004-01-15 06:35 UTC, Jason A. Mobarak (RETIRED)
Details
Replaces basename with shell globbing in dosed. (dosed.patch,342 bytes, patch)
2004-01-15 06:40 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Replace basename with shell globbing in dosed. (dosed.patch,363 bytes, patch)
2004-01-15 07:02 UTC, Jason A. Mobarak (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description André Brioso 2004-01-13 18:41:06 UTC
When I try to emerge (or update) portage or others packages, the compilation is interrupted with the following message:

TypeError: unsupported operand types for +: 'NoneType' and 'str'
 
!!! ERROR: sys-apps/portage-2.0.49-r21 failed.
!!! Function src_install, Line 95, Exitcode 1
!!! Failed to install missingos module
 


Reproducible: Always
Steps to Reproduce:
1. emerge -v portage
2.
3.

Actual Results:  
The package (in this example portage) doesn't compile, and prints the following
error:

  File "/usr/lib/python2.2/distutils/sysconfig.py", line 138, in customize_compiler
    cc_cmd = cc + ' ' + opt
TypeError: unsupported operand types for +: 'NoneType' and 'str'
 
!!! ERROR: sys-apps/portage-2.0.49-r21 failed.
!!! Function src_install, Line 95, Exitcode 1
!!! Failed to install missingos module
 


Expected Results:  
The package should be compiled.

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.22-gentoo-r4)
=================================================================
System uname: 2.4.22-gentoo-r4 i686 Pentium Pro
Gentoo Base System version 1.4.3.10
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentiumpro -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentiumpro -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 oss apm arts avi crypt cups encode foomaticdb gif gtk2 jpeg libg++ mad
mikmod motif mpeg ncurses nls pdflib png quicktime sdl spell svga truetype xml2
xmms xv zlib gdbm berkdb slang readline tcltk java mysql gpm tcpd pam libwww ssl
perl python esd imlib oggvorbis opengl mozilla cdr X gtk gnome alsa -kde -qt
apache2"
Comment 1 André Brioso 2004-01-13 18:42:42 UTC
Created attachment 23774 [details]
emerge -v portage log

This is the output of the emerge -v portage command
Comment 2 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-13 21:23:35 UTC
distutils can't find your c compiler, try setting the CC environment var and make sure there's nothing wrong with /usr/lib/python2.2/config/Makefile .
Comment 3 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-13 21:30:55 UTC
Created attachment 23779 [details]
example reproduction of error

I think the file /usr/lib/python2.2/config/Makefile is either missing or
corrupt.
Comment 4 André Brioso 2004-01-13 22:45:31 UTC
root@aquanta config # echo $CC
gcc
root@aquanta config # gcc -dumpversion
3.2.3
root@aquanta config # file /usr/lib/python2.2/config/Makefile
/usr/lib/python2.2/config/Makefile: empty
root@aquanta config #

CC variable is well defined, but as it seems the Makefile is empty
Comment 5 Alastair Tse (RETIRED) gentoo-dev 2004-01-14 04:14:18 UTC
which version/revision of python are you using? the Makefile seems to exist on all my python2.2 installations, this is the first time i've heard of it being missing.
Comment 6 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-14 10:38:44 UTC
I suggest re-emerging python to fix this problem.
Comment 7 André Brioso 2004-01-14 10:47:33 UTC
I've already tried to re-emerge python, but the problem persists.

I've also removed /usr/lib/python2.2/config/Makefile, but after re-emerging python, the Makefile continues to be an empty file.

Comment 8 André Brioso 2004-01-14 10:50:26 UTC
I'm using Python 2.2.3:

root@aquanta config # python -V
Python 2.2.3

Comment 9 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-14 10:58:55 UTC
Grab a tarball of python 2.2.3 from python.org, configure it with

./configure --prefix=/tmp

then do the usual "make && make install", then see if you can grab the Makefile from the copy of python installed in /tmp .
Comment 10 Alastair Tse (RETIRED) gentoo-dev 2004-01-14 13:00:24 UTC
i'm talking about the portage revision, are you using 2.2.3-r5 ? do:

emerge python 2>&1 | tee /tmp/python.log 

and then attach that log file here.
Comment 11 André Brioso 2004-01-14 13:16:14 UTC
solved by copying /tmp/lib/python2.2/config/Makefile to /usr/lib/python2.2/config/Makefile

Thank you for all your help.
Comment 12 André Brioso 2004-01-14 13:18:55 UTC
I'm using python-2.2.3:

root@aquanta tmp # emerge -pv python
 
These are the packages that I would merge, in order:
 
Calculating dependencies ...done!
[ebuild   R   ] dev-lang/python-2.2.3-r5  +ncurses +gdbm +readline +tcltk +berkdb -build -doc +ssl
 
Comment 13 Alastair Tse (RETIRED) gentoo-dev 2004-01-14 14:29:35 UTC
i'm not really sure it is fixed or if it is a local problem, without more information, i can't tell at all. but i believe this is a one off thing, i can't reproduce this behaviour on my side.
Comment 14 André Brioso 2004-01-14 20:53:45 UTC
Created attachment 23840 [details]
python emerge log as requested (emerge python 2>&1 | tee /tmp/python.log)


As requested, I've created a log for re-emerging portage (emerge python 2>&1 |
tee /tmp/python.log).

And due to that, the original problem had returned.

Probably the Makefile isn't being correctly created.
Comment 15 Alastair Tse (RETIRED) gentoo-dev 2004-01-15 02:24:46 UTC
ok, portage guys, i think i've found a problem with /usr/lib/portage/bin/dosed that's causing this error:

notice that in the log :

...
	/var/tmp/portage/python-2.2.3-r5/image//usr/share/man/man1/python.1
/usr/lib/portage/bin/dosed: line 1: /usr/bin/basename: No such file or directory
...

in /usr/lib/portage/dosed it looks for /usr/bin/basename, if that doesn't exist, it'll wipe out the file it is sed'ing, can we have a check there before it does the sed to make sure /usr/bin/basename does exist?

as for the bug reporter, there is a problem with your installation, coreutils is missing /usr/bin/basename which seems to be a symlink present on all my gentoo boxes. you need to re-merge coreutils to see what is going on.
Comment 16 André Brioso 2004-01-15 04:33:49 UTC
You were right, the /usr/bin/basename was missing, but after re-emerging both coreutils and python, the Makefile continues to be created as an empty file.
Comment 17 André Brioso 2004-01-15 04:36:07 UTC
Created attachment 23849 [details]
python emerge log after re-emerging coreutils
Comment 18 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-15 06:33:50 UTC
My dosed looks for basename in /bin, using portage 2.0.49-r21 and coreutils 5.0-r5. Also note that I nuked basename in /bin and Python failed to compile for me (python_build_dir/Modules/makesetup needs basename to create the Makefile), so I assume there's a basename somewhere on your computer (probably in /bin) just dosed is looking in the wrong place for it for some reason.
Comment 19 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-15 06:35:49 UTC
Created attachment 23853 [details]
Log of removing basename then trying to compile Python
Comment 20 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-15 06:40:08 UTC
Created attachment 23856 [details, diff]
Replaces basename with shell globbing in dosed.
Comment 21 Alastair Tse (RETIRED) gentoo-dev 2004-01-15 06:41:37 UTC
for reference: i'm using portage-2.0.50_pre12 or above, but on another machine, portage-2.0.49-r18 also has /usr/bin/basename in dosed.
Comment 22 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-15 07:02:49 UTC
Created attachment 23857 [details, diff]
Replace basename with shell globbing in dosed.

sorry, previous patch was bogus
Comment 23 Jason A. Mobarak (RETIRED) gentoo-dev 2004-01-15 07:08:09 UTC
I lied, my dosed looks for basename in /usr/bin too, just my /usr/bin has a symlink to /bin/basename, like liquidx said.
Comment 24 Marius Mauch (RETIRED) gentoo-dev 2004-02-08 17:55:07 UTC
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.