Skip to content

flet build windows used the --no-rich-output parameter but still encountered an error. #5099

Description

@jessic-cmd

Duplicate Check

Describe the bug

When I use Azure Pipelines to build the application

    - task: CmdLine@2
      inputs:
        script: |
          flet build windows --no-rich-output
      displayName: 'Build Flet Application for Windows'

I encounter an error:

 self.write(text)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u25cf' in position 2: character maps to <undefined>

Code sample

Code
Starting: Install Flutter SDK
==============================================================================
Task         : Flutter Install Task
Description  : Install the Flutter environment.
Version      : 0.4.3
Author       : Hey24sheep
Help         : For more information, take a look at the Flutter [documentation](https://flutter.io/)
==============================================================================
Downloading: https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.29.2-stable.zip
Extracting archive
C:\Windows\system32\chcp.com 65001
Active code page: 65001

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\f4deeb81-2668-46c1-a7f6-ae4b274219d9', 'D:\a\_temp\0b66db16-b726-44aa-9eac-1f8bccb29ab0')"

Caching tool: Flutter 3.29.2 windows
Found tool in cache: Flutter 3.29.2 windows
Finishing: Install Flutter SDK
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\flet_cli\commands\build.py", line 615, in handle
    with Live(Group(self.status, self.progress), console=console) as self.live:
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\live.py", line 166, in __enter__
    self.start(refresh=self._renderable is not None)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\live.py", line 128, in start
    self.stop()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\live.py", line 147, in stop
    with self.console:
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 864, in __exit__
    self._exit_buffer()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 822, in _exit_buffer
    self._check_buffer()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 2019, in _check_buffer
    self._write_buffer()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 2055, in _write_buffer
    legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\_windows_renderer.py", line 17, in legacy_windows_render
    term.write_styled(text, style)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\_win32_console.py", line 441, in write_styled
    self.write_text(text)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\_win32_console.py", line 402, in write_text
    self.write(text)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u25cf' in position 2: character maps to <undefined>
##[error]Cmd.exe exited with code '1'.
Finishing: Build Flet Application for Windows

To reproduce

azure piplines

flutter version:3.29.2
python version : 3.10
flet version : 0.27.6

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

windows-latest

Flet version

0.27.6

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackagingRelated to app packaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions