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
Remove backslash escapes from tokenize.c. #44961
Comments
This patch modifies tokanizer.c so that it does not skip the character after a backslash in determining the end of a string in raw strings only. A few strings needed changes in order to compile. Two in textwrap.py, and one in distutils/util.py. This does not include changes needed for tests to pass. I'll include those in a separate patch. |
Forgot to specify... This is against the py3k-struni branch, revision 55388. |
Here's a more complete patch which modifies the following files... (in py3k_struni branch) M Python/ast.c The test still dosen't pass, but it fails in the same way as it did before these changes were made. I'll continue to look into this. I think it's more of a problem with the test it self and not a problem with the modules. Or it may be a bug in the struni branch that is yet to be fixed. The following alter one or two raw strings each replacing the outer most quotes with triple quotes in most cases. M Lib/sgmllib.py |
Here's a more complete patch which modifies the following files... (in py3k_struni branch) M Python/ast.c The test still dosen't pass, but it fails in the same way as it did before these changes were made. I'll continue to look into this. I think it's more of a problem with the test it self and not a problem with the modules. Or it may be a bug in the struni branch that is yet to be fixed. The following alter one or two raw strings each replacing the outer most quotes with triple quotes in most cases. M Lib/sgmllib.py File Added: norawescape2.diff |
Just FYI, I have downloaded this and will attempt to apply it some time next week. |
Updated patch. The error that I had mentioned before has been fixed. It has random failures due to it using a random sample of other tests as sources to do round trip tests with. If those files have a problems in them, then this tests fails. Added a filename output line to the test so the problem file can be identified. Patch is against the py3k_struni branch, revision 55970 File Added: norawescape3.diff |
Can you create a new patch and verify that the problem still exists? |
Yes, I will update it. |
FWIW, I'm +1 on the part of this patch that disables \u in raw strings. |
It looks like the disabling of \u and \U in raw strings is done. Does While working on this I was able to clean up the string parsing parts of And an updated patch with both the cleaned up tokenize.c and the no |
I don't think tokenizer.py needs to be changed -- it never interpreted The tokenizer.c cleanup is submitted as revision 59007. I still am not warming up towards the no-raw-escapes feature, so I'm |
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: