← Back to team overview

divmod-dev team mailing list archive

[Bug 950369] Re: Detect broken string templates that will raise ValueError when interpolated

 

I poked through the code and determined that implementing this kind of
check will be a pretty big pain in the neck.  We'd need to parse the
string to determine what kind of interpolation is required and then
verify that with the arguments to be interpolated.  ie, we'd need to
implement our own string interpolation engine.  Ew.

-- 
You received this bug notification because you are a member of Divmod-
dev, which is the registrant for Pyflakes.
https://bugs.launchpad.net/bugs/950369

Title:
  Detect broken string templates that will raise ValueError when
  interpolated

Status in Pyflakes:
  New

Bug description:
  For example, code like this will break:

    >>> "%(foo)" % {"foo": "bar"}
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: incomplete format

  It'd be awesome if Pyflakes told me about that kind of issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/950369/+subscriptions


References