-
Notifications
You must be signed in to change notification settings - Fork 595
Open
Labels
bugSomething isn't workingSomething isn't workingpackagingRelated to app packagingRelated to app packaging
Milestone
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
FilePicker pick_files failed after build, it work fine before build
Code sample
Code
import flet as ft
import traceback
def main(page: ft.Page):
file_picker = ft.FilePicker()
async def handle_pick_files(e: ft.Event[ft.Button]):
try:
files = await file_picker.pick_files(allow_multiple=True)
selected_files.value = (
", ".join(map(lambda f: f.name, files)) if files else "Cancelled!"
)
except Exception:
traceback.print_exc()
page.add(
ft.Row(
controls=[
ft.Button(
content="Pick files",
icon=ft.Icons.UPLOAD_FILE,
on_click=handle_pick_files,
),
selected_files := ft.Text(),
]
),
)
ft.run(main)To reproduce
uv run flet build windows
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
win 11
Flet version
0.70.0.dev6561
Regression
No, it isn't
Suggestions
No response
Logs
Logs
Traceback (most recent call last):
File "..\test.py", line 10, in handle_pick_files
files = await file_picker.pick_files(allow_multiple=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "..\.venv\Lib\site-packages\flet\controls\services\file_picker.py", line 258, in pick_files
files = await self._invoke_method(
^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "..\.venv\Lib\site-packages\flet\controls\base_control.py", line 257, in _invoke_method
return await self.page.session.invoke_method(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._i, method_name, arguments, timeout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "..\.venv\Lib\site-packages\flet\messaging\session.py", line 232, in invoke_method
raise RuntimeError(err)
RuntimeError: LateInitializationError: Field '_instance@660507694' has not been initialized.
Additional details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackagingRelated to app packagingRelated to app packaging