ferstar / check-requirements-txt

Check the missing packages in requirements.txt
MIT License
8 stars 4 forks source link

Problem with path project (special characters) #6

Open davimmilhome opened 4 weeks ago

davimmilhome commented 4 weeks ago

Bug Report: InvalidRequirement Error when Parsing requirements.txt

Description

When running the check-requirements-txt script, an InvalidRequirement error is raised due to the presence of invalid characters in the requirements.txt file. The traceback suggests a parsing failure on a string containing unexpected characters like '��a\x00t\x00t\x00'.

Probably associated with special charectes of latin languages on path to project and requirements.

requirements file:

attrs==23.1.0 beautifulsoup4==4.12.2 certifi==2023.7.22 cffi==1.15.1 contourpy==1.1.0 cycler==0.11.0 et-xmlfile==1.1.0 exceptiongroup==1.1.3 fonttools==4.42.1 greenlet==2.0.2 h11==0.14.0 idna==3.4 kiwisolver==1.4.5 matplotlib==3.7.3 numpy==1.25.2 openpyxl==3.1.2 outcome==1.2.0 packaging==23.1 pandas==2.1.0 Pillow==10.0.0 pycparser==2.21 pyodbc==4.0.39 pyparsing==3.1.1 PySocks==1.7.1 python-dateutil==2.8.2 python-dotenv==1.0.0 pytz==2023.3.post1 seaborn==0.12.2 selenium==4.12.0 six==1.16.0 sniffio==1.3.0 sortedcontainers==2.4.0 soupsieve==2.5 SQLAlchemy==2.0.20 trio==0.22.2 trio-websocket==0.10.4 typing_extensions==4.7.1 tzdata==2023.3 urllib3==2.0.4 wsproto==1.2.0

Path to requirements (windows), i will use [] to ommit real data

C:\Users[user]\OneDrive - [organization that contains special character in name like"INDÚSTRIA"]\Área de Trabalho\projects\project\requirements.txt ...

davimmilhome commented 4 weeks ago

File "...\requirements.py", line 104, in init raise InvalidRequirement( pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'��a\x00s\x00t\x00'": Expected W:(0-9A-Za-z)