Giter Club home page Giter Club logo

Comments (12)

GaelVaroquaux avatar GaelVaroquaux commented on August 22, 2024

On Thu, Dec 08, 2011 at 06:57:17AM -0800, Michele Mattioni wrote:

    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found

I think that the bug is actually in Pyface, not in Mayavi. Specificaly,
the widget displaying a list of images to choose from is not ported
properly.

Does it actually prevents the code from working? I had the impression
that it was giving an error, but managed to move on, with the colormap
widget broken.

G

from mayavi.

mattions avatar mattions commented on August 22, 2024

No,
I get a Segmentation Fault.
Also if I try to add the Axes module or anything like that, everything
crash badly.

On Thu, Dec 8, 2011 at 3:04 PM, Gael Varoquaux
[email protected]
wrote:

On Thu, Dec 08, 2011 at 06:57:17AM -0800, Michele Mattioni wrote:

        name = ''.join((factory.prefix, name, factory.suffix))
    TypeError: sequence item 1: expected string or Unicode, NoneType found

I think that the bug is actually in Pyface, not in Mayavi. Specificaly,
the widget displaying a list of images to choose from is not ported
properly.

Does it actually prevents the code from working? I had the impression
that it was giving an error, but managed to move on, with the colormap
widget broken.

G


Reply to this email directly or view it on GitHub:
#20 (comment)

from mayavi.

GaelVaroquaux avatar GaelVaroquaux commented on August 22, 2024

On Thu, Dec 08, 2011 at 07:15:37AM -0800, Michele Mattioni wrote:

I get a Segmentation Fault.

That's probably unrelated. Could you run the program throught gdb, as
explained on:
http://scipy-lectures.github.com/advanced/debugging/index.html#debugging-segmentation-faults-using-gdb
and paste here the output of 'bt' in the gdb prompt after the segfault.

G

from mayavi.

mattions avatar mattions commented on August 22, 2024
mattions@triton:examples(master*)$ gdb python
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.7...done.
done.
(gdb) run qt_embedding.py 
Starting program: /usr/bin/python qt_embedding.py
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffd80df700 (LWP 9664)]
[New Thread 0x7fffd78de700 (LWP 9665)]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 286, in sizeHint
    pixmap = self._get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 292, in _get_pixmap
    return self._editor.get_pixmap(name)
  File "/usr/local/lib/python2.7/dist-packages/traitsui/qt4/image_enum_editor.py", line 51, in get_pixmap
    name = ''.join((factory.prefix, name, factory.suffix))
TypeError: sequence item 1: expected string or Unicode, NoneType found

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff0ea4cc0 in ?? ()
   from /usr/lib/python2.7/dist-packages/sip.so

from mayavi.

mattions avatar mattions commented on August 22, 2024

and this is the bt:

(gdb) bt
#0  0x00007ffff0ea4cc0 in ?? ()
   from /usr/lib/python2.7/dist-packages/sip.so
#1  0x00007ffff09b99fe in ?? ()
   from /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
#2  0x00007ffff052bc88 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007fffee1ac3ef in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#4  0x00007fffee1b1291 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#5  0x00007fffef133b71 in ?? ()
   from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#6  0x00007ffff052bafc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007ffff052f51f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007ffff0556a73 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007fffef7e3a5d in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007fffef7e4258 in ?? ()
---Type <return> to continue, or q <return> to quit--- 
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007fffef7e4429 in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff0556ed6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#13 0x00007fffee25407e in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007ffff052acf2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007ffff052aef7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#16 0x00007ffff052f789 in QCoreApplication::exec() ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#17 0x00007fffef109d9e in ?? ()
   from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#18 0x00000000004b6569 in call_function (oparg=<optimized out>, 
    pp_stack=0x7fffffffd910) at ../Python/ceval.c:4021
#19 PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>)
    at ../Python/ceval.c:2666
#20 0x00000000004bcd2d in PyEval_EvalCodeEx (co=0x9a7430, 
    globals=<optimized out>, locals=<optimized out>, 
    args=<optimized out>, argcount=<optimized out>, 
---Type <return> to continue, or q <return> to quit---
    kws=<optimized out>, kwcount=0, defs=0x0, defcount=0, closure=
    0x0) at ../Python/ceval.c:3253
#21 0x00000000004bd802 in PyEval_EvalCode (co=<optimized out>, 
    globals=<optimized out>, locals=<optimized out>)
    at ../Python/ceval.c:667
