diff --git a/plyer/platforms/win/filechooser.py b/plyer/platforms/win/filechooser.py index 8a26fe3c..c7ab20cf 100644 --- a/plyer/platforms/win/filechooser.py +++ b/plyer/platforms/win/filechooser.py @@ -41,6 +41,7 @@ class Win32FileChooser: title = None icon = None show_hidden = False + buffer_size = 4096 def __init__(self, *args, **kwargs): self._handle_selection = kwargs.pop( @@ -76,10 +77,7 @@ def run(self): args["Title"] = self.title if self.title else "Pick a file..." args["CustomFilter"] = 'Other file types\x00*.*\x00' args["FilterIndex"] = 1 - file = "" - if "File" in args: - file = args["File"] - args["File"] = file + ("\x00" * 4096) + args["MaxFile"] = self.buffer_size # e.g. open_file(filters=['*.txt', '*.py']) filters = ""