• Re: why this code giving recursion error????

    From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Sun Jun 26 13:50:01 2022
    stack trace:



    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 5387, in <module>
    class bottle:
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 5694, in bottle
    class Router(object):
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 5736, in Router
    rule_syntax = re.compile('(\\\\*)'
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 375, in compile
    return sre_compile.compile(pattern, flags)
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 2752, in compile
    return sre_compile.compile(
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 2752, in compile
    return sre_compile.compile(
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 2752, in compile
    return sre_compile.compile(
    [Previous line repeated 1005 more times]
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 2736, in compile
    p = sre_parse.parse(p, flags)
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1822, in parse
    p = sre_parse._parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1234, in _parse_sub
    itemsappend(sre_parse._parse(source, state, verbose, nested + 1,
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1708, in _parse
    p = sre_parse._parse_sub(source, state, sub_verbose, nested + 1)
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1234, in _parse_sub
    itemsappend(sre_parse._parse(source, state, verbose, nested + 1,
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1708, in _parse
    p = sre_parse._parse_sub(source, state, sub_verbose, nested + 1)
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1234, in _parse_sub
    itemsappend(sre_parse._parse(source, state, verbose, nested + 1,
    File "\\Weank-fs\users$\NetanelST\ORACLE\RTR.py", line 1707, in _parse
    not (del_flags & SRE_FLAG_VERBOSE))
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\enum.py",
    line 987, in __and__
    if not isinstance(other, (self.__class__, int)):

    ‫בתאריך יום א׳, 26 ביוני 2022 ב-13:48 מאת נתי שטרן <‪nsh531@gmail.com‬‏>:‬

    def compile(p, flags=0):
    # internal: convert pattern list to internal format

    if (isinstance(p,str)):
    pattern = p
    p = sre_parse.parse(p, flags)
    else:
    pattern = None

    code = _code(p, flags)

    if flags & SRE_FLAG_DEBUG:
    print()
    dis(code)

    # map in either direction
    groupindex = p.state.groupdict
    indexgroup = [None] * p.state.groups
    for k, i in groupindex.items():
    indexgroup[i] = k

    return sre_compile.compile(
    pattern, flags | p.state.flags, code,
    p.state.groups-1,
    groupindex, tuple(indexgroup)
    )


    --
    <https://netanel.ml>



    --
    <https://netanel.ml>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Sun Jun 26 13:56:27 2022
    and i ask also what's the problem with this function:


    def _code(p, flags):

    flags = p.state.flags | flags
    code = []

    # compile info block
    sre_compile._compile_info(code, p, flags)

    # compile the pattern
    sre_compile._compile(code, p.data, flags)

    code.append(SUCCESS)

    return code


    ‫בתאריך יום א׳, 26 ביוני 2022 ב-13:48 מאת נתי שטרן <‪nsh531@gmail.com‬‏>:‬

    def compile(p, flags=0):
    # internal: convert pattern list to internal format

    if (isinstance(p,str)):
    pattern = p
    p = sre_parse.parse(p, flags)
    else:
    pattern = None

    code = _code(p, flags)

    if flags & SRE_FLAG_DEBUG:
    print()
    dis(code)

    # map in either direction
    groupindex = p.state.groupdict
    indexgroup = [None] * p.state.groups
    for k, i in groupindex.items():
    indexgroup[i] = k

    return sre_compile.compile(
    pattern, flags | p.state.flags, code,
    p.state.groups-1,
    groupindex, tuple(indexgroup)
    )


    --
    <https://netanel.ml>



    --
    <https://netanel.ml>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dn@21:1/5 to All on Sun Jun 26 22:55:16 2022
    On 26/06/2022 22.48, נתי שטרן wrote:
    def compile(p, flags=0):
    # internal: convert pattern list to internal format

    if (isinstance(p,str)):
    pattern = p
    p = sre_parse.parse(p, flags)
    else:
    pattern = None

    code = _code(p, flags)

    if flags & SRE_FLAG_DEBUG:
    print()
    dis(code)

    # map in either direction
    groupindex = p.state.groupdict
    indexgroup = [None] * p.state.groups
    for k, i in groupindex.items():
    indexgroup[i] = k

    return sre_compile.compile(
    pattern, flags | p.state.flags, code,
    p.state.groups-1,
    groupindex, tuple(indexgroup)
    )


    Why would any code give a recursion error?

    With recursion problems, the first question to ask is: how does this
    thing stop?

    Have you built some test-data with only a handful of items, and thus a predictable result. Does that result occur? If not, where are the
    differences occurring?
    --
    Regards,
    =dn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Sun Jun 26 13:48:24 2022
    def compile(p, flags=0):
    # internal: convert pattern list to internal format

    if (isinstance(p,str)):
    pattern = p
    p = sre_parse.parse(p, flags)
    else:
    pattern = None

    code = _code(p, flags)

    if flags & SRE_FLAG_DEBUG:
    print()
    dis(code)

    # map in either direction
    groupindex = p.state.groupdict
    indexgroup = [None] * p.state.groups
    for k, i in groupindex.items():
    indexgroup[i] = k

    return sre_compile.compile(
    pattern, flags | p.state.flags, code,
    p.state.groups-1,
    groupindex, tuple(indexgroup)
    )


    --
    <https://netanel.ml>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Sun Jun 26 14:00:02 2022
    I FIXED THE CODE

    ‫בתאריך יום א׳, 26 ביוני 2022 ב-13:57 מאת ‪dn‬‏ <‪
    PythonList@danceswithmice.info‬‏>:‬

    On 26/06/2022 22.48, נתי שטרן wrote:
    def compile(p, flags=0):
    # internal: convert pattern list to internal format

    if (isinstance(p,str)):
    pattern = p
    p = sre_parse.parse(p, flags)
    else:
    pattern = None

    code = _code(p, flags)

    if flags & SRE_FLAG_DEBUG:
    print()
    dis(code)

    # map in either direction
    groupindex = p.state.groupdict
    indexgroup = [None] * p.state.groups
    for k, i in groupindex.items():
    indexgroup[i] = k

    return sre_compile.compile(
    pattern, flags | p.state.flags, code,
    p.state.groups-1,
    groupindex, tuple(indexgroup)
    )


    Why would any code give a recursion error?

    With recursion problems, the first question to ask is: how does this
    thing stop?

    Have you built some test-data with only a handful of items, and thus a predictable result. Does that result occur? If not, where are the
    differences occurring?
    --
    Regards,
    =dn
    --
    https://mail.python.org/mailman/listinfo/python-list



    --
    <https://netanel.ml>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dn@21:1/5 to All on Sun Jun 26 23:01:56 2022
    On 26/06/2022 23.00, נתי שטרן wrote:
    I FIXED THE CODE 

    For the benefit of future-readers: how did you go about fixing it? What
    was wrong?

    --
    Regards,
    =dn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)