最近做一个项目,因为前端不厉害所以只单纯写了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

Document

test


google搜出来是把前面的去掉,  一样无果,


  实在没辙 根据错误查看 源码  找到 mimetypes.py   第260行 print查看变了为什么出错。

发现该变量是读取注册表名  发现在注册表下有一项0&?无法读取,到这里就错误了,

发现打印出这么一些变量:

-- *

-- .386

-- .3g2

-- .3gp

-- .3gp2

-- .3gpp

-- .3mf

-- .7z

-- .a

-- .aac

-- .ac3

-- .accountpicture-ms

-- .ace

-- .adt

-- .adts

-- .ai

-- .AIF

-- .AIFC

-- .AIFF

-- .amr

-- .AMV

-- .ani

-- .ans

-- .APE

-- .appcontent-ms

-- .application

-- .appref-ms

-- .appx

-- .appxbundle

-- .aps

-- .arc

-- .arj

-- .art

-- .arw

-- .asa

-- .asc

-- .ascx

-- .asf

-- .asm

-- .asmx

-- .asp

-- .aspx

-- .ASS

-- .ASX

-- .AU

-- .avi

。。。。。。。。。。。还有更多,找到最后出错前的哪一样0&?

-- 0&?

又搜google这个是干什么用的 最后发现是读取注册表,

果断regedit去看看,对的  发现是注册表问题并非程序问题,删之,结果这货提示无法删除

最后又花了1小时找到了N多个软件 最后找了一个删除,  之后正常了

PCHunter_free


右键无法删除

命令行无法删除,

最后找到了PCHunter_free软件,删除后正常访问了