试图让这行代码工作,无论我如何更改格式,我都会遇到问题:
if not os.path.exists(os.path.join(IncludeSettings.FILE_URL, [str(x) for x in [year, month, day]])):
(年、月、日)可以是整数或字符串。
追溯:
Traceback (most recent call last):
File "/home/tinyup/dev/lib/python2.7/site-packages/pyramid_debugtoolbar-1.0.3-py2.7.egg/pyramid_debugtoolbar/toolbar.py", line 117, in toolbar_tween
response = _handler(request)
File "/home/tinyup/dev/lib/python2.7/site-packages/pyramid_debugtoolbar-1.0.3-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
result = handler(request)
File "/home/tinyup/dev/lib/python2.7/site-packages/pyramid-1.4a3-py2.7.egg/pyramid/tweens.py", line 20, in excview_tween
response = handler(request)
File "/home/tinyup/dev/lib/python2.7/site-packages/pyramid-1.4a3-py2.7.egg/pyramid/router.py", line 161, in handle_request
response = view_callable(context, request)
File "/home/tinyup/dev/lib/python2.7/site-packages/pyramid-1.4a3-py2.7.egg/pyramid/config/views.py", line 342, in rendered_view
result = view(context, request)
File "/home/tinyup/dev/lib/python2.7/site-packages/pyramid-1.4a3-py2.7.egg/pyramid/config/views.py", line 456, in _class_requestonly_view
response = getattr(inst, attr)()
File "/home/tinyup/dev/tinyuploads/tinyuploads/views/share.py", line 56, in view_process
return self.handle_file_upload(self.request.params['file'], shareID)
File "/home/tinyup/dev/tinyuploads/tinyuploads/views/share.py", line 101, in handle_file_upload
self.save(file, newFileName, isImage, uploadTime)
File "/home/tinyup/dev/tinyuploads/tinyuploads/views/share.py", line 166, in save
if not os.path.exists(os.path.join(IncludeSettings.FILE_URL, [str(x) for x in [year, month, day]])):
File "/home/tinyup/dev/lib/python2.7/posixpath.py", line 66, in join
if b.startswith('/'):
AttributeError: 'list' object has no attribute 'startswith'