#22 0x00000000004dcc22 in run_mod (mod=<optimized out>, 
    filename=<optimized out>, globals=
    {'Visualization': <MetaHasTraits(__module__='__main__', __subclass_traits__=[], __view_traits__=<ViewElements(content=<TraitDictObject(trait=<Dict(default_value={}, key_trait=<CTrait(type='trait') at remote 0xf6fe10>, value_trait=<CTrait(instance_handler='_instance_changed_handler', type='trait') at remote 0xf6ff70>, has_items=True, _metadata={'type': 'trait'}, value_handler=<TraitInstance(_allow_none=True, aClass=<MetaHasTraits(replace_include=<function at remote 0xf57c80>, __subclass_traits__=[<MetaHasTraits(__module__='traitsui.view_element', __subclass_traits__=[], __view_traits__=None, __class_traits__={'show_labels': <CTrait(type='trait') at remote 0xf6f680>, 'style': <CTrait(type='trait', cols=4) at remote 0xf599f0>, 'trait_added': <CTrait(transient=True, type='event') at remote 0xf6fc00>, 'image': <CTrait(type='trait') at remote 0xf6f730>, 'object': <CTrait(type='trait') at remote 0xf6f7e0>, 'label_theme': <CTrait(type='trait') at remote 0xf6fb50>, 'dock': <CTrait(type='trait', desc='the default docki...(truncated), 
    locals=
---Type <return> to continue, or q <return> to quit---
    {'Visualization': <MetaHasTraits(__module__='__main__', __subclass_traits__=[], __view_traits__=<ViewElements(content=<TraitDictObject(trait=<Dict(default_value={}, key_trait=<CTrait(type='trait') at remote 0xf6fe10>, value_trait=<CTrait(instance_handler='_instance_changed_handler', type='trait') at remote 0xf6ff70>, has_items=True, _metadata={'type': 'trait'}, value_handler=<TraitInstance(_allow_none=True, aClass=<MetaHasTraits(replace_include=<function at remote 0xf57c80>, __subclass_traits__=[<MetaHasTraits(__module__='traitsui.view_element', __subclass_traits__=[], __view_traits__=None, __class_traits__={'show_labels': <CTrait(type='trait') at remote 0xf6f680>, 'style': <CTrait(type='trait', cols=4) at remote 0xf599f0>, 'trait_added': <CTrait(transient=True, type='event') at remote 0xf6fc00>, 'image': <CTrait(type='trait') at remote 0xf6f730>, 'object': <CTrait(type='trait') at remote 0xf6f7e0>, 'label_theme': <CTrait(type='trait') at remote 0xf6fb50>, 'dock': <CTrait(type='trait', desc='the default docki...(truncated), 
    flags=<optimized out>, arena=<optimized out>)
    at ../Python/pythonrun.c:1346
#23 0x00000000004dd7e4 in PyRun_FileExFlags (fp=0xa01190, filename=
    0x7fffffffe096 "qt_embedding.py", start=<optimized out>, globals=
    {'Visualization': <MetaHasTraits(__module__='__main__', __subclass_traits__=[], __view_traits__=<ViewElements(content=<TraitDictObject(trait=<Dict(default_value={}, key_trait=<CTrait(type='trait') at remote 0xf6fe10>, value_trait=<CTrait(instance_handler='_instance_changed_ha---Type <return> to continue, or q <return> to quit---
ndler', type='trait') at remote 0xf6ff70>, has_items=True, _metadata={'type': 'trait'}, value_handler=<TraitInstance(_allow_none=True, aClass=<MetaHasTraits(replace_include=<function at remote 0xf57c80>, __subclass_traits__=[<MetaHasTraits(__module__='traitsui.view_element', __subclass_traits__=[], __view_traits__=None, __class_traits__={'show_labels': <CTrait(type='trait') at remote 0xf6f680>, 'style': <CTrait(type='trait', cols=4) at remote 0xf599f0>, 'trait_added': <CTrait(transient=True, type='event') at remote 0xf6fc00>, 'image': <CTrait(type='trait') at remote 0xf6f730>, 'object': <CTrait(type='trait') at remote 0xf6f7e0>, 'label_theme': <CTrait(type='trait') at remote 0xf6fb50>, 'dock': <CTrait(type='trait', desc='the default docki...(truncated), 
    locals=
    {'Visualization': <MetaHasTraits(__module__='__main__', __subclass_traits__=[], __view_traits__=<ViewElements(content=<TraitDictObject(trait=<Dict(default_value={}, key_trait=<CTrait(type='trait') at remote 0xf6fe10>, value_trait=<CTrait(instance_handler='_instance_changed_handler', type='trait') at remote 0xf6ff70>, has_items=True, _metadata={'type': 'trait'}, value_handler=<TraitInstance(_allow_none=True, aClass=<MetaHasTraits(replace_include=<function at remote 0xf57c80>, __subclass_traits__=[<MetaHasTraits(__module__='traitsui.view_element', __subclass_traits__=[], __view_traits__=None, __class_traits__={'show_labels': <CTrait(type='trait') at remote 0xf6f680>, 'style': <CTrait(type='trait', cols=4) at remote 0xf599f0>, 'trait_added': <CTrait(transient---Type <return> to continue, or q <return> to quit---
=True, type='event') at remote 0xf6fc00>, 'image': <CTrait(type='trait') at remote 0xf6f730>, 'object': <CTrait(type='trait') at remote 0xf6f7e0>, 'label_theme': <CTrait(type='trait') at remote 0xf6fb50>, 'dock': <CTrait(type='trait', desc='the default docki...(truncated), 
    closeit=1, flags=0x7fffffffdc50) at ../Python/pythonrun.c:1332
#24 0x00000000004de2ee in PyRun_SimpleFileExFlags (fp=0xa01190, 
    filename=<optimized out>, closeit=1, flags=0x7fffffffdc50)
    at ../Python/pythonrun.c:936
#25 0x00000000004ee6dd in Py_Main (argc=<optimized out>, 
    argv=<optimized out>) at ../Modules/main.c:599
#26 0x00007ffff699e30d in __libc_start_main ()
   from /lib/x86_64-linux-gnu/libc.so.6

#27 0x000000000041cb69 in _start ()

from mayavi.

GaelVaroquaux avatar GaelVaroquaux commented on August 22, 2024

On Thu, Dec 08, 2011 at 07:22:52AM -0800, Michele Mattioni wrote:

and this is the bt:

So it's in PyQt

Can you run a simple Traits dialog in Qt without Mayavi?

G

from mayavi.

mattions avatar mattions commented on August 22, 2024

I'm able to run this one:
http://github.enthought.com/traits/traits_user_manual/
all_traits_features,py

without getting any segmentation fault or problem. (the color is dark, but this doesn't belong here.)

from mayavi.

mattions avatar mattions commented on August 22, 2024

When I launch Mayavi with the Debug option for the logger I have this two messages:

In [2]: DEBUG mayavi.core.registry 58   Engine [<mayavi.core.engine.Engine object at 0x91930b0>] named Engine1 registered


In [3]:         DEBUG mayavi.core.base 384   No view found for [<mayavi.core.scene.Scene object at 0x9193110>] in [/usr/local/lib/python2.7/dist-packages/mayavi/core/ui/scene.py]. Using the base class trait_view instead.

The first is when I open the scene, and the second is when I open the option pipeline, clicking on the Mayavi logo

from mayavi.

mattions avatar mattions commented on August 22, 2024

This has been proposed by Gael:

"write a small example using the image_enum_editor, and insert
print statements in image_enum_editor.py to find out why None is passed.
I suspect that the fix will lie in this code."

I didn't find image_enum_editor.py anywhere!

Where is image_enum_editor.py ?
I've tried to locate it but no joy!

from mayavi.

GaelVaroquaux avatar GaelVaroquaux commented on August 22, 2024

I cannot reproduce this issue under the development version of ETS.

from mayavi.

mattions avatar mattions commented on August 22, 2024

Hi Gael,
I have VTK 5.6.0.

I've digged into this a bit more and I found out that the problem is on the LUT selection for the colors.

In particular I have up to the color-scheme winter, and after that empty slot, which are causing the bug.
Have a look at this screenshot.
http://www.ebi.ac.uk/~mattioni/images/Screenshot%20at%202012-02-07%2013:26:01.png

I'm running the latest mayavi and the latest traitsui. With Latest I mean from git repo!

from mayavi.

mattions avatar mattions commented on August 22, 2024

Hi Gael,

I've managed to get everything sorted properly with git.
Under the latest git (updated 5 mins ago), I can't reproduce this bug either, so I'll close it.

With the latest checkout however, the color scheme on Ubuntu is broken, as already reported here: enthought/traitsui#33

from mayavi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.