-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
启动 main.py报错 #231
Comments
@qiusong2613 python3.7版本的configparser不支持None的值,建议你降下版本 2的话用2.7, 3的话用3.6 |
报错的时候 ,我用的就是3.6的版本 不过我修改了下代码 现在可以了 |
建议修改成: |
觉得将配置文件改为Python文件更好一些,ini文件有时候会莫名出错,感觉兼容性不好,建议可以改成类似于Scrapy的配置文件。 |
GetConfig.py 可以有效绕开这个错误 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Connected to pydev debugger (build 183.4588.64)
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1741, in
main()
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/yangjian/pyCharmWorkSpace/test/proxy_pool-master/Run/main.py", line 21, in
from Api.ProxyApi import run as ProxyApiRun
File "../Api/ProxyApi.py", line 22, in
from Util.GetConfig import config
File "../Util/GetConfig.py", line 65, in
config = GetConfig()
File "../Util/GetConfig.py", line 29, in init
self.config_file = ConfigParse(defaults={"password": None})
File "../Util/utilClass.py", line 48, in init
ConfigParser.init(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 638, in init
self._read_defaults(defaults)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 1216, in _read_defaults
self.read_dict({self.default_section: defaults})
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 753, in read_dict
self.set(section, key, value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 1197, in set
self._validate_value_types(option=option, value=value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 1182, in _validate_value_types
raise TypeError("option values must be strings")
TypeError: option values must be strings
The text was updated successfully, but these errors were encountered: