The following lines are printed to the terminal four times when typing a character into the search box of the file dialog. Then they are printed once on each key stroke.
2021-04-06 17:08:23.077 Python[37482:558074] -[NSNull length]: unrecognized selector sent to instance 0x7fff8893e000
2021-04-06 17:08:23.077 Python[37482:558074] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7ffbca9ae6e0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff8893e000
Note, that there's no crash and no other indication of error.
To reproduce
Run the following script
Script
```python
import sys
import PyQt5.QtCore
import traits
from traits.api import *
import traitsui
from traitsui.api import *
class Model(HasTraits):
filename = Str()
class ViewModel(ModelView):
model = Instance(Model)
def default_traits_view(self):
return View(
Item('model.filename', editor=FileEditor()),
)
if __name__ == '__main__':
print('TraitsUI', traitsui.__version__)
print('Traits', traits.__version__)
print('PyQt5', PyQt5.QtCore.QT_VERSION_STR)
print('Python', sys.version)
model = Model()
viewmodel = ViewModel(model=model)
viewmodel.configure_traits()
```
Click on the little blue directory icon to the right of the text box
Type "a" in the search box of the file dialog (see the top-right corner of the screenshot)
Problem
The following lines are printed to the terminal four times when typing a character into the search box of the file dialog. Then they are printed once on each key stroke.
Note, that there's no crash and no other indication of error.
To reproduce
Run the following script
Script
```python import sys import PyQt5.QtCore import traits from traits.api import * import traitsui from traitsui.api import * class Model(HasTraits): filename = Str() class ViewModel(ModelView): model = Instance(Model) def default_traits_view(self): return View( Item('model.filename', editor=FileEditor()), ) if __name__ == '__main__': print('TraitsUI', traitsui.__version__) print('Traits', traits.__version__) print('PyQt5', PyQt5.QtCore.QT_VERSION_STR) print('Python', sys.version) model = Model() viewmodel = ViewModel(model=model) viewmodel.configure_traits() ```System information
TraitsUI 7.1.1 Traits 6.2.0 PyQt5 5.12.6 Python 3.6.13 macOS 10.15.7
Notes
A similar error is reported in some other issues, but those seem to be unrelated to
FileEditor
.