Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

improve exit on bad config file

Đang mở
#56 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cli

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ả

enhancement Work To Do
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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của txoof/PaperPi

Tất cả issue của txoof/PaperPi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.