-
Notifications
You must be signed in to change notification settings - Fork 107
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
testMonths fails #54
Comments
Whether the test succeeds depends on
but with The result (as expected) doesn't depend on the PyICU version installed. I've tried with 1.5 and 1.8. |
testMonths continues to fail on the earliest parsedatetime version that I can run 7c5e6a0 |
Can confirm this issue. I'm seeing strings like Edit: Just checked out the HEAD. I'm seeing the exact same behaviour as zed describes. |
The output of This is supported by comparing the output of
So, it appears that the parser is incorrectly parsing the "1" as a minute quantity with a positive offset. |
Ok, I turned on lots of logging. Interesting results:
So it looks like, /sometimes only/, the "m" is being interpreted as the prefix for "minutes", rather then as part of the value "months". It always happens in the parse 3 stage. |
Ok, I've figured out where the issue is. Basically, it appears that the ordering of the contents of When the literal I think the solution here would be to add a word boundary match to the In other words:
Becomes
Note that I had to add an additional set of parenthesis, because as it is, The boundary grouping issue is also occuring in the
(with |
Actually, considering some of the comments, I think the core of the issue might be the values of
|
Ok, so the root of the issue is that single-character duration labels are getting into I filtered them out: (line 2226... in
And it fixes the issue initially described. I still see periodic failures in the Sorry if this thread has gotten a bit long. This is an interesting problem, and it's affecting a project I'm working on, so I've been poking at it. |
Ok, the fix as I described above fixes the month parsing issue, but breaks a number of the other tests, primarily those using the single-char time notation. I suspect what it's actually doing is preventing the |
Note: |
Let me know if either of you would like to be added as contributors - your both actively using and fixing bugs. |
I'd be willing to spend some time trying to make the regex stuff more concise. Particularly, is the use of named The .format() method was added in python 2.6. Is < 2.6 still a support target? |
< 2.6 is not longer supported in the main branch - 2.7+ and 3.0 are it's goals |
Ok, cool. The .format() method was introduced in 2.6 anyways, so it's a bit of a moot point. |
The text was updated successfully, but these errors were encountered: