Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newline character in requirements parser #5328

Closed
paulmaxus opened this issue Jul 26, 2023 · 0 comments · Fixed by #5509
Closed

newline character in requirements parser #5328

paulmaxus opened this issue Jul 26, 2023 · 0 comments · Fixed by #5509
Labels
good first issue Good for newcomers
Milestone

Comments

@paulmaxus
Copy link

Issue related to #3935:
panel==1.2.0

When using panel convert with the --requirements option and a requirements.txt file, I receive this error:
Failed to convert file to pyodide-worker target: Requirements parser raised following error: Expected end or semicolon (after version specifier)

The issue is that the newline character is specified as '/n' when splitting the text, even though it's '\n'.

I would suggest something like this to avoid the newline character entirely:

requirements_path = pathlib.Path(requirements)
with requirements_path.open(encoding='utf-8') as f:
    requirements = f.read().splitlines()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants