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

TOML 1.0.0 parser used in release 1.1.386 fails when using CRLF as line endings and comments #9339

Closed
plu-bgl opened this issue Oct 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@plu-bgl
Copy link

plu-bgl commented Oct 28, 2024

Describe the bug
I think the following issue is reintroduced in v1.1.386: #4367.

To reproduce
Use this minimal project file with CRLF line endings on Windows:

[project]
name = "my-package"
version = "0.0.0"
authors = [{ name = "Anonymous" }]
description = "Simple package"
readme = "README.md"
requires-python = ">=3.12"
dependencies = []
classifiers = [
  # Some documentation.
  "Programming Language :: Python :: 3.13",
]

If you run pyright, you see the following errors:

> pyright
Pyproject file parse attempt 1 error: {"name":"TomlError","fromTOML":true,"wrapped":null,"line":9,"col":23,"pos":229}
Pyproject file parse attempt 2 error: {"name":"TomlError","fromTOML":true,"wrapped":null,"line":9,"col":23,"pos":229}
Pyproject file parse attempt 3 error: {"name":"TomlError","fromTOML":true,"wrapped":null,"line":9,"col":23,"pos":229}
Pyproject file parse attempt 4 error: {"name":"TomlError","fromTOML":true,"wrapped":null,"line":9,"col":23,"pos":229}
Pyproject file parse attempt 5 error: {"name":"TomlError","fromTOML":true,"wrapped":null,"line":9,"col":23,"pos":229}
Pyproject file parse attempt 6 error: {"name":"TomlError","fromTOML":true,"wrapped":null,"line":9,"col":23,"pos":229}
Config file "c:\temp\pyproject.toml" could not be parsed. Verify that format is correct.

Expected behavior
No errors

Screenshots or Code
See above

VS Code extension or command line
Command-line

Additional context

  • If you replace all CRLF to LF, no errors happen.
  • Using v1.1.385 works correctly with CRLF.
@plu-bgl
Copy link
Author

plu-bgl commented Oct 28, 2024

Probably a duplicate of #9296, sorry.

@erictraut erictraut closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants