Why “ValueError: zero length field name in format” error in Python on CentOS 6?
Posted on In QAThe same Python program runs without any problem while it report
ValueError: zero length field name in format
The piece of code in Python is:
print '== {} SPF'.format(d)
Why “ValueError: zero length field name in format” error in Python on CentOS 6?
This feature of {}
without the position argument specifier is only available after at least 3.1 for Python 3, or 2.7 for Python 2.
On CentOS 6, the default Python version is 2.6:
$ python --version
Python 2.6.6
So you need to add the position argument specifiers:
print '== {0} SPF'.format(d)
thanks