improve exit on bad config file
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start in paperpi.py at get_config_files, where the traceback shows parse_config() is called, and inspect how configuration parsing errors are handled. Reproduce the reported malformed paperpi.ini and check the project's tests for config handling. Done means a bad config produces a clearer error identifying the problem rather than an unhandled traceback.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
12:38:13 paperpi :get_config_files:251 :INFO - using configuration files to configure PaperPi: [PosixPath('/home/pi/src/PaperPi/paperpi/config/paperpi.ini'), PosixPath('/home/pi/.config/com.txoof.paperpi/paperpi.ini')]
Traceback (most recent call last):
File "/home/pi/src/PaperPi/paperpi/./paperpi.py", line 758, in <module>
exit_code = main()
File "/home/pi/src/PaperPi/paperpi/./paperpi.py", line 644, in main
config_files = get_config_files(cmd_args)
File "/home/pi/src/PaperPi/paperpi/./paperpi.py", line 254, in get_config_files
config_files.parse_config()
File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/ArgConfigParse/ArgConfigParse.py", line 227, in parse_config
self.parser.read(file)
File "/usr/lib/python3.9/configparser.py", line 697, in read
self._read(fp, filename)
File "/usr/lib/python3.9/configparser.py", line 1113, in _read
raise e
configparser.ParsingError: Source contains parsing errors: PosixPath('/home/pi/.config/com.txoof.paperpi/paperpi.ini')
[line 195]: "'''\n"
It would be good to exit with a better error message and try to identify the problem in the config file rather than just crashing out.
- Ngôn ngữ chính
- Python
- Star
- 205
- Fork
- 17
- Merge trung bình
- 5 giờ 20 phút
- Pull request đã merge (30 ngày)
- 54
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của txoof/PaperPi
-
area:web
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:core enhancement hardware
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của txoof/PaperPi
Issue tương tự
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
yunaremaia/proto-drift#22 ·
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
yunaremaia/memwatch#96 ·
-
bug good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
yunaremaia/ci-gate-watch#34 ·
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
yunaremaia/agent-capability-attestation#64 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
yunaremaia/agent-call-graph#43 ·
Maintainer thường phản hồi trong vòng 1 ngày