[GRASS-dev] using libpath + ":" + in grass70 unsupported operand type

Hi,

~/grass_dev$ grass70
Traceback (most recent call last):
File “/usr/local/bin/grass70”, line 1267, in
load_env()
File “/usr/local/bin/grass70”, line 753, in load_env
os.environ[‘LD_LIBRARY_PATH’] = libpath + “:” + isislibpath + “:” + isis3rdparty
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’

: is certainly not considered a string, but I cannot force it to be string either… Any idea?

Thanks

On Mon, Nov 25, 2013 at 10:55 AM, Yann Chemin <ychemin@gmail.com> wrote:

Hi,

~/grass_dev$ grass70
Traceback (most recent call last):
  File "/usr/local/bin/grass70", line 1267, in <module>
    load_env()
  File "/usr/local/bin/grass70", line 753, in load_env
    os.environ['LD_LIBRARY_PATH'] = libpath + ":" + isislibpath + ":" +
isis3rdparty
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

: is certainly not considered a string, but I cannot force it to be string
either... Any idea?

Hi Yann,

I'm not sure if I understand your situation, anyway:

My line 753 in lib/init/grass.py says:

  ... libpath + os.pathsep + isislibpath + os.pathsep + isis3rdparty

os.pathsep is for sure type str as well as ":" literal is type str.

I would say that one of libpath, isislibpath and isis3rdparty is None
although lines above seems that they sets everything.

Can you debug your code? Simple print before line 753 should be enough:

  print libpath, isislibpath, isis3rdparty

As far as I know, the print will not break the start up, so it should work.

Vaclav

Thanks

--
----

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Vaclav,

on my 64 bit machine, none of this happens.
Will check back home tonight…

Cheers,
Yann

···

On 25 November 2013 21:39, Vaclav Petras <wenzeslaus@gmail.com> wrote:

On Mon, Nov 25, 2013 at 10:55 AM, Yann Chemin <ychemin@gmail.com> wrote:

Hi,

~/grass_dev$ grass70
Traceback (most recent call last):
File “/usr/local/bin/grass70”, line 1267, in
load_env()
File “/usr/local/bin/grass70”, line 753, in load_env
os.environ[‘LD_LIBRARY_PATH’] = libpath + “:” + isislibpath + “:” + isis3rdparty
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’

: is certainly not considered a string, but I cannot force it to be string either… Any idea?

Hi Yann,

I’m not sure if I understand your situation, anyway:

My line 753 in lib/init/grass.py says:

… libpath + os.pathsep + isislibpath + os.pathsep + isis3rdparty

os.pathsep is for sure type str as well as “:” literal is type str.

I would say that one of libpath, isislibpath and isis3rdparty is None although lines above seems that they sets everything.

Can you debug your code? Simple print before line 753 should be enough:

print libpath, isislibpath, isis3rdparty

As far as I know, the print will not break the start up, so it should work.

Vaclav

Thanks


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Yann Chemin wrote:

~/grass_dev$ grass70
Traceback (most recent call last):
  File "/usr/local/bin/grass70", line 1267, in <module>
    load_env()
  File "/usr/local/bin/grass70", line 753, in load_env
    os.environ['LD_LIBRARY_PATH'] = libpath + ":" + isislibpath + ":" + isis3rdparty
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

: is certainly not considered a string, but I cannot force it to be string
either... Any idea?

The problem is that one of the variables (libpath, isislibpath,
isis3rdparty) is None, and "None + str" isn't defined:

  > None + "hello"
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

--
Glynn Clements <glynn@gclements.plus.com>