diff --git a/CHANGELOG.md b/CHANGELOG.md index 3846fb4ea5..ec1f39e280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Bug fixes +* Fix `flet build windows` failing on non-UTF-8 system locales (e.g. Simplified-Chinese Windows, code page 936/GBK) with `warning C4819` escalated to `error C2220` while compiling a plugin's Windows sources. A non-ASCII character in a plugin source (e.g. an em dash in a comment) couldn't be decoded under the system code page, and the build template's `/WX` (warnings-as-errors) turned it fatal. The Windows build template now compiles all targets with `/utf-8`, so every plugin — including third-party ones flet doesn't control (e.g. `connectivity_plus`) — reads its sources as UTF-8 regardless of the build machine's code page. Also bumps `serious_python` to 4.3.3, which removes the character from its own plugin at the source ([#6686](https://github.com/flet-dev/flet/issues/6686)) by @FeodorFitsner. * Fix the cryptic `shutil.ReadError: ... is not a zip file` failure in web apps when the app package download fails. The Pyodide worker piped the `pyfetch(app_package_url)` response straight into `unpack_archive()` without a status check, so any non-2xx response (transient server 500, expired auth 401, deleted app 404) wrote the JSON/HTML error body to a temp file and crashed while unpacking it. The worker now checks `response.ok` and raises a readable `Failed to download app package: HTTP — ` error, including the first 200 chars of the error body. Applied to both the Flet web client and the `flet build` template ([#6680](https://github.com/flet-dev/flet/pull/6680)) by @FeodorFitsner. * Remove unused `BasePage` return type and import from `BaseControl` and `ControlEvent` ([#6606](https://github.com/flet-dev/flet/pull/6606)) by @Iaw4tch. * Fix `GestureDetector.allowed_devices` crashing with `type 'List' is not a subtype of type 'List?'` and preventing the control from rendering. Property values are deserialized from JSON as `List`, but the value was read via `get>(...)`, whose reified cast fails because a `List` is not a `List`. It's now read as `List` and each entry is converted to a string before parsing, restoring `supportedDevices` filtering for Flutter's `GestureDetector` ([#6684](https://github.com/flet-dev/flet/pull/6684)) by @TURBODRIVER. diff --git a/sdk/python/templates/build/{{cookiecutter.out_dir}}/pubspec.yaml b/sdk/python/templates/build/{{cookiecutter.out_dir}}/pubspec.yaml index 430ccd15db..de38318fbf 100644 --- a/sdk/python/templates/build/{{cookiecutter.out_dir}}/pubspec.yaml +++ b/sdk/python/templates/build/{{cookiecutter.out_dir}}/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: flet: path: ../../../../../packages/flet - serious_python: 4.3.2 + serious_python: 4.3.3 # MsgPack codec used by the dart_bridge FletBackendChannel implementation # in lib/main.dart — matches the wire format flet's existing socket diff --git a/sdk/python/templates/build/{{cookiecutter.out_dir}}/windows/CMakeLists.txt b/sdk/python/templates/build/{{cookiecutter.out_dir}}/windows/CMakeLists.txt index f1b967551e..c5a700c042 100644 --- a/sdk/python/templates/build/{{cookiecutter.out_dir}}/windows/CMakeLists.txt +++ b/sdk/python/templates/build/{{cookiecutter.out_dir}}/windows/CMakeLists.txt @@ -40,6 +40,13 @@ add_definitions(-DUNICODE -D_UNICODE) function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + # Read source files as UTF-8 regardless of the build machine's system code + # page. Without this, a non-ASCII byte in any plugin's source (e.g. an em + # dash in a comment) triggers warning C4819 on non-UTF-8 locales — notably + # code page 936/GBK on Simplified-Chinese Windows — which the /WX above + # escalates to a fatal C2220. This applies to every plugin and the runner, + # including third-party plugins we don't control (flet-dev/flet#6686). + target_compile_options(${TARGET} PRIVATE /utf-8) target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS")