praw-dev/praw — pull request #154 by Damgaard (2013-01-08 09:27:47+00:00)
Title: Fix OS-dependent error in upload_image.

Some operation systems, such as windows, treat binary and text files
differently. For them opening an image with 'r' and not 'rb' would
cause the cryptic ClientException '`image` is not a valid image'.
The same would also be true if the mode was some varient of 'w'
irrespective of OS.

Also, the old `white-square` file was a copy of the `invalid` file not `white-square.jpg`, which caused `test_jpg_no_extension` to fail for the minimum size requirement.