联接路径:TypeError:join()参数必须为str或字节,而不是'NoneType'

时间:2018-10-06 09:38:11

标签: python-3.x

@staticmethod
def get_abs_filename(filename):
    speak_result = os.path.abspath(os.path.join(os.path.dirname(__file__), 
                                   os.pardir, filename))
    return speak_result

有人可以告诉我我做错了什么吗?

File "D:\Luan Van\Jennie\Jennie\TextManager\speaker.py", line 37, in get_abs_filename
    os.pardir, filename))
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\ntpath.py", line 115, 
    in joingenericpath._check_arg_types('join', path, *paths)
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\genericpath.py", line 149,
    in _check_arg_types(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'

0 个答案:

没有答案