Add Path for type of read_default_file connection parametr
Open
Nobody has claimed this yet.
feature-request
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 443
- Avg merge
- 18h 21m
- Merged PRs (30d)
- 4
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100