GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — bpo-47000: Make `io.text_encoding()` respects UTF-8 mode by methane · Pull Request #32003 · python/cpython Conversation
|
| return NULL; | ||
| } | ||
| } | ||
| return &_Py_ID(locale); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@ericsnowcurrently We need to incref this until we implement immortal object. Am I correct?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sort of. Currently all statically allocated global objects have their refcount initialized to a really large value. So we haven't been bothering with the incref if we know the object is one of those, which it is in this case. Incref'ing it won't hurt. However, it is effectively unnecessary.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am afraid breaking refleak buildbot.
Would you tell my why this return &_Py_ID(locale); don't break refleak test?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The refcount of static objects is not directly included in _Py_RefTotal, which is used for refleak detection. (_Py_RefTotal will still ensure that refcount operations are balanced though, regardless of the objects involved.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
(_Py_RefTotal will still ensure that refcount operations are balanced though, regardless of the objects involved.)
So skipping INCREF here might cause in-balance of _Py_RefTotal. Doesn't it break refleak test?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good point. It didn't cause a problem before. I'd have to look into why not.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Eric Snow <[email protected]>
In a gh-32003 comment, I realized it wasn't very clear how _Py_DECLARE_STR() should be used. This changes adds a comment to clarify. https://bugs.python.org/issue46541
Co-authored-by: Eric Snow <[email protected]>
io.text_encoding() respects UTF-8 mode
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.