最近做一个项目,因为前端不厉害所以只单纯写了html 不做任何css js 就没有引入 ,
结果差不多了 要弄页面了 发现无法导入js css等静态文件。
静提示错误TypeError: must be string without null bytes or None, not str
无法加载静态文件。,
重新又写了几行代码
from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('test.html')
if __name__=="__main__":
app.run(debug=True)
然后引入css
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="{{url_for('static',filename='style.css')}}">
</head>
<body>
test
</body>
</html>
google搜出来是把前面的<!doctype html>去掉, 一样无果,
实在没辙 根据错误查看 源码 找到 mimetypes.py 第260行 print查看变了为什么出错。
发现该变量是读取注册表名 发现在注册表下有一项0&?无法读取,到这里就错误了,
发现打印出这么一些变量:
<PyHKEY at 03B1FA40 (80000000)> -- *
<PyHKEY at 03B1FA40 (80000000)> -- .386
<PyHKEY at 03B1FA40 (80000000)> -- .3g2
<PyHKEY at 03B1FA40 (80000000)> -- .3gp
<PyHKEY at 03B1FA40 (80000000)> -- .3gp2
<PyHKEY at 03B1FA40 (80000000)> -- .3gpp
<PyHKEY at 03B1FA40 (80000000)> -- .3mf
<PyHKEY at 03B1FA40 (80000000)> -- .7z
<PyHKEY at 03B1FA40 (80000000)> -- .a
<PyHKEY at 03B1FA40 (80000000)> -- .aac
<PyHKEY at 03B1FA40 (80000000)> -- .ac3
<PyHKEY at 03B1FA40 (80000000)> -- .accountpicture-ms
<PyHKEY at 03B1FA40 (80000000)> -- .ace
<PyHKEY at 03B1FA40 (80000000)> -- .adt
<PyHKEY at 03B1FA40 (80000000)> -- .adts
<PyHKEY at 03B1FA40 (80000000)> -- .ai
<PyHKEY at 03B1FA40 (80000000)> -- .AIF
<PyHKEY at 03B1FA40 (80000000)> -- .AIFC
<PyHKEY at 03B1FA40 (80000000)> -- .AIFF
<PyHKEY at 03B1FA40 (80000000)> -- .amr
<PyHKEY at 03B1FA40 (80000000)> -- .AMV
<PyHKEY at 03B1FA40 (80000000)> -- .ani
<PyHKEY at 03B1FA40 (80000000)> -- .ans
<PyHKEY at 03B1FA40 (80000000)> -- .APE
<PyHKEY at 03B1FA40 (80000000)> -- .appcontent-ms
<PyHKEY at 03B1FA40 (80000000)> -- .application
<PyHKEY at 03B1FA40 (80000000)> -- .appref-ms
<PyHKEY at 03B1FA40 (80000000)> -- .appx
<PyHKEY at 03B1FA40 (80000000)> -- .appxbundle
<PyHKEY at 03B1FA40 (80000000)> -- .aps
<PyHKEY at 03B1FA40 (80000000)> -- .arc
<PyHKEY at 03B1FA40 (80000000)> -- .arj
<PyHKEY at 03B1FA40 (80000000)> -- .art
<PyHKEY at 03B1FA40 (80000000)> -- .arw
<PyHKEY at 03B1FA40 (80000000)> -- .asa
<PyHKEY at 03B1FA40 (80000000)> -- .asc
<PyHKEY at 03B1FA40 (80000000)> -- .ascx
<PyHKEY at 03B1FA40 (80000000)> -- .asf
<PyHKEY at 03B1FA40 (80000000)> -- .asm
<PyHKEY at 03B1FA40 (80000000)> -- .asmx
<PyHKEY at 03B1FA40 (80000000)> -- .asp
<PyHKEY at 03B1FA40 (80000000)> -- .aspx
<PyHKEY at 03B1FA40 (80000000)> -- .ASS
<PyHKEY at 03B1FA40 (80000000)> -- .ASX
<PyHKEY at 03B1FA40 (80000000)> -- .AU
<PyHKEY at 03B1FA40 (80000000)> -- .avi
。。。。。。。。。。。还有更多,找到最后出错前的哪一样0&?
<PyHKEY at 03B1FA40 (80000000)> -- 0&?
又搜google这个是干什么用的 最后发现是读取注册表,
果断regedit去看看,对的 发现是注册表问题并非程序问题,删之,结果这货提示无法删除
最后又花了1小时找到了N多个软件 最后找了一个删除, 之后正常了
PCHunter_free
右键无法删除
命令行无法删除,
最后找到了PCHunter_free软件,删除后正常访问了
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。