Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#2481 closed defect (can't reproduce)

Error in Python shell event filter

Reported by: goddard@… Owned by: pett
Priority: normal Milestone:
Component: General Controls Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-18.7.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-10-04)
Description
Clicked on Python shell window and got this error.

Log:
UCSF ChimeraX version: 0.91 (2019-10-04)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open /Users/goddard/ucsf/people/mckeithan/ForTom/cells4b.cxs format session

opened ChimeraX session  

> toolshed show Shell

> set bgColor black

Traceback (most recent call last):  
File
"/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/qtconsole/console_widget.py", line 428, in eventFilter  
event.button() == QtCore.Qt.MidButton and \  
AttributeError: 'QContextMenuEvent' object has no attribute 'button'  
  
AttributeError: 'QContextMenuEvent' object has no attribute 'button'  
  
File
"/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/qtconsole/console_widget.py", line 428, in eventFilter  
event.button() == QtCore.Qt.MidButton and \  
  
See log for complete Python traceback.  
  




OpenGL version: 4.1 ATI-2.11.20
OpenGL renderer: AMD Radeon Pro 580 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (3)

comment:1 by pett, 6 years ago

Component: UnassignedGeneral Controls
Owner: set to pett
Platform: all
Project: ChimeraX
Status: newaccepted
Summary: ChimeraX bug report submissionError in Python shell event filter

comment:2 by pett, 6 years ago

Resolution: can't reproduce
Status: acceptedclosed

Looking the code for qtconsole.eventFilter, this error would seem to be impossible. Early in the routine, 'etype' is assigned as:

etype = event.type()

The 'no "button" attribute' error occurs in this code:

elif etype == QtCore.QEvent.MouseButtonRelease and event.button() == QtCore.Qt.MidButton and ...

So, an event of type MouseButtonRelease doesn't have a .button() attribute?

Weird.

Last edited 6 years ago by pett (previous) (diff)

in reply to:  3 ; comment:3 by goddard@…, 6 years ago

Yeah, weird -- the error says the event is a QContextMenuEvent but clearly the event type values is MouseButtonRelease.

Note: See TracTickets for help on using tickets.