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

In module re the repeat interval {} doesn't accept numbers greater than 65535 #58122

Closed
py-user mannequin opened this issue Jan 31, 2012 · 2 comments
Closed

In module re the repeat interval {} doesn't accept numbers greater than 65535 #58122

py-user mannequin opened this issue Jan 31, 2012 · 2 comments
Labels
stdlib Python modules in the Lib dir topic-regex type-bug An unexpected behavior, bug, or error

Comments

@py-user
Copy link
Mannequin

py-user mannequin commented Jan 31, 2012

BPO 13914
Nosy @vstinner, @ezio-melotti, @py-user

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 2012-01-31.22:36:00.986>
created_at = <Date 2012-01-31.21:45:40.584>
labels = ['expert-regex', 'type-bug', 'library']
title = "In module re the repeat interval {} doesn't accept numbers greater than 65535"
updated_at = <Date 2012-01-31.22:36:00.974>
user = 'https://github.com/py-user'

bugs.python.org fields:

activity = <Date 2012-01-31.22:36:00.974>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2012-01-31.22:36:00.986>
closer = 'vstinner'
components = ['Library (Lib)', 'Regular Expressions']
creation = <Date 2012-01-31.21:45:40.584>
creator = 'py.user'
dependencies = []
files = []
hgrepos = []
issue_num = 13914
keywords = []
message_count = 2.0
messages = ['152409', '152411']
nosy_count = 3.0
nosy_names = ['vstinner', 'ezio.melotti', 'py.user']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue13914'
versions = ['Python 3.2']

@py-user
Copy link
Mannequin Author

py-user mannequin commented Jan 31, 2012

>>> import re
>>> len(re.search(r'a+', 'a' * 100000).group())
100000
>>>
>>> re.search(r'a{65536,}', 'a' * 100000)
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper
    result = cache[key]
KeyError: (<class 'str'>, 'a{65536,}', 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/re.py", line 158, in search
    return _compile(pattern, flags).search(string)
  File "/usr/local/lib/python3.2/re.py", line 255, in _compile
    return _compile_typed(type(pattern), pattern, flags)
  File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed
    return sre_compile.compile(pattern, flags)
  File "/usr/local/lib/python3.2/sre_compile.py", line 491, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/local/lib/python3.2/sre_parse.py", line 692, in parse
    p = _parse_sub(source, pattern, 0)
  File "/usr/local/lib/python3.2/sre_parse.py", line 315, in _parse_sub
    itemsappend(_parse(source, state))
  File "/usr/local/lib/python3.2/sre_parse.py", line 511, in _parse
    raise error("bad repeat interval")
sre_constants.error: bad repeat interval
>>>
>>>
>>> re.search(r'a{65536}', 'a' * 100000)
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper
    result = cache[key]
KeyError: (<class 'str'>, 'a{65536}', 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/re.py", line 158, in search
    return _compile(pattern, flags).search(string)
  File "/usr/local/lib/python3.2/re.py", line 255, in _compile
    return _compile_typed(type(pattern), pattern, flags)
  File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed
    return sre_compile.compile(pattern, flags)
  File "/usr/local/lib/python3.2/sre_compile.py", line 514, in compile
    groupindex, indexgroup
OverflowError: regular expression code size limit exceeded
>>>

@py-user py-user mannequin added stdlib Python modules in the Lib dir topic-regex type-bug An unexpected behavior, bug, or error labels Jan 31, 2012
@vstinner
Copy link
Member

This issue is a duplicate of bpo-13169.

@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
stdlib Python modules in the Lib dir topic-regex type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant