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

WeekdayPositionExpression: unexpected keyword argument 'option' and 'weekday' #2

Closed
agronholm opened this issue May 10, 2010 · 0 comments

Comments

@agronholm
Copy link
Owner

Originally reported by: skokan (Bitbucket: skokan, GitHub: skokan)


The Python (2.5) report following error:
File "C:\programy.win\Python25\lib\site-packages\apscheduler\triggers.py", lin
e 35, in compile_single

#!python
    return compiler(**match.groupdict())
TypeError: __init__() got an unexpected keyword argument 'option'

Solution:
Original code with error:

#!python

class WeekdayPositionExpression(object):
    options = ['1st', '2nd', '3rd', '4th', '5th', 'last']
    value_re = re.compile(r'(?P<option>%s) +(?P<weekday>(?:\d+|\w+))'
                          % '|'.join(options), re.IGNORECASE)

Fixed line:

#!python
    value_re = re.compile(r'(?P<**option_name**>%s) +(?P<weekday_name>(?:\d+|\w+))'
                          % '|'.join(options), re.IGNORECASE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant