python regular expression re

要求找到邮箱
fname = input("Enter file name: ")
try:
fh=open(fname)
except:
fname = "mbox-short.txt"
fh=open(fname)
for line in fh:
rline=line.rstrip()
words=rline.split()
import re
y=re.findall('/S.+@/S.+',words)
print(y)

traceback到了line 5: y=re.findall('/S.+@/S.+',words)
File "D:\lib\re.py", line 240, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or bytes-like object

文件内容:http://www.py4e.com/code3/mbox-short.txt
第一次接触regular expression,感觉很抽象,望答复。

words必须是字符串,你的不是,你可以print一下你的worlds