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

Bug#750120: python-apt: Some locales use no-breaking space for LC_NUMBER, so return unicode for SizeToStr



On Sun, Jun 01, 2014 at 09:18:45PM +0200, Odin Hørthe Omdal wrote:
> Package: python-apt
> Version: 0.9.3.5
> Severity: normal
> Tags: upstream l10n patch

Thanks for your bugreport and your patch!
 
> this is on Ubuntu, but this was the closest I could find to the python-apt
> upstream :)
> 
> This is breaking the distribution upgrade on my girlfriends computer
> (since she is using nn_NO.UTF8 as her language).
> 
> Ubuntu's upgrading python script is not expecting that the str returned
> will have undecodeable chars. This could also be fixed at Ubuntu's
> level, but looking at it, I thought it hit closer to home for
> apt_pkg.size_to_str() to return a ready decoded unicode string to all
> its users.
[..]

Indeed, thanks for this fix! Unfortunately as it is right now it
breaks the API of size_to_str(), i.e. there are probably apps who
expect a type "str". So we either need to add a size_to_unicode() or a
kwarg like "as_unicode" or add a warning in the documentation for the
py2 users.

Cheers,
 Michael


Reply to: