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

SystemError with re.match(array) #44520

Closed
arigo mannequin opened this issue Jan 30, 2007 · 4 comments
Closed

SystemError with re.match(array) #44520

arigo mannequin opened this issue Jan 30, 2007 · 4 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@arigo
Copy link
Mannequin

arigo mannequin commented Jan 30, 2007

BPO 1647541
Nosy @arigo, @rhettinger
Files
  • empty-array.diff: v1
  • 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 = 'https://github.com/arigo'
    closed_at = <Date 2007-04-02.22:54:42.000>
    created_at = <Date 2007-01-30.00:04:47.000>
    labels = ['extension-modules']
    title = 'SystemError with re.match(array)'
    updated_at = <Date 2007-04-02.22:54:42.000>
    user = 'https://github.com/arigo'

    bugs.python.org fields:

    activity = <Date 2007-04-02.22:54:42.000>
    actor = 'rhettinger'
    assignee = 'arigo'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2007-01-30.00:04:47.000>
    creator = 'arigo'
    dependencies = []
    files = ['2288']
    hgrepos = []
    issue_num = 1647541
    keywords = []
    message_count = 4.0
    messages = ['31130', '31131', '31132', '31133']
    nosy_count = 3.0
    nosy_names = ['nnorwitz', 'arigo', 'rhettinger']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1647541'
    versions = ['Python 2.5']

    @arigo
    Copy link
    Mannequin Author

    arigo mannequin commented Jan 30, 2007

    An small issue which I guess is to be found in
    the implementation of the buffer interface
    for zero-length arrays:

    >>> a = array.array("c")
    >>> r = re.compile("bla")
    >>> r.match(a)
    SystemError: error return without exception set

    @arigo arigo mannequin closed this as completed Jan 30, 2007
    @arigo arigo mannequin self-assigned this Jan 30, 2007
    @arigo arigo mannequin added the extension-modules C modules in the Modules dir label Jan 30, 2007
    @arigo arigo mannequin closed this as completed Jan 30, 2007
    @arigo arigo mannequin self-assigned this Jan 30, 2007
    @arigo arigo mannequin added the extension-modules C modules in the Modules dir label Jan 30, 2007
    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Jan 30, 2007

    Armin, what do you think of the attached patch?
    File Added: empty-array.diff

    @arigo
    Copy link
    Mannequin Author

    arigo mannequin commented Jan 30, 2007

    It seems to me that an empty array should be
    equivalent to an empty string. Accessing it as a
    buffer should return a buffer of length 0, not
    raise ValueError.

    In all cases, the fix in _sre.c is sensible.

    @rhettinger
    Copy link
    Contributor

    Fixed in versions 54662 and 54663.
    Now returns a buffer of length zero other than NULL.

    @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
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant