@@ -355,7 +355,7 @@ def detectLang1(option, urlOrPath, serverEndpoint=ServerEndpoint, verbose=Verbos
355355 log .exception ('Language option must be one of %s ' % binary_string (services .keys ()))
356356 raise TikaException ('Language option must be one of %s ' % binary_string (services .keys ()))
357357 service = services [option ]
358- status , response = callServer ('put' , serverEndpoint , service , open (path , 'r ' ),
358+ status , response = callServer ('put' , serverEndpoint , service , open (path , 'rb ' ),
359359 {'Accept' : responseMimeType }, verbose , tikaServerJar )
360360 return (status , response )
361361
@@ -409,7 +409,7 @@ def doTranslate1(option, urlOrPath, serverEndpoint=ServerEndpoint, verbose=Verbo
409409 service = services ["all" ] + "/" + Translator + "/" + srcLang + "/" + destLang
410410 else :
411411 service = services ["all" ] + "/" + Translator + "/" + destLang
412- status , response = callServer ('put' , serverEndpoint , service , open (path , 'r ' ),
412+ status , response = callServer ('put' , serverEndpoint , service , open (path , 'rb ' ),
413413 {'Accept' : responseMimeType },
414414 verbose , tikaServerJar )
415415 return (status , response )
@@ -451,7 +451,7 @@ def detectType1(option, urlOrPath, serverEndpoint=ServerEndpoint, verbose=Verbos
451451 log .exception ('Detect option must be one of %s' % binary_string (services .keys ()))
452452 raise TikaException ('Detect option must be one of %s' % binary_string (services .keys ()))
453453 service = services [option ]
454- status , response = callServer ('put' , serverEndpoint , service , open (path , 'r ' ),
454+ status , response = callServer ('put' , serverEndpoint , service , open (path , 'rb ' ),
455455 {
456456 'Accept' : responseMimeType ,
457457 'Content-Disposition' : make_content_disposition_header (path )
0 commit comments