classification
Title: sftp: downloading files with % in name fails due to logging
Type: behavior Stage: resolved
Components: Versions: 3rd party
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: darugar, r.david.murray
Priority: normal Keywords:

Created on 2012-03-23 21:51 by darugar, last changed 2012-03-26 06:57 by darugar. This issue is now closed.

Messages (3)
msg156678 - (view) Author: Parand Darugar (darugar) Date: 2012-03-23 21:51
Attempting to download a file with a "%" as part of the name (eg. "test%sfile") , sftp.get fails with:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string

This appears to be because of the logging in sftp.py:

    def _log(self, level, msg, *args):
        self.logger.log(level, msg, *args)

I'm able to work around it by escaping the "%" to "%%" before calling sftp.get .
msg156794 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-26 00:54
There is no sftp module in the standard library.  Presumably you are talking about a 3rd party product and should report the bug to its developers.

If you are trying instead to report a bug in the logging module, please reopen the issue if you can provide a simple example of triggering the bug you believe exists.  (It is much more likely to be a bug in sftp.py).
msg156799 - (view) Author: Parand Darugar (darugar) Date: 2012-03-26 06:57
You're absolutely right, it's from paramiko. Apologies.
History
Date User Action Args
2012-03-26 06:57:18darugarsetmessages: + msg156799
2012-03-26 00:54:59r.david.murraysetstatus: open -> closed

versions: + 3rd party, - Python 2.7
nosy: + r.david.murray

messages: + msg156794
resolution: not a bug
stage: resolved
2012-03-23 21:51:39darugarcreate