[New-bugs-announce] [issue8359] % formating - TypeError: not all arguments converted during string formatting

عبدالله شلي (Abdellah Chelli) report at bugs.python.org
Sat Apr 10 11:37:59 CEST 2010


New submission from عبدالله شلي (Abdellah Chelli) <sneetsher at gmail.com>:

c/printf accepts this:

n=1;
printf("One hour.", n);

in other hand python/print rises an error:

n=1
print "One hour." % n

Exactly the % formatting operation.
(TypeError: not all arguments converted during string formatting)

This feature is very important when we come to I18n (translation using gettext).

As most translator don't know this work around "%i hour." or "(%i) One hour.". This is not correct for many languages as I know like Arabic where they should write some thing like "One hour." or "An hour.".

https://bugs.launchpad.net/python/+bug/341015

Could this fixed to have same behaviour as in c? More robust.

----------
components: Interpreter Core
messages: 102764
nosy: sneetsher
severity: normal
status: open
title: % formating - TypeError: not all arguments converted during string formatting
type: behavior
versions: Python 2.5, Python 2.6, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8359>
_______________________________________


More information about the New-bugs-announce mailing list