[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#742118: python-apt: sources.list writing may fail; encoding of sources.list files (advice wanted)



Package: python-apt
Version: 0.9.3.3
Severity: serious

On Sunday, I merged a bug fix from Ubuntu to force /etc/apt/sources.list
to be opened with utf-8 encoding. This was a mistake. The patch was broken,
and things can fail now for empty entries. It is reverted in git.

I also do not think that hardcoding UTF-8 is a sensible idea. Python 3
by default uses the encoding of the locale it is run in, and that is a
much better idea.

Of course, there are people who sometimes use the "C" locale (or other
locales with different encoding than their main locale) when running
tools using python-apt and then complain about failure because python-apt
cannot read files encoded in their main locale's encoding.

I thus think we should *not* hardcode an UTF-8 encoding in python-apt,
and should instead fix applications and users that run things in an
environment with a locale different from the normal one. It also matches
the behavior of Python itself.

PS.
I CCed debian-devel@l.d.o for further input on this topic, but I'm not
subscribed. So communication should either CC the bug; or if we do not
want to spam this, deity@l.d.o or my email. Thank you.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (980, 'unstable'), (500, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-apt depends on:
ii  libapt-inst1.5     0.9.16.1
ii  libapt-pkg4.12     0.9.16.1
ii  libc6              2.18-4
ii  libgcc1            1:4.8.2-16
ii  libstdc++6         4.8.2-16
ii  python             2.7.5-5
ii  python-apt-common  0.9.3.3

Versions of packages python-apt recommends:
ii  iso-codes    3.51-1
ii  lsb-release  4.1+Debian12
ii  xz-utils     5.1.1alpha+20120614-2

Versions of packages python-apt suggests:
ii  python-apt-dbg  0.9.3.3
pn  python-apt-doc  <none>
ii  python-gtk2     2.24.0-3+b1
pn  python-vte      <none>

-- no debconf information

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Please do not top-post if possible.


Reply to: