Add Path for type of read_default_file connection parametr
Abierto
Nadie ha tomado este issue todavía.
feature-request
- Lenguaje dominante
- Python
- Estrellas
- 2.5k
- Forks
- 443
- Merge medio
- 18 h 21 min
- PR fusionados (30 d)
- 4
Descripción
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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- mysql, python
- Área
- databases
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100