Closed FadeMind closed 7 years ago
@FadeMind
Could you please tell me the output of pacman-mirrors -v
?
output-pacman-mirrors-4.0.3-2017-04-10.1948.txt
Did you change your symlink /usr/bin/python
from python3 to python2?
UnicodeEncodeError: 'ascii' codec can't encode character '\u0144' in position 26: ordinal not in range(128)
The error indicates Python 2 is used instead of Python 3.6 Python 3 uses unicode string as default whereas Python 2 uses ascii str
Also check that these packages are installed and current
gtk3
python-gobject
Please report back the result of the above checks.
Issue regarding with lastest python 3.6.x changes see: https://github.com/StevenBlack/hosts/issues/258#issuecomment-284878414
Switch to Python2 (via symlink will WORKAROUND issue cause Py2 don't use encoding arg in open() ). Currently I don't have access to my manjaro setup, so I cannot attach any logs.
Regards
@Huluti This issue is a fine example of why we should have this in file headers for pacman-mirrors.
#!/usr/bin/env python3
How else to make sure the script is executed with python3 when user has changed the default python env?
@FadeMind I have changed the fileheaders for pacman-mirrors to point to python3
Nevermind - it does not help.
Seems you will have to find another way because it is not pacman-mirrors - at least what I make of it.
Solutions are two ways: switch to python2 or add proper code for handle CODECS in Py script.
Which version of pacman-mirrors is affected by this?
All lastest (since Manjaro switched to Python JSON mode scripting for generate mirrorlist).
This issue only happened AFTER select custom mirrors via interactive mode via -i switch.
So you're saying that some handling of CODECS in pacman-mirrors is causing this?
Pacman-mirrors does not use any type of CODECS so what are you're referring to?
If so - it should be a problem for everyone using --interactive
yet I have not heard about it - not even on the forum - which if it was a problem would have been boiling over the issue by now.
Could you please tell me excact steps to reproduce what is in your OP?
Could you please try install pacman-mirrors-dev
from unstable and report back if it is also an issue there?
Reproduce:
sudo pacman-mirrors -i -c all
Select random mirrors and click on OK for apply changes. Custom mirrorlist will be generated and saved but at least error about ASCII encoding will happen.
Py 3.6 open() has an encoding argument: https://docs.python.org/3.6/library/functions.html#open https://docs.python.org/3.6/library/codecs.html
I can see the Gtk-warning - but that I have never seen before - so something must have changed in the GTK implementation.
Just realized why I haven't seen it before, I am using Xfce on another rig and I am usually on Gnome - there must be some significance
at least error about ASCII encoding will happen
No encoding errors. By your name I guess Poland? Did you or any other just recently translated pacman-mirrors to Polish? If so I suspect that polish characters are written to the mirrorlist according to the last error
It could be that the %d %B %Y %H:%M
contains regional chars which is outside ascii.
File "/usr/lib/python3.6/site-packages/pacman_mirrors/filefn.py", line 127, in write_mirrorlist_header
datetime.datetime.now().strftime("%d %B %Y %H:%M")))
UnicodeEncodeError: 'ascii' codec can't encode character '\u0144' in position 26: ordinal not in range(128)
What are your output of pacman-mirrors -v
The links you are referring to has nothing to do with the mirrorlist generation so it is not that the fetched file is decoded because that happens when pacman-mirrors load.
/media/.../manjaro/pamac >>> sudo pacman-mirrors -v ±[master]
pacman-mirrors 4.0.3
/media/.../manjaro/pamac >>> sudo pacman-mirrors -i ±[master]
.: Info Downloading mirrors from repo.manjaro.org
.: Info Using custom mirror file
.: Info Querying mirrors - This may take some time
0.073 Denmark : https://www.uex.dk/repos/manjaro/
0.077 Denmark : https://mirrors.dotsrc.org/manjaro/
(pacman-mirrors:15094): Gtk-WARNING **: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version
(pacman-mirrors:15094): Gtk-WARNING **: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version
(pacman-mirrors:15094): Gtk-WARNING **: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
.: Info User generated mirror list
--------------------------
.: Info Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
.: Info Writing mirror list
Denmark : http://www.uex.dk/repos/manjaro/stable
Denmark : https://www.uex.dk/repos/manjaro/stable
Denmark : http://mirrors.dotsrc.org/manjaro/stable
Denmark : https://mirrors.dotsrc.org/manjaro/stable
.: Info Mirrorlist generated and saved to: /etc/pacman.d/mirrorlist
.: Info To reset custom config run pacman-mirrors -c all
Like I mention in PM, I don't have now access to my Manjaro setup disk, but I was on Unstable branch and 9 days ago this happens.
I have found that it maybe is a bug in the internal strftime()
The bug is mentioned here:
http://stackoverflow.com/questions/16034060/python3-datetime-datetime-strftime-failed-to-accept-utf-8-string-format
I have changed the datetime output so it goes like this
dd-mm-yyyy hh:mm
Instead of
dd monthlocalename yyyy hh:mm
It should remove the bug and I know its the easy way - but it is just a convenience timestamp so the user can see when the mirrorlist was generated.
@philmmanjaro I have pushed a commit to master branch Will you build v4.1.1-dev and upload a new package
@Huluti Do you know what to do with this message which recently has emerged?
(pacman-mirrors:3371): Gtk-WARNING **: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version
(pacman-mirrors:3371): Gtk-WARNING **: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version
(pacman-mirrors:3371): Gtk-WARNING **: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Just realized why I haven't seen it before - I am usually on Gnome - there must be some significance
@FadeMind: I've released pacman-mirrors-dev-4.1.0-2 to our unstable branch. Please give us feedback. @fhdk: Is v4.1.0 ready to be released?
@philmmanjaro
Is v4.1.0 ready to be released?
Indeed
@Huluti @philmmanjaro The above comment regarding the gtk-warning about theme parsing error - I have no idea what to do with it. I have seen it - on xfce edition - now that I am back on gnome edition is does not exist. Otherwise - it is good to go :smile: I have testet the additions very thoroughly - but of course - you'll never fully know until it is in the hand of the user.
@FadeMind: should be also fixed in v4.0.4. Please confirm.
@philmmanjaro FIXED.
Interactive mode is damaged: