Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Python exception in m64py with usb controller #66

Closed
Simbi0z opened this issue Jan 2, 2016 · 4 comments
Closed

Unhandled Python exception in m64py with usb controller #66

Simbi0z opened this issue Jan 2, 2016 · 4 comments

Comments

@Simbi0z
Copy link

Simbi0z commented Jan 2, 2016

python --version
Python 3.5.1
m64py from git.
To reproduce the problem you simply have to select the controller device in the input plugin window and close it.

python setup.py build_qt && ./m64py
with no starting mupen64plus.cfg

Unhandled Python exception

Aborted

Now running with ipython m64py

Traceback (most recent call last):
File "/home/oiu7/mupen64plus-ui-python/src/m64py/frontend/input.py", line 62, in closeEvent
self.save_config()
File "/home/oiu7/mupen64plus-ui-python/src/m64py/frontend/input.py", line 136, in save_config
self.save_opts()
File "/home/oiu7/mupen64plus-ui-python/src/m64py/frontend/input.py", line 244, in save_opts
self.config.set_parameter("name", devicename.encode())
AttributeError: 'bytes' object has no attribute 'encode'

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

Traceback (most recent call last):
File "/usr/bin/ipython", line 5, in
start_ipython()
File "/usr/lib/python3.5/site-packages/IPython/init.py", line 118, in start_ipython
return launch_new_instance(argv=argv, *_kwargs)
File "/usr/lib/python3.5/site-packages/traitlets/config/application.py", line 591, in launch_instance
app.initialize(argv)
File "", line 2, in initialize
File "/usr/lib/python3.5/site-packages/traitlets/config/application.py", line 75, in catch_config_error
return method(app, *args, *_kwargs)
File "/usr/lib/python3.5/site-packages/IPython/terminal/ipapp.py", line 320, in initialize
self.init_code()
File "/usr/lib/python3.5/site-packages/IPython/core/shellapp.py", line 299, in init_code
sys.stderr.flush()

AttributeError: 'Log' object has no attribute 'flush'

running with gdb python and the run m64py:

Unhandled Python exception

Program received signal SIGABRT, Aborted.
0x00007ffff737f5f8 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff737f5f8 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff7380a7a in abort () from /usr/lib/libc.so.6
#2 0x00007ffff50261e1 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#3 0x00007fffec653081 in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtCore.so
#4 0x00007fffec94ea76 in ?? () from /usr/lib/python3.5/site-packages/sip.so
#5 0x00007ffff63c31b2 in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#6 0x00007ffff5b4f9c8 in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#7 0x00007ffff63c25fb in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#8 0x00007ffff5b0c9ac in QApplicationPrivate::notify_helper(QObject_, QEvent_) () from /usr/lib/libQt5Widgets.so.5
#9 0x00007ffff5b11e86 in QApplication::notify(QObject_, QEvent_) () from /usr/lib/libQt5Widgets.so.5
#10 0x00007ffff63dd09e in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#11 0x00007ffff5219bab in QCoreApplication::notifyInternal(QObject_, QEvent_) () from /usr/lib/libQt5Core.so.5
#12 0x00007ffff5b4acad in QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) () from /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff5b4e672 in ?? () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff524831a in QMetaObject::activate(QObject_, int, int, void_) () from /usr/lib/libQt5Core.so.5
#15 0x00007ffff5ea75f2 in QAbstractButton::clicked(bool) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff5c09a94 in ?? () from /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff5c0b0a9 in ?? () from /usr/lib/libQt5Widgets.so.5
#18 0x00007ffff5c0b224 in QAbstractButton::mouseReleaseEvent(QMouseEvent
) () from /usr/lib/libQt5Widgets.so.5
#19 0x00007ffff63abb2b in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#20 0x00007ffff5b4f9c8 in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#21 0x00007ffff63ac84b in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#22 0x00007ffff5b0c9ac in QApplicationPrivate::notify_helper(QObject_, QEvent_) () from /usr/lib/libQt5Widgets.so.5
#23 0x00007ffff5b12589 in QApplication::notify(QObject_, QEvent_) () from /usr/lib/libQt5Widgets.so.5
#24 0x00007ffff63dd09e in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#25 0x00007ffff5219bab in QCoreApplication::notifyInternal(QObject_, QEvent_) () from /usr/lib/libQt5Core.so.5
#26 0x00007ffff5b11492 in QApplicationPrivate::sendMouseEvent(QWidget_, QMouseEvent_, QWidget_, QWidget_, QWidget**, QPointer&, bool) () from /usr/lib/libQt5Widgets.so.5
#27 0x00007ffff5b69f3b in ?? () from /usr/lib/libQt5Widgets.so.5
#28 0x00007ffff5b6c4fb in ?? () from /usr/lib/libQt5Widgets.so.5
#29 0x00007ffff5b0c9ac in QApplicationPrivate::notify_helper(QObject_, QEvent_) () from /usr/lib/libQt5Widgets.so.5
#30 0x00007ffff5b11e86 in QApplication::notify(QObject_, QEvent_) () from /usr/lib/libQt5Widgets.so.5
#31 0x00007ffff63dd09e in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#32 0x00007ffff5219bab in QCoreApplication::notifyInternal(QObject_, QEvent_) () from /usr/lib/libQt5Core.so.5
#33 0x00007ffff555a5f1 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()

from /usr/lib/libQt5Gui.so.5
#34 0x00007ffff555c2b5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()

from /usr/lib/libQt5Gui.so.5
#35 0x00007ffff55416d8 in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) ()

from /usr/lib/libQt5Gui.so.5
#36 0x00007fffeb8ec8c0 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#37 0x00007ffff46fadc7 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#38 0x00007ffff46fb020 in ?? () from /usr/lib/libglib-2.0.so.0
#39 0x00007ffff46fb0cc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0

---Type to continue, or q to quit---
#40 0x00007ffff527054f in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQt5Core.so.5
#41 0x00007ffff521757a in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQt5Core.so.5
#42 0x00007ffff521f53c in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#43 0x00007ffff63db9db in ?? () from /usr/lib/python3.5/site-packages/PyQt5/QtWidgets.so
#44 0x00007ffff79bca89 in PyCFunction_Call () from /usr/lib/libpython3.5m.so.1.0
#45 0x00007ffff7a34a01 in PyEval_EvalFrameEx () from /usr/lib/libpython3.5m.so.1.0
#46 0x00007ffff7a35df2 in ?? () from /usr/lib/libpython3.5m.so.1.0
#47 0x00007ffff7a35ed3 in PyEval_EvalCodeEx () from /usr/lib/libpython3.5m.so.1.0
#48 0x00007ffff7a35efb in PyEval_EvalCode () from /usr/lib/libpython3.5m.so.1.0
#49 0x00007ffff7a55074 in ?? () from /usr/lib/libpython3.5m.so.1.0
#50 0x00007ffff7a57585 in PyRun_FileExFlags () from /usr/lib/libpython3.5m.so.1.0
#51 0x00007ffff7a576f6 in PyRun_SimpleFileExFlags () from /usr/lib/libpython3.5m.so.1.0
#52 0x00007ffff7a6e504 in Py_Main () from /usr/lib/libpython3.5m.so.1.0
#53 0x0000000000400af7 in main ()

@ssokolow
Copy link

ssokolow commented Feb 7, 2016

I'm also getting AttributeError: 'bytes' object has no attribute 'encode' on the console with both 0.2.3 and commit 010b279 on Lubuntu 14.04.

Given that error, I suspect the issue is that the code was written for Python 2 but *buntu 14.04 only has PyQt5 packages for Python 3 so I'm having to run it as python3 m64py rather than ./m64py.

@promi
Copy link

promi commented Feb 15, 2016

The problem is caused by this line:

self.config.set_parameter("name", devicename.encode())

"devicename" is of type "bytes" which has no "encode" method.

Commenting out lines 243-244 makes the problem disappear which I'm using as a workaround for now.

@promi
Copy link

promi commented Feb 15, 2016

I turns out the workaround is no good, now the config dialog is saving "key(...)" instead of "button(...)" or "axis(...)". The better workaround is to set the input config by hand and don't touch the input config dialog for now.

@jamezmoran
Copy link
Contributor

This issue should be fixed with #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants