Pertanyaan UnicodeDecodeError: 'ascii' codec tidak dapat memecahkan kode byte 0x * pada posisi *: ordinal tidak dalam jangkauan (128)


Saya mencoba memasukkan perintah berikut

add-apt-repository ppa:ondrej/php5
You are about to add the following PPA to your system:
 This branch follows latest PHP packages as maintained by me & rest of the Debian pkg-php team.

You can get more information about the packages at https://sury.org

If you need to stay with PHP 5.4 you can use the oldstable PHP repository:

    ppa:ondrej/php5-oldstable
...
gpg: keyring `/tmp/tmpy7ajyf/secring.gpg' created
gpg: keyring `/tmp/tmpy7ajyf/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpy7ajyf/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.3/threading.py", line 639, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 141, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 238, in add_ppa_signing_key
    tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir):
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 190, in _verify_fingerprint
    got_fingerprints = self._get_fingerprints(keyring, keyring_dir)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 182, in _get_fingerprints
    output = subprocess.check_output(cmd, universal_newlines=True)
  File "/usr/lib/python3.3/subprocess.py", line 575, in check_output
    output, unused_err = process.communicate(timeout=timeout)
  File "/usr/lib/python3.3/subprocess.py", line 909, in communicate
    stdout = _eintr_retry_call(self.stdout.read)
  File "/usr/lib/python3.3/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)
  File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 92: ordinal not in range(128)

Saya mencoba menginstal php5.5.

Apakah ada pekerjaan untuk bug ini?

Atau bagaimana cara memperbaikinya?

Konten lokal lokasi lokal -a

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en.UTF-8
LANGUAGE=
LC_CTYPE="en.UTF-8"
LC_NUMERIC="en.UTF-8"
LC_TIME="en.UTF-8"
LC_COLLATE="en.UTF-8"
LC_MONETARY="en.UTF-8"
LC_MESSAGES="en.UTF-8"
LC_PAPER="en.UTF-8"
LC_NAME="en.UTF-8"
LC_ADDRESS="en.UTF-8"
LC_TELEPHONE="en.UTF-8"
LC_MEASUREMENT="en.UTF-8"
LC_IDENTIFICATION="en.UTF-8"
LC_ALL=
locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX

 locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX

21
2017-12-20 20:20


asal


Anda tidak dapat menginstalnya dari sini? - Wilf
ini adalah server yang saya miliki hanyalah baris perintah - SamFisher83
Sudahkah Anda mencoba seperti yang disarankan dan digunakan ppa:ondrej/php5-oldstable ? Juga coba perbarui python-software-properties - Wilf
oldstable melakukan hal yang sama - SamFisher83


Jawaban:


Itu locale -a output menunjukkan bahwa Anda tidak memiliki lokal utf-8 yang diaktifkan. Coba jalankan:

sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8

Melihat lebih dekat C.UTF-8 tersedia, Anda dapat mencoba hanya beralih ke:

export LANG=C.UTF-8

35
2017-12-20 21:03



Saya mencoba mengaturnya, tetapi itu tidak berhasil. Terima kasih untuk sarannya - SamFisher83
@ SamFisher83 Apa output dari locale ? Dan apa output dari locale -a ? - falconer
Saya mengedit posting utama saya - SamFisher83
@ SamFisher83 Saya memperbarui jawaban saya. - falconer
Ini membantu saya, terima kasih !! Pada awal skrip shell persidangan yang menggelikan saya menambahkan "ekspor" dari semua baris yang "lokal -a" menunjukkan :-) - starikovs