Add Path for type of read_default_file connection parametr
Offen
Dieses Issue hat noch niemand übernommen.
feature-request
- Vorherrschende Sprache
- Python
- Sterne
- 2.5k
- Forks
- 443
- Ø Merge
- 18 Std. 21 Min.
- Gemergte PRs (30 T.)
- 4
Beschreibung
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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- mysql, python
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100