Open
Description
Bug report
Describe the bug
Crashes when given a file that uses Windows's carriage returns.
Spits out the following error:
Encountered an unexpected error
This is a bug in Postgres Tools, not an error in your code, and we would appreciate it if you could report it along with the following information to help us fixing the issue:
Source Location: crates/pgt_lexer/src/lib.rs:181:9
Thread Name: pgt::worker_0
Message: No token found at position 20: 'Some("\r")'
bad.sql internalError/panic INTERNAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ processing panicked: No token found at position 20: 'Some("\r")'
⚠ This diagnostic was derived from an internal error. Potential bug, please report it if necessary.
Checked 0 files in 1588µs. No fixes applied.
internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ No files were processed in the specified paths.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Download the attached
bad.txt
- Rename to
bad.sql
- run
postgrestools check bad.sql
Expected behavior
Should work similar to files written on a UNIX system.
Screenshots
System information
- OS: Arch Linux
Additional context
I received the file from a friend who uses Windows. Whan I ran the command, it failed. When I wrote the code myself in a new file, it worked fine.