-
Notifications
You must be signed in to change notification settings - Fork 86
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
list_format parameters %s and %k broken #278
Comments
I could not reproduce that bug at Cygwin (Python 3.8) under Win7 nor on Linux (Fedora 33 with Python 3.9). It may be some windows-specific issue. Can You post full error output? |
|
The error message is the same for both I changed the line as you suggested, and yes, it is an
Or with "%k":
One other oddity: if I replace the line you mentioned with (This is Python 3.9.0, and the HEAD of topydo, reported version 0.14). |
I'm starting to think that the problem is in one or more of your tasks. Are there any diff --git a/topydo/lib/ListFormat.py b/topydo/lib/ListFormat.py
index 8b990f0..8c6ca9f 100644
--- a/topydo/lib/ListFormat.py
+++ b/topydo/lib/ListFormat.py
@@ -221,6 +221,8 @@ class ListFormatParser(object):
'z': lambda t: color_block(t) if config().colors() else ' ',
}
self.format_list = self._preprocess_format()
+ with open('re-error-dbg.txt', 'w') as f:
+ f.write(str(self.format_list) + '\n')
def _preprocess_format(self):
"""
@@ -276,6 +278,8 @@ class ListFormatParser(object):
"""
parsed_list = []
repl_trunc = None
+ with open('re-error-dbg.txt', 'a') as f:
+ f.write(str(p_todo.source()) + '\n')
for substr, placeholder, getter in self.format_list:
repl = getter(p_todo) if getter else '' Then please post You can also send your todo.txt to me and I'll do my best to hunt this issue :) |
Yes, there are I tired the changes you mentioned, and I think these are the two lines (of interest) from the log file:
and
|
I can replicate Yet I can't reproduce |
It seems to break on the same line. Here's the traceback:
|
Alright. Try that branch from my repo. It fixes aforementioned bug with looking for tags inside quotes and escapes backslashes if needed. If this will be sufficient resolution I would suggest to fix it this way in proper PR next week. |
It's still error-ing out on your new branch, although a new one this time. I tried adding back in your debugging patch from above, but it's not creating the log file this time.
|
The I'll try to address that this week. |
Ok, try to update my branch. It shouldn't crash anymore. |
It works! Thank you, good sir, in tracking that down and fixing it! On thing I note is that it highlights the path (at least until the first space) as if it were a tag. Without a whitelist of tags, there's probably no way around that, and it doesn't bother me. |
Yep. I see it too. Maybe we can test if strings destined to be coloured are actually in This branch grows thicker and thicker. I would love any feedback from someone smarter than me before posting it as a PR. @bram85, can You take a quick look at the code? |
When I run:
topydo ls -F "%s"
ortopydo ls -F "%k"
it returnsError while parsing format string (list_format config option or -F)
However, when combined with
-N
, both work (i.e.topydo ls -F "%s" -N
)Windows 10, topydo version 0.13 and HEAD, Python 3.7 and 3.9.
This used to work (it's in my config file from a long time ago).
"%s" is particularly annoying, as that's the "text" of the todo item.
The text was updated successfully, but these errors were encountered: