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
Add PendingDeprecationWarning for % formatting #47021
Comments
Per http://mail.python.org/pipermail/python-3000/2008-April/013094.html, The attached patch implements this for 3.0. For 2.6, it should only be I'm not wild about using a global variable to disallow recursion, but Another issue is that the interpreter should probably at least start up |
The problem with the static variable is that while the main thread is |
Right. But is it worth adding per-thread machinery to this? I was I'll remove the "easy" keyword! |
Would it be practical to add a _PyErr_InErrorProcessing function to |
Since we're just trying to prevent this function from recursing What would you suggest the function _PyErr_InErrorProcessing do differently? I think the real issue is: Does the additional logic and execution time |
On Tue, May 6, 2008 at 4:50 PM, Eric Smith <report@bugs.python.org> wrote:
I was just thinking that this problem would probably come up again.
Well, the first thing to check for is Py_Py3kWarning. Then do the |
In 3.0, it's always a PendingDeprecationWarning, so that won't work. if not recursing and warning_is_not_suppressed:
warn() The recursion test is expensive if using thread local storage; the |
Why not use the normal recursion check mechanism? Specifically, if (Py_EnterRecursiveCall("unicode % "))
return NULL;
// err = Warn();
Py_LeaveRecursiveCall(); I don't see where the problem with threads comes in. The GIL is held Using the macros above in essence uses TLS, but through Python's |
I'm not sure Py_EnterRecursiveCall is what I want, because that allows I think a better approach will be to remove % formatting from |
On Wed, May 7, 2008 at 10:33 AM, Eric Smith <report@bugs.python.org> wrote:
That would make user code warning that uses '%"' brittle. However, if |
True enough. Then I think we should go with:
I'll have a patch ready soon. |
The attached patch (percent_formatting_pending_deprecation_0.diff) adds I think this is good enough. We should add a warning to the docs saying I also don't have any tests for this. I haven't found a test of a The biggest problem is that this patch breaks test_doctest with |
I think this is premature until be know for sure that % formatting will Guido, can you pronouce? |
I agree. That's one of the reasons I un-assigned it to me. Well, that and I couldn't get it to pass all tests. |
Not it. |
Am closing this one. It is pointless and counter-productive unless |
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: