Python スクリプトで奇妙な属性エラーが発生しています。
File "/home/francesco/Documents/Dropbox/py_campaigns/queries.py", line 132, in replace_string
string[9] = string[9].replace(' ', '_')
AttributeError: 'NoneType' object has no attribute 'replace'
>>> string[9]
'displayURL_A'
>>> string[9].replace(' ','_')
'displayURL_A'
ご覧のとおり、リストの要素に属性エラーがあります。しかし、インタープリターでまったく同じコマンドを試すと、すべてうまくいきます。None であるオブジェクトを見つけるにはどうすればよいですか?
前もって感謝します!