#2 Fix installation in gentoo

closed-fixed
nobody
None
5
2010-03-14
2010-03-14
Alex Dedul
No

In gentoo when installing using emerge/portage from ebuild it writes the following traceback:

python2.6 setup.py build
Traceback (most recent call last):
File "setup.py", line 10, in <module>
from googsystray import VERSION_STRING
File "/var/tmp/portage/x11-misc/googsystray-9999/work/googsystray-9999/googsystray/__init__.py", line 32, in <module>
temp_dir = "/tmp/googsystray-" + os.getenv("USER") + "/"
TypeError: cannot concatenate 'str' and 'NoneType' objects

I assume it somehow related to gentoo's sandboxing feature. Attaching trivial patch to fix this, so it installs okay.

Discussion

  • Alex Dedul
    Alex Dedul
    2010-03-14

     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    Uh, a bit better patch would be this, please ignore that one in attach.

    Index: googsystray/__init__.py

    --- googsystray/__init__.py (revision 244)
    +++ googsystray/__init__.py (working copy)
    @@ -29,7 +29,7 @@

    if (os.name == "posix"):
    - temp_dir = "/tmp/googsystray-" + os.getenv("USER") + "/"
    + temp_dir = "/tmp/googsystray-" + os.getenv("USER", "") + "/"
    if not os.path.exists(temp_dir):
    os.makedirs(temp_dir)

     
  • Jim Duchek
    Jim Duchek
    2010-03-14

    I applied something similar -- Didn't want to make the temp dir in that case. I'm pretty sure on install all it uses out of __init__ is the VERSION_STRING so it shouldn't cause any problems.

     
  • Jim Duchek
    Jim Duchek
    2010-03-14

    • assigned_to: nobody --> jimduchek
    • status: open --> closed-accepted
     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    Formatting is screwed and i seems like don't see a way to reupload a patch here.. But i think its clear what i mean and what fixes installation at least here..

     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    • assigned_to: jimduchek --> nobody
    • status: closed-accepted --> open
     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    > I'm pretty sure on install all it uses out of __init__ is the VERSION_STRING so it shouldn't cause any problems.

    Yeah, but seems like it parses the whole __init__ module anyway, at least here it shows that error on installing i posted in the original message..

     
  • Jim Duchek
    Jim Duchek
    2010-03-14

    It does, but it won't use the config_dir variable it sets... I just don't want to end up making a /tmp/googsystray- directory that's not going to get used. I've checked it in -- is the Gentoo ebuild stuff using svn or the 1.1 version?

     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    > It does, but it won't use the config_dir variable it sets... I just don't want to end up making a /tmp/googsystray- directory that's not going to get used.

    Ah, seems like i see now. You said you already applied a patch to prevent making of temp dir in this case. Were there causes you removed that patch so now it is again making temp dir in this case when no USER env var is set ?

    > I've checked it in -- is the Gentoo ebuild stuff using svn or the 1.1 version?

    For now i made an ebuild to use svn here.

     
  • Jim Duchek
    Jim Duchek
    2010-03-14

    Ah, no, I added it just now in response to your initial patch :)

     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    I see, just tried installing from svn and now it works okay, thanks :).

     
  • Alex Dedul
    Alex Dedul
    2010-03-14

    • status: open --> closed-fixed