1

Can anyone tell me whats wrong with this:

put(('%s%s.tar.gz' % config.SERVER_PROJECT_PATH, config.RELEASE))

TypeError: not enough arguments for format string

I just want insert two variables in to the string, is my syntax correct?

2 Answers 2

5

You need to put the two values in a tuple:

put('%s%s.tar.gz' % (config.SERVER_PROJECT_PATH, config.RELEASE))

otherwise Python sees this as two separate expressions to form a tuple, '%s%s.tar.gz' % config.SERVER_PROJECT_PATH and config.RELEASE.

Sign up to request clarification or add additional context in comments.

Comments

2

The syntax is incorrect. The string formatting arguments must be a tuple. You are creating a tuple with the formatted string and the second formatting argument. Use this instead:

put("%s%s.tar.gz" % (config.SERVER_PROJECT_PATH, config.RELEASE))

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.