-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Don't know if this is the same issue, but there is also a false-positive if the format string is an f-string.
For example:
from datetime import datetime
def parse_iso(iso_str,millis=True):
return datetime.strptime(iso_str, f"%Y-%m-%dT%H:%M:%S{('.%f' if millis else '')}%z")Even without a condition inside the f-string, it immediately triggers the lint error.
For example:
from datetime import datetime
dt = datetime.strptime("","%Y-%m-%d %H:%M:%S%z") # everything okay
dt = datetime.strptime("", f"%Y-%m-%d %H:%M:%S%z") # throws DTZ007Originally posted by @jonas-w in #1306 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule