-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
AST literal_eval exceptions provide no information about line number #73150
Comments
Without line numbers, debugging syntax errors in large documents is a tedious and painful process. |
Thanks for the patch, Steve!. This looks like a reasonable request to me, but 1) we can only make this change in 3.7 2) we need a test case for the new message 3) you can use f-strings instead of str.format() |
Usually literal_eval() is used with short one-line input. For what large documents do you use it? |
We're using Python dictionaries to express sizeable (read: 100-600 lines) On Sun, Jan 1, 2017 at 2:41 AM Serhiy Storchaka <report@bugs.python.org>
|
Steve, will you work on this patch to GitHub? |
I'll try to get to it this weekend. A bit swamped on another project right now. Thanks for the interest and the reminder! |
Steve, are you planning to work on porting this patch to github? Note: it would need a unit test, and also node is not guaranteed to have a lineno field. |
I kind of agree with Serhiy on this, nearly every use case I've encountered was simple, single-line expression. Though, by seeing Irit's patch I think the implementation is reasonable enough to do. |
This just came up again in bpo-42561 so I went ahead and created the PR. |
I'm +0 on this (even though we only had 2 users wanting this, the implementation seems very trivial). @serhiy.storchaka, @pablogsal any opinions? |
This is a recurring feature request (I have heard people asking for this a couple of times) and is simple enough to do, so I am fine with this. Unless Serhiy has some concern, I would go forward :) |
Thank you! On Fri, Dec 25, 2020 at 11:05 AM Batuhan Taskaya <report@bugs.python.org>
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: