Issue 19356: Change argument _self in _io/textio.c (original) (raw)

Created on 2013-10-23 02:05 by Jeffrey.Armstrong, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_self.3.3.2.patch Jeffrey.Armstrong,2013-10-23 02:05 Patch to rename the argument _self to myself
_ctypes._self.3.3.2.patch Jeffrey.Armstrong,2013-10-23 11:30 Changes to _ctypes module
_elementree._self.3.3.2.patch Jeffrey.Armstrong,2013-10-23 11:31 Changes to _elementree module
Messages (7)
msg200992 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2013-10-23 02:05
At Modules/_io/textio.c:285, one argument to _PyIncrementalNewlineDecoder_decode is named "_self." The name "_self," however is a keyword on older Microsoft C compilers and certain other compilers attempting to maintain compatibility with Microsoft. Renaming the argument to "myself" would fix the problem with certain compilers (Microsoft C, Open Watcom, possibly more). Please note that this is not an issue with MSVC.
msg201003 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2013-10-23 07:30
I don't feel strongly about this. However, ISTM that we work reasonably hard to work with the vagaries of *nix toolchains so I don't see why an unintrusive change like this shouldn't go in to support some corner cases on the Windows front.
msg201005 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-23 08:49
I see other instances of _self in elementtree and ctypes. Don't you want to replace those too?
msg201016 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2013-10-23 11:30
That was sloppy of me to not check other modules. I hadn't encountered them in my build yet. Here's a patch for Modules/_ctypes/_ctypes.c and Modules/_ctypes/callbacks.c. The arguments were changed similarly to "myself."
msg201017 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2013-10-23 11:31
And finally here's the necessary changes to Modules/_elementree.c as well.
msg201049 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-23 17:22
New changeset 763af3d957f3 by Antoine Pitrou in branch '3.3': Issue #19356: Avoid using a C variabled named "_self", it's a reserved word in some C compilers. http://hg.python.org/cpython/rev/763af3d957f3 New changeset f6430aec5bf2 by Antoine Pitrou in branch 'default': Issue #19356: Avoid using a C variabled named "_self", it's a reserved word in some C compilers. http://hg.python.org/cpython/rev/f6430aec5bf2
msg201050 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-23 17:22
Thanks for the patches, they're committed now.
History
Date User Action Args
2022-04-11 14:57:52 admin set github: 63555
2013-10-23 17:22:33 pitrou set status: open -> closedversions: - Python 2.7messages: + resolution: fixedstage: resolved
2013-10-23 17:22:02 python-dev set nosy: + python-devmessages: +
2013-10-23 11:31:14 Jeffrey.Armstrong set files: + _elementree._self.3.3.2.patchmessages: +
2013-10-23 11:30:26 Jeffrey.Armstrong set files: + _ctypes._self.3.3.2.patchmessages: +
2013-10-23 08:49:53 pitrou set nosy: + pitroumessages: +
2013-10-23 07:30:50 tim.golden set messages: +
2013-10-23 06:45:05 pitrou set nosy: + tim.golden, brian.curtinversions: + Python 2.7, Python 3.4
2013-10-23 02:30:09 Jeffrey.Armstrong set type: compile error
2013-10-23 02:05:01 Jeffrey.Armstrong create