lob/lob-python — pull request #27 by lucaswiman (2014-09-09 21:57:47+00:00)
Title: Expand support for file uploads

@pon In #7, @coleifer suggested a workaround for specifying files to upload that aren't local filesystem files. His workaround no longer works on the latest version of the client library.

This pull request has two changes to make specifying uploads of file objects more flexible:
- Allow the user to directly specify the `files` dictionary that gets passed to `requests.post`.
- Instead of checking if the kwargs are instances of file, check if they're file-like. In this case, that means they support `read()` and `seek()` methods.

This allows users to not have to write PDF data to the local filesystem if the PDF is generated by a library call or returned as an HTTP response from an internal-service.

I also updated the version to 2.3.1 and made the version string in `setup.py` consistent with the (outdated) version string in the `VERSION` file.

## Testing
- I ran the `tests.test_object` tests. They all pass.
- Inside a virtualenv, I ran `python setup.py install` and verified that the installed version is `lob==2.3.1`.

cc @coleifer