From 9e01c953bc7281a0bf5cfb4afcf758ce3b8ae441 Mon Sep 17 00:00:00 2001 From: jfrancoc <39796450+jfrancoc@users.noreply.github.com> Date: Thu, 15 Nov 2018 10:21:15 +0100 Subject: [PATCH] Update filechooser.py Modification of function _generate_file_entries (lines 821-831) so as to correct a malfunctioning with ..\ in Windows platforms (it was impossible to go back after having accessed a directory) --- kivy/uix/filechooser.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kivy/uix/filechooser.py b/kivy/uix/filechooser.py index af2c8f3a7..c66e4c395 100644 --- a/kivy/uix/filechooser.py +++ b/kivy/uix/filechooser.py @@ -818,7 +818,15 @@ class FileChooserController(RelativeLayout): # generate an entries to go back to previous if not is_root and not have_parent: back = '..' + sep - pardir = self._create_entry_widget(dict( + if platform == 'win': + new_path = path[:path.rfind(sep)] + if sep not in new_path: + new_path+= sep + pardir = self._create_entry_widget(dict( + name=back, size='', path=new_path, controller=ref(self), + isdir=True, parent=None, sep=sep, get_nice_size=lambda: '')) + else: + pardir = self._create_entry_widget(dict( name=back, size='', path=back, controller=ref(self), isdir=True, parent=None, sep=sep, get_nice_size=lambda: '')) yield 0, 1, pardir