Skip to content
Advertisement

Don’t understand this ConfigParser.InterpolationSyntaxError

So I have tried to write a small config file for my script, which should specify an IP address, a port and a URL which should be created via interpolation using the former two variables. My config.ini looks like this:

JavaScript

In my script I parse this config file as follows:

JavaScript

If I run my script, this results in:

JavaScript

I have tried debugging, which resulted in giving me one more line of error code:

JavaScript

Here I am stuck. I don’t know where this _remove function is supposed to be… I tried searching for what the message is supposed to tell me, but quite frankly I have no idea. So…

  1. Is there something wrong with my code?
  2. What does ‘< function _remove at … >’ mean?

Advertisement

Answer

There was indeed a mistake in my config.ini file. I did not regard the s at the end of %(...)s as a necessary syntax element. I suppose it refers to “string” but I couldn’t really confirm this.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement