Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to MaxFile arg to increase Windows filechooser buffer #782

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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