watson-developer-cloud / python-sdk

:snake: Client library to use the IBM Watson services in Python and available in pip as watson-developer-cloud
https://pypi.org/project/ibm-watson/
Apache License 2.0
1.46k stars 827 forks source link

The Python Watson SDK attempts its own media type detection when the user provides a file, and it should not #254

Closed ry0ohki closed 7 years ago

ry0ohki commented 7 years ago

If a user provides a file, but doesn't specify the media type, when adding a document to Discovery using the Python Watson SDK, then Python attempts to auto-detect the media type. However, Discovery itself is capable of determining the media type, and arguably, it has a robust algorithm to do so. As such, the Python SDK should not attempt to do this on its own. Instead, it should default the media type to application/octet-stream which ensures that Discovery's media type detection will be used.

jsstylos commented 7 years ago

Good idea, should be fixed in b0904e723e220d38dda62b173ebb7bb771212ffb