Skip to content

Commit

Permalink
Merge pull request #782 from Xnot/win-filechooser-buffer-passthrough
Browse files Browse the repository at this point in the history
Switch to MaxFile arg to increase Windows filechooser buffer
  • Loading branch information
akshayaurora authored Jan 8, 2025
2 parents cec344b + 74e9965 commit 181a94b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plyer/platforms/win/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 = ""
Expand Down

0 comments on commit 181a94b

Please sign in to comment.