Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Erreur] - UnicodeEncoderError ascii codec et python[Résolu]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
y351
Apprentice
Apprentice


Joined: 21 May 2017
Posts: 195

PostPosted: Thu Jan 10, 2019 2:46 pm    Post subject: [Erreur] - UnicodeEncoderError ascii codec et python[Résolu] Reply with quote

Bonjour,

Je rencontre actuellement un petit soucis :
- pour compiler ca-certificates
- l'utilisation de flaggie

Code:
emerge app-misc/ca-certificates-20180409.3.37

Code:
PYTHON_TARGETS="python2_7" emerge ca-certificates -v


Quote:
>>> /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_Root_CA_-_G2.crt
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/portage/dbapi/_MergeProcess.py", line 234, in _spawn
prev_mtimes=self.prev_mtimes, counter=counter)
File "/usr/lib64/python3.6/site-packages/portage/dbapi/vartree.py", line 1676, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib64/python3.6/site-packages/portage/dbapi/vartree.py", line 5153, in merge
counter=counter)
File "/usr/lib64/python3.6/site-packages/portage/dbapi/vartree.py", line 4313, in treewalk
rval = self._merge_contents(srcroot, destroot, cfgfiledict)
File "/usr/lib64/python3.6/site-packages/portage/dbapi/vartree.py", line 4593, in _merge_contents
self.settings["EPREFIX"].lstrip(os.sep), cfgfiledict, mymtime):
File "/usr/lib64/python3.6/site-packages/portage/dbapi/vartree.py", line 4990, in mergeme
encoding=_encodings['merge'])
File "/usr/lib64/python3.6/site-packages/portage/util/movefile.py", line 256, in movefile
selinux.rename(src, dest)
File "/usr/lib64/python3.6/site-packages/portage/__init__.py", line 250, in __call__
rval = self._func(*wrapped_args, **wrapped_kwargs)
File "/usr/lib64/python3.6/site-packages/portage/_selinux.py", line 71, in rename
os.rename(src, dest)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0151' in position 124: ordinal not in range(128)



Code:
flaggie +vim-syntax tmux

Quote:
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.6/flaggie", line 25, in <module>
sys.exit(main(sys.argv))
File "/usr/lib64/python3.6/site-packages/flaggie/cli.py", line 183, in main
output = output, dataout = dataout)
File "/usr/lib64/python3.6/site-packages/flaggie/cli.py", line 52, in parse_actions
actset.append(act)
File "/usr/lib64/python3.6/site-packages/flaggie/action.py", line 227, in append
item.clarify(self.pkgs, self._cache)
File "/usr/lib64/python3.6/site-packages/flaggie/action.py", line 66, in clarify
wis = cache.glob_whatis(arg, restrict = ns)
File "/usr/lib64/python3.6/site-packages/flaggie/cache.py", line 185, in glob_whatis
if k in restrict and arg in self.caches[k].glob:
File "/usr/lib64/python3.6/site-packages/flaggie/cache.py", line 81, in glob
prefix = '%s_' % k.lower()))
File "/usr/lib64/python3.6/site-packages/flaggie/cache.py", line 19, in grab_use_desc
for l in f:
File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 607: ordinal not in range(128)




Code:
eselect locale list

Quote:
Available targets for the LANG variable:
[1] C
[2] POSIX
[3] en_US
[4] en_US.iso88591
[5] en_US.utf8
[6] fr_FR
[7] fr_FR.iso885915@euro
[8] fr_FR.utf8 *
[9] fr_FR@euro
[10] ja_JP
[11] ja_JP.eucjp
[12] ja_JP.utf8
[ ] (free form)


Code:
emerge --info

Quote:

