Roundup Tracker - Issues

Message6465

Author rouilj
Recipients pokoli, rouilj
Date 2019-04-22.00:08:37
Message-id <20190422000822.149234C02C7@itserver6.localdomain>
In-reply-to <1555836824.21.0.366951058554.issue2551042@roundup.psfhosted.org>
Hello Sergi:

In message <1555836824.21.0.366951058554.issue2551042@roundup.psfhosted.org>,
Sergi Almacellas Abellana writes:
>I've cloned latest trunk, installed using python setup.py install 
>and executed: 
>
>$ roundup-admin -i test install jinja2

Which version of python 3.7 are you running?

If in the root of the checked out tree, you run python3 demo.py (as
specified in README.txt) without virtualenv, does that work or does it
generate a crash?

Also for testing purposes, what happens if from the root of the
checked out tree you run:

   mkdir example
   python3 roundup/scripts/roundup_admin.py -i example install classic

Do you still see the error? Try this both with and without virtualenv.

I can't reproduce the crash with python 3.4 using the following
command line:

   python3 ../roundup/scripts/roundup_admin -i . install jinja2

it prompts me for the database to use. No crashes.

Looking at the traceback, I expect any attempt to import rest.py would
cause this crash.  Our CI pipeline tests python 3.4 through 3.6 and
imports rest.py. I don't know of any change to regular expressions in
3.7 that would make \w (all word characters) an invalid character
class.

>Which have me the following exception:
>
>Traceback (most recent call last):
>  File "/home/pokoli/.virtualenvs/roundup/lib/python3.7/sre_parse.py",
>line 1021, in parse_template
>    this = chr(ESCAPES[this][1])
>KeyError: '\\w'

I am guesing the \\w is coming from whatever ESCAPES is doing and it
doubles the \.

>During handling of the above exception, another exception occurred:
>
>Traceback (most recent call last):
>  File "/home/pokoli/.virtualenvs/roundup/bin/roundup-admin", line 2, in
><module>
>    from roundup.scripts.roundup_admin import run
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/scripts/roundup_admin.py",
>line 40, in <module>
>    from roundup.admin import AdminTool
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/admin.py",
>line 30, in <module>
>    import roundup.instance
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/instance.py",
>line 43, in <module>
>    from roundup.cgi import client, templating
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/cgi/client.py",
>line 38, in <module>
>    from roundup import rest
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/rest.py",
>line 326, in <module>
>    class RestfulInstance(object):
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/rest.py",
>line 587, in RestfulInstance
>    @Routing.route("/data/<:class_name>", 'GET')
>  File
>"/home/pokoli/.virtualenvs/roundup/lib/python3.7/site-packages/roundup/rest.py",
>line 279, in route
>    rule = re.compile(cls.__var_to_regex.sub(cls.url_to_regex, rule))

Can you check rest.py and make sure that you have the following three
lines starting at line 244:

class Routing(object):
    __route_map = {}
    __var_to_regex = re.compile(r"<:(\w+)>")
    url_to_regex = r"([\w.\-~!$&'()*+,;=:\%%]+)"

The last line is the regexp that is causing the crash according to
the traceback.

>  File "/home/pokoli/.virtualenvs/roundup/lib/python3.7/sre_parse.py",
>line 1024, in parse_template
>    raise s.error('bad escape %s' % this, len(this))
>re.error: bad escape \w at position 2

Well \w is at position 2 of the raw string but that is supposed to be
a word character class according to the manual.

Let me know how the tests I suggested work.
History
Date User Action Args
2019-04-22 00:08:37rouiljsetrecipients: + rouilj, pokoli
2019-04-22 00:08:37rouiljlinkissue2551042 messages
2019-04-22 00:08:37rouiljcreate