Skip to content

Update main.py - #2

Open
GannoK wants to merge 1 commit into
gentoo:masterfrom
GannoK:master
Open

Update main.py#2
GannoK wants to merge 1 commit into
gentoo:masterfrom
GannoK:master

Conversation

@GannoK

@GannoK GannoK commented Mar 19, 2025

Copy link
Copy Markdown

Fixes UnicodeDecodeError in mirrorselect by decoding with errors='replace'

`❯ mirrorselect -s10 -o

  • Using url: https://api.gentoo.org/mirrors/distfiles.xml
  • Downloading a list of mirrors...
    Got 240 mirrors.
  • Using netselect to choose the top 10 mirrors...Done.
    Traceback (most recent call last):
    File "/usr/lib/python-exec/python3.12/mirrorselect", line 55, in
    MirrorSelect().main(sys.argv)
    File "/usr/lib/python3.12/site-packages/mirrorselect/main.py", line 469, in main
    self.change_config(
    File "/usr/lib/python3.12/site-packages/mirrorselect/main.py", line 107, in change_config
    hosts[i] = hosts[i].decode("utf-8")
    ^^^^^^^^^^^^^^^^^^^^^^^^
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 42: invalid continuation byte`

Fix UnicodeDecodeError in mirrorselect by decoding with errors='replace'
@floppym

floppym commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Fixed in a876d13.

@GannoK

GannoK commented Aug 2, 2026

Copy link
Copy Markdown
Author

This was my first contribution to the project, too bad it never made it in, but this looks better. Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants