enthought / enthought/traitsui
File dialog issues
- Dominant language
- Python
- Stars
- 306
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Issues found by going through `Standard_Editors/File_Dialog` demos on MacOS system.
- [ ] 1. Wx file dialog closure doesn't work properly. If either OK or Cancel are clicked, it seems that the dialog doesn't close properly as the main demo window remains unresponsive (beeps on click). Could potentially be related to issues with FileEditor (#889) or improper disconnect of event handlers (#752). Closing the dialog via system "x" goes back to a responsive main demo window, however, closing the demo window doesn't actually quit the demo. I'm guessing this is because of the dialog still hanging around somewhere. `Ctrl+C` right now is the only way to fully quit the demo. This happens with wx 4.0 and 4.1.
- [ ] 2. History is advertised as a big benefit of TraitsUI file dialog over system's dialog, however, it doesn't seem to work. Qt implementation always selects current working directory while wx implementation opens on the root system folder. Wx implementation history might be affected by issue (1).
- [ ] 3. Dialogs are affected by #944
- [ ] 4. Using `FileInfo` extension doesn't show file size. This is because of errors in `commatize` helper function that could be replaced by locale specific number formatting.
- [ ] 5. Issue with using filters (I think they might be related to saving preferences as behaviour differs sometimes):
- In `File_Open_with_TextInfo_Extension.py` demo launched with wx toolkit individual files aren't shown. This is a serious problem as the whole point of the demo is to show the contents of files.
- In `File_Open_with_ImageInfo_Extension.py` demo launched with qt toolkit individual files aren't shown. Again, this beats the purpose of the demo as no image file can be selected to check its infromation.
- [ ] 6. Qt `File_Open_with_TextInfo_Extension.py` demo doesn't show contents of python files due to the following error:
```
Exception occurred in traits notification handler for object: , trait: file_name, old value: /Users/icernyte/Documents/repos/traitsui/appveyor.yml, new value: /Users/icernyte/Documents/repos/traitsui/setup.py
Traceback (most recent call last):
File "/Users/icernyte/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traits/trait_notifiers.py", line 578, in _dispatch_change_event
self.dispatch(handler, *args)
File "/Users/icernyte/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traits/trait_notifiers.py", line 540, in dispatch
handler(*args)
File "/Users/icernyte/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traits/has_traits.py", line 881, in wrapper0
return function(arg)
File "/Users/icernyte/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traits/has_traits.py", line 3347, in notify
self.trait_property_changed(name, old)
File "/Users/icernyte/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traits/has_traits.py", line 807, in decorator
self.__dict__[name] = result = function(self)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/file_dialog.py", line 262, in _get_text
if (data.find("\x00") >= 0) or (data.find("\xFF") >= 0):
TypeError: a bytes-like object is required, not 'str'
```
In `_get_text` function where the error is raised, the file is opened in binary mode. Changing the reading mode to text gets ride of the issue but I'm not sure if there is more to this.
- [ ] 7. Image display in wx `File_Open_with_ImageInfo_Extension.py` demo seems to be broken (the file is one of Enthought wallpapers):

- [ ] 8. (not sure if an actual issue or design choice) With `ImageInfo` extension folders show the following information:

From a brief look at `file_dialog.py` it seems that there might be more things that need updating (bare excepts, locale handling).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.