简体   繁体   English

Pylint 抛出 configparser.MissingSectionHeaderError:

[英]Pylint throwing configparser.MissingSectionHeaderError:

I ma testing a python file using pylint我正在使用 pylint 测试 python 文件

Code is below代码如下

""" Testing the file inside the content"""
import json

file = r'test.txt'
with open(file,'r') as fr:
    fd = fr.read()
    print (fd)

Below is the command to test下面是测试命令

pylint code.py

Error is below错误如下

raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\\Users\\ayshewew\\.pylintrc', line: 2
'import json\n'

I have executed above code in jupyter notebook and working fine我已经在 jupyter notebook 中执行了上面的代码并且工作正常

My pylint is the latest version我的 pylint 是最新版本

tried试过了

python -m pylint code.py got the output python -m pylint code.py得到了 output

working在职的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 读取配置文件Python时出现ConfigParser.MissingSectionHeaderError - ConfigParser.MissingSectionHeaderError when reading config file Python 使用全局选项解析rsyncd配置文件时的ConfigParser.MissingSectionHeaderError - ConfigParser.MissingSectionHeaderError when parsing rsyncd config file with global options configparser.MissingSectionHeaderError:文件不包含节标题。 Reddit 机器人 - configparser.MissingSectionHeaderError: File contains no section headers. Reddit bot 使用configparser解析ini文件会给出configparser.MissingSectionHeaderError以'ÿþ\\ n'作为第一行 - Parsing ini file with configparser gives configparser.MissingSectionHeaderError with 'ÿþ\n' as the first line MissingSectionHeaderError:文件不包含节标题。(configparser) - MissingSectionHeaderError: File contains no section headers.(configparser) Python2 移植到 Python3:ConfigParser 异常 - MissingSectionHeaderError 上的 AttributeError - Python2 porting to Python3: ConfigParser Exceptions - AttributeError on MissingSectionHeaderError Python-ConfigParser引发注释 - Python - ConfigParser throwing comments pylint_django抛出异常 - pylint_django throwing exception 在str.decode中使用的Pylint抛出非文本编码 - Pylint throwing non-text encoding used in str.decode pip install 抛出 MissingSectionHeaderError - pip install throws MissingSectionHeaderError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM