Add Path for type of read_default_file connection parametr
Đang mở
Chưa có ai nhận issue này.
feature-request
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 443
- Merge trung bình
- 18 giờ 21 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
Sample code:
from pathlib import Path
import MySQLdb
conn = MySQLdb.connect(
read_default_file=Path(__file__).with_name('mylogin.cnf').resolve())
Error:
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "/home/test/projects/venv/lib/python3.6/site-packages/MySQLdb/__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "/home/test/projects/venv/lib/python3.6/site-packages/MySQLdb/connections.py", line 208, in __init__
super(Connection, self).__init__(*args, **kwargs2)
TypeError: connect() argument 12 must be str, not PosixPath
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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.
Hướng nghiên cứu
Reproduce the sample using pathlib.Path with MySQLdb.connect, then start at MySQLdb/init.py and connections.py, as shown in the traceback. Check how read_default_file reaches the connection layer and verify that Path input no longer raises the reported TypeError while existing string input still works.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- mysql, python
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100