[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Georg Brandl
Georg Brandl added the comment: Thanks for the confirmation! -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mai

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Martin Gfeller
Martin Gfeller added the comment: Sorry for passing on my confusion, and thanks for your help! There was indeed an old python.dll lying in one of the places Windows likes to put DLLs. Deleting it resolved the problem. Thanks again and sorry to use your valuable time. Best regards, Martin --

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Ezio Melotti
Ezio Melotti added the comment: IIRC a few days ago I've seen a similar issue and the cause was that they did something wrong while porting the rc to Debian, but I don't remember the details. If I'm not mistaken they also fixed it shortly after. -- ___

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Georg Brandl
Georg Brandl added the comment: Just tested with 2.7.4rc1 32bit on Windows 7; no problem here. I suspect your 2.7.4rc1 install picks up a python27.dll from an earlier version. -- resolution: -> fixed status: open -> pending ___ Python tracker

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Georg Brandl
Georg Brandl added the comment: And this happens when you simply start Python, not executing any code? Can you start with "python -S", then do "import _sre", and see if it has a _sre.MAXREPEAT attribute? -- ___ Python tracker

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Martin Gfeller
Martin Gfeller added the comment: @Georg, the referenced Debian issue (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704084) already contains the stack. -- ___ Python tracker __

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Georg Brandl
Georg Brandl added the comment: "Python refuses to start." is not a very good description. * What script are you running/module are you importing? * What is the traceback/error message? -- ___ Python tracker _

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread STINNER Victor
STINNER Victor added the comment: "Python refuses to start. 2.7.4.rc1 Windows 32-bit." Oh oh. I reopen the issue and set its priority to release blocker. -- nosy: +benjamin.peterson, georg.brandl, larry priority: normal -> release blocker resolution: fixed -> status: closed -> open __

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-04-04 Thread Martin Gfeller
Martin Gfeller added the comment: I see (under Windows) the same symptoms as reported for Debian under http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704084. Python refuses to start. 2.7.4.rc1 Windows 32-bit. -- nosy: +Martin.Gfeller ___ Python

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset a80ea934da9a by Serhiy Storchaka in branch '2.7': Fix issue #13169: Reimport MAXREPEAT into sre_constants.py. http://hg.python.org/cpython/rev/a80ea934da9a New changeset a6231ed7bff4 by Serhiy Storchaka in branch '3.2': Fix issue #13169: Reimport MA

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for report, Arfrever. I'll see how epydoc uses MAXREPEAT. Maybe it requires larger changes. -- ___ Python tracker ___ _

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-17 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Some third-party modules (e.g. epydoc) refer to sre_constants.MAXREPEAT. Please add 'from _sre import MAXREPEAT' to Lib/sre_constants.py for compatibility. -- nosy: +Arfrever resolution: fixed -> stage: committed/rejected -> statu

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have committed simplified patches. They don't change an exception type from OverflowError to re.error (but an error message now is more helpful) and don't made the code clever enough to not raise an exception when a repetition number is exceeded sys.maxsiz

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-02-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset c1b3d25882ca by Serhiy Storchaka in branch '2.7': Issue #13169: The maximal repetition number in a regular expression has been http://hg.python.org/cpython/rev/c1b3d25882ca New changeset 472a7c652cbd by Serhiy Storchaka in branch '3.2': Issue #13169

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are patches for 2.7, 3.2 and updated patch for 3.3+ (test_repeat_minmax_overflow_maxrepeat is changed). -- Added file: http://bugs.python.org/file28919/re_maxrepeat4-2.7.patch Added file: http://bugs.python.org/file28920/re_maxrepeat4-3.2.patch A

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-31 Thread Brian Curtin
Changes by Brian Curtin : -- nosy: -brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated for addressing Ezio's comments. Tests simplified and optimized a little as Ezio suggested. Added a test for implementation dependent behavior (I hope it will gone away at some day). -- Added file: http://bugs.python.org/file28814/re_max

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file28810/re_maxrepeat2.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated for addressing Ezio's and Matthew's comments. MAXREPEAT now defined in the C code. It lowered to 2G on 32-bit platform to fit repetition numbers into Py_ssize_t. The condition for raising of an exception now more complex: if the repetition numb

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > (In the latter case, why is it in decimal?) Because SRE_MAXREPEAT is generated (as all sre_constants.h) from sre_constants.py (note changes at the end of sre_constants.py). I agree, that SRE_MAXREPEAT is imposed by the C code limitation and it will be bet

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-23 Thread Matthew Barnett
Matthew Barnett added the comment: IMHO, I don't think that MAXREPEAT should be defined in sre_constants.py _and_ SRE_MAXREPEAT defined in sre_constants.h. (In the latter case, why is it in decimal?) I think that it should be defined in one place, namely sre_constants.h, perhaps as: #define

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2013-01-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now RuntimeError is raised in this case. Here is a patch, which: 1) Increases the limit of repeat numbers to 4G (now SRE_CODE at least 32-bit). 2) Raises re.error exception if this limit is exceeded. 3) Fixes some minor related things. -- components:

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2012-02-29 Thread Matthew Barnett
Matthew Barnett added the comment: Ideally, it should raise an exception (or a warning) because the behaviour is unexpected. -- ___ Python tracker ___ _

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2012-02-29 Thread Ezio Melotti
Ezio Melotti added the comment: Matthew, do you think this should be documented somewhere or that the behavior should be changed (e.g. raising a warning when 65535 is used)? If not I'll just close the issue. -- ___ Python tracker

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: Issue #13914 has been marked as a duplicate of this issue. -- ___ Python tracker ___ ___ Python-bug

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-14 Thread Matthew Barnett
Matthew Barnett added the comment: The limit is an implementation detail. The pattern is compiled into codes which are then interpreted, and it just happens that the codes are (usually) 16 bits, giving a range of 0..65535, but it uses 65535 to represent no limit and doesn't warn if you actual

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-14 Thread Maurice de Rooij
Maurice de Rooij added the comment: So if I understand correctly, the maximum of 65535 repetitions is by design? Have tried a workaround by repeating the repetitions by placing it inside a capturing group, which is perfectly legal with Perl regular expressions: $mystring = "test"; if($mystrin

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-13 Thread Matthew Barnett
Matthew Barnett added the comment: The quantifiers use 65535 to represent no upper limit, so ".{0,65535}" is equivalent to ".*". For example: >>> re.match(".*", "x" * 10).span() (0, 10) >>> re.match(".{0,65535}", "x" * 10).span() (0, 10) but: >>> re.match(".{0,65534}", "x" *

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-13 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-13 Thread Brian Curtin
Changes by Brian Curtin : -- title: Regular expressions with 0 to 65536 repetitions and above makes Python crash -> Regular expressions with 0 to 65536 repetitions raises OverflowError ___ Python tracker _