Portage 2.3.51 (python 3.6.5-final-0, default/linux/amd64/17.0/hardened/selinux, gcc-7.3.0, glibc-2.27-r6, 4.14.83-gentoo x86_64)
=================================================================
System uname: Linux-4.14.83-gentoo-x86_64-Intel-R-_Core-TM-_i7-5557U_CPU_@_3.10GHz-with-gentoo-2.6
KiB Mem: 16275416 total, 6021732 free
KiB Swap: 8388604 total, 8388604 free
Timestamp of repository gentoo: Thu, 10 Jan 2019 00:45:01 +0000
Head commit of repository gentoo: d74b06d1f71f37ab6f854a40d50bf28b8de72602
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p5) 2.30.0
ccache version 3.3.4 [enabled]
app-shells/bash: 4.4_p12::gentoo
dev-java/java-config: 2.2.0-r4::gentoo
dev-lang/perl: 5.26.2::gentoo
dev-lang/python: 2.7.15::gentoo, 3.6.5::gentoo
dev-util/ccache: 3.3.4-r1::gentoo
dev-util/cmake: 3.9.6::gentoo
dev-util/pkgconfig: 0.29.2::gentoo
sys-apps/baselayout: 2.6-r1::gentoo
sys-apps/openrc: 0.38.3-r1::gentoo
sys-apps/sandbox: 2.13::gentoo
sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake: 1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils: 2.30-r4::gentoo
sys-devel/gcc: 7.3.0-r3::gentoo
sys-devel/gcc-config: 2.0::gentoo
sys-devel/libtool: 2.4.6-r3::gentoo
sys-devel/make: 4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc: 2.27-r6::gentoo
Repositories:

gentoo
location: /usr/portage
sync-type: rsync
sync-uri: rsync://rsync.gentoo.org/gentoo-portage
priority: -1000
sync-rsync-verify-jobs: 1
sync-rsync-verify-metamanifest: yes
sync-rsync-extra-opts:
sync-rsync-verify-max-age: 24

local
location: /usr/local/portage
masters: gentoo
priority: 10


ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fforce-addr -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -fforce-addr -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.0 --keep-going=y --with-bdeps=y --complete-graph"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox selinux sesandbox sfperms
strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://local-URL/gentoo/"
LANG="C"
LC_ALL="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git
"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl amd64 bindist branding bzip2 chroot consolekit crypt cryptsetup cxx ffmpeg gnutls hardened iconv icu ipv6 jpeg libtirpc logrotate lzma mmx modplug multilib ncurses nls nptl opengl openmp pam pax_kernel pcre perl pic pie png pyth
on readline seccomp secure_delete selinux snmp sse sse2 ssl ssp symlink tcpd unicode wavpack webrsync-gpg xattr xml xtpax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es193
8 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_f
ile authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime
mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets words" COLLECTD_PLUGINS="load memory syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul pop
cnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superst
ar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-conso
le presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VI
DEO_CARDS="intel i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Code:
eselect python list

Quote:
Available Python interpreters, in order of preference:
[1] python3.6 (fallback)
[2] python2.7 (fallback)



Code:
eselect python set 1

Quote:
eselect python list
Available Python interpreters, in order of preference:
[1] python3.6
[2] python2.7 (fallback)





Code:
tail /etc/portage/make.conf
Quote:

PYTHON_TARGETS="python2_7 python3_6"
PYTHON_SINGLE_TARGET="python2_7"


Code:
emerge ca-certificates -v

-> même messages d'ereurs

Merci d'avance pour vos retours.


Last edited by y351 on Fri Jan 11, 2019 9:34 am; edited 1 time in total
Back to top
View user's profile Send private message
YetiBarBar
Guru
Guru


Joined: 23 Dec 2005
Posts: 532

PostPosted: Thu Jan 10, 2019 8:36 pm    Post subject: Reply with quote

Bonjour,

Il y a une incohérence entre ton choix de locale (fr_FR.utf8) et ce qu'on retrouve dans la sortie de ton emerge --info (LC_ALL=C).

As-tu bien exécuté:
Code:
root #env-update && source /etc/profile
après avoir choisi défini ton choix d'une locale en UTF-8?

Que te renvoie la commande
Code:
locale
?

Note: Le guide de localisation déconseille de définir LC_ALL
Back to top
View user's profile Send private message
y351
Apprentice
Apprentice


Joined: 21 May 2017
Posts: 195

PostPosted: Fri Jan 11, 2019 9:33 am    Post subject: Reply with quote

Bonjour,

Il semblerait en effet que les variables locales que j'avais définies soient la cause.
J'avais ajouté des exports de mon shell, historiquement, pour des sorties de logs en langue de Shakespeare (enfin, je crois) :
Quote:

LANG=C
LC_ALL=C
LC_CTYPE=C


J'ai finalement enlevé les variables de python target ; ce nétait pas nécessaire.

Merci pour l'aiguillage.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum