मैं वर्तमान में एक पाइथन स्क्रिप्ट पर काम कर रहा हूं जो एक वेब पेज अपडेट करता है। लेकिन मुख्य स्क्रिप्ट चलाने से यह त्रुटि उत्पन्न होती है:विशेषताएँ त्रुटि: 'noneType' ऑब्जेक्ट में कोई विशेषता नहीं है 'endwith'
<res status='-1'><error message="'NoneType' object has no attribute 'endswith'"><![CDATA[
Traceback (most recent call last):
File "/path/to/file/ws_config.py", line XXXX, in Run
tests = TestList().tests
File "/path/to/file/ws_config.py", line XXXX, in __init__
UpdateTestGroup(None),
File "/path/to/file/ws_config.py", line XXXX, in __init__
test = CT.CurlTest(settings),
File "/path/to/file/config_tests.py", line XXXX, in __init__
self.params.path = os.path.join('/', os.path.join(params.dir, params.file))
File "/usr/lib/python2.6/posixpath.py", line 67, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
मैं किसी भी कोड को पिछले नहीं कर सकता क्योंकि यह बहुत लंबा है। जो मैं समझने की कोशिश कर रहा हूं वह यह है कि त्रुटि कहां डालती है या कोड का कौन सा हिस्सा AttributeError को ट्रिगर कर रहा है। क्या आप कृपया मेरी मदद कर सकते हैं ???
समस्या आखिरी लेकिन एक प्रविष्टि में है: या तो 'params.dir' या' params.file' 'कोई नहीं' है, अंतिम प्रविष्टि नहीं है क्योंकि यह 'posixpath.py' stdlib मॉड्यूल को इंगित करता है। –
हां, आप सही हैं। मैं संपादित करूंगा। – zhangyangyu
तो आप मूल रूप से कह रहे हैं कि या तो 'params.dir' या' params.file' 'कोई नहीं' लौट रहे हैं? –