enthought / enthought/traitsui

In Windows/Qt, FileEditor selecting Desktop inserts extra user name

Open
#461 3 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

```
from os.path import expanduser
from traits.api import HasTraits, File, Unicode
from traitsui.api import FileEditor, Item, View

class Foo(HasTraits):
f = Unicode()
def _f_default(self):
return expanduser("~")

view = View(Item('f', editor=FileEditor(), show_label=False),resizable=True)
foo = Foo()
foo.edit_traits(view=view)
```
Note the default `style`.
Use the folder icon to open the native directory browser.
![capture2](https://user-images.githubusercontent.com/852629/41254493-3ecd6760-6d89-11e8-86a6-6a7c38a2432f.PNG)
Navigate to the Desktop and choose "Open".
The resulting path has an extra `` appended after `Desktop`.
![capture3](https://user-images.githubusercontent.com/852629/41254542-6f76fa8e-6d89-11e8-9ff6-f9c49f509f3c.PNG)

```
In [11]: traitsui.__version__
Out[11]: '6.0.0'
In [13]: pyface.__version__
Out[13]: '6.0.0'
```
PyQt version 4.12-1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.