Skip to content
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

Change argument _self in _io/textio.c #63555

Closed
JeffreyArmstrong mannequin opened this issue Oct 23, 2013 · 7 comments
Closed

Change argument _self in _io/textio.c #63555

JeffreyArmstrong mannequin opened this issue Oct 23, 2013 · 7 comments
Labels
build The build process and cross-build topic-IO

Comments

@JeffreyArmstrong
Copy link
Mannequin

JeffreyArmstrong mannequin commented Oct 23, 2013

BPO 19356
Nosy @pitrou, @tjguk, @briancurtin
Files
  • _self.3.3.2.patch: Patch to rename the argument _self to myself
  • _ctypes._self.3.3.2.patch: Changes to _ctypes module
  • _elementree._self.3.3.2.patch: Changes to _elementree module
  • 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:

    assignee = None
    closed_at = <Date 2013-10-23.17:22:33.124>
    created_at = <Date 2013-10-23.02:05:01.889>
    labels = ['build', 'expert-IO']
    title = 'Change argument _self in _io/textio.c'
    updated_at = <Date 2013-10-23.17:22:33.122>
    user = 'https://bugs.python.org/JeffreyArmstrong'

    bugs.python.org fields:

    activity = <Date 2013-10-23.17:22:33.122>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-10-23.17:22:33.124>
    closer = 'pitrou'
    components = ['Build', 'IO']
    creation = <Date 2013-10-23.02:05:01.889>
    creator = 'Jeffrey.Armstrong'
    dependencies = []
    files = ['32308', '32311', '32312']
    hgrepos = []
    issue_num = 19356
    keywords = ['patch']
    message_count = 7.0
    messages = ['200992', '201003', '201005', '201016', '201017', '201049', '201050']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'tim.golden', 'brian.curtin', 'python-dev', 'Jeffrey.Armstrong']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue19356'
    versions = ['Python 3.3', 'Python 3.4']

    @JeffreyArmstrong
    Copy link
    Mannequin Author

    JeffreyArmstrong mannequin commented Oct 23, 2013

    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.

    @JeffreyArmstrong JeffreyArmstrong mannequin added build The build process and cross-build topic-IO labels Oct 23, 2013
    @tjguk
    Copy link
    Member

    tjguk commented Oct 23, 2013

    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.

    @pitrou
    Copy link
    Member

    pitrou commented Oct 23, 2013

    I see other instances of _self in elementtree and ctypes. Don't you want to replace those too?

    @JeffreyArmstrong
    Copy link
    Mannequin Author

    JeffreyArmstrong mannequin commented Oct 23, 2013

    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."

    @JeffreyArmstrong
    Copy link
    Mannequin Author

    JeffreyArmstrong mannequin commented Oct 23, 2013

    And finally here's the necessary changes to Modules/_elementree.c as well.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 23, 2013

    New changeset 763af3d957f3 by Antoine Pitrou in branch '3.3':
    Issue bpo-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 bpo-19356: Avoid using a C variabled named "_self", it's a reserved word in some C compilers.
    http://hg.python.org/cpython/rev/f6430aec5bf2

    @pitrou
    Copy link
    Member

    pitrou commented Oct 23, 2013

    Thanks for the patches, they're committed now.

    @pitrou pitrou closed this as completed Oct 23, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build topic-IO
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants