My goal is to receive an audio file from client and transcribe it to text without permanently saving to disk. I'm using SpeechRecognition library and it works perfectly if uploaded file is saved, but when i try to use temporary file it leads to error.
From CherryPy docs:
When a client uploads a file to a CherryPy application, it’s placed on disk immediately. CherryPy will pass it to your exposed method as an argument; that arg will have a “file” attribute, which is a handle to the temporary uploaded file
Since the sr.AudioFile constructor also accepts a 'file-like object', i'm using io.BytesIO to pass the content of temporary file to constructor.
Here's the code of my server:
import io
import cherrypy
import speech_recognition as sr
class HttpServer(object):
#cherrypy.expose
def index(self, ufile):
ufile_content = ufile.file.read() # reading temp file
buffer = io.BytesIO(ufile_content)
buffer.seek(0)
with sr.AudioFile(buffer) as source:
audio = self.recognizer.record(source)
result = self.recognizer.recognize_google(audio, language='ru-RU')
I'm using this code to send request to the server:
import requests
url = 'http://localhost:8080/'
files = {'ufile': ('audio.flac', open('audio.flac', 'rb'), 'audio/flac')}
r = requests.post(url, files=files)
I get the following error:
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\speech_recognition\__init__.py", line 203, in __enter__
self.audio_reader = wave.open(self.filename_or_fileobject, "rb")
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\wave.py", line 510, in open
return Wave_read(f)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\wave.py", line 164, in __init__
self.initfp(f)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\wave.py", line 131, in initfp
raise Error('file does not start with RIFF id')
wave.Error: file does not start with RIFF id
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\speech_recognition\__init__.py", line 208, in __enter__
self.audio_reader = aifc.open(self.filename_or_fileobject, "rb")
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\aifc.py", line 917, in open
return Aifc_read(f)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\aifc.py", line 358, in __init__
self.initfp(f)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\aifc.py", line 316, in initfp
raise Error('file does not start with FORM id')
aifc.Error: file does not start with FORM id
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\speech_recognition\__init__.py", line 234, in __enter__
self.audio_reader = aifc.open(aiff_file, "rb")
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\aifc.py", line 917, in open
return Aifc_read(f)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\aifc.py", line 358, in __init__
self.initfp(f)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\aifc.py", line 314, in initfp
chunk = Chunk(file)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\chunk.py", line 63, in __init__
raise EOFError
EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\cherrypy\_cprequest.py", line 628, in respond
self._do_respond(path_info)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\cherrypy\_cprequest.py", line 687, in _do_respond
response.body = self.handler()
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\cherrypy\lib\encoding.py", line 219, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__
return self.callable(*self.args, **self.kwargs)
File "new1.py", line 19, in index
with audio_file as source:
File "C:\Users\Артём\AppData\Local\Programs\Python\Python37\lib\site-packages\speech_recognition\__init__.py", line 236, in __enter__
raise ValueError("Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format")
ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format
Does anyone have any solutions to the problem?
Related
The Code:
import speech_recognition as sr
file_name = "tts.wav"
speech_engine = sr.Recognizer()
def from_file(file_name):
with sr.AudioFile(file_name) as f:
data = speech_engine.record(f)
text = speech_engine.recognize_google(data, language="de-DE")
return text
def from_microphone():
with sr.Microphone() as micro:
print("Recording...")
audio = speech_engine.record(micro, duration=5)
print("Recognition...")
text = speech_engine.recognize_google(audio, language="de-DE")
return text
from_file(file_name)
print(from_microphone())
Terminal:
PS C:\Users\schne\Desktop\Jarvis> &
C:/Users/schne/AppData/Local/Microsoft/WindowsApps/python3.10.exe
"c:/Users/schne/Desktop/Jarvis/speech to text copy.py" Traceback (most
recent call last): File
"C:\Users\schne\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\speech_recognition_init_.py",
line 253, in enter
self.audio_reader = wave.open(self.filename_or_fileobject, "rb") File "C:\Program
Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\wave.py",
line 509, in open
return Wave_read(f) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\wave.py",
line 163, in init
self.initfp(f) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\wave.py",
line 130, in initfp
raise Error('file does not start with RIFF id') wave.Error: file does not start with RIFF id
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\schne\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\speech_recognition_init_.py",
line 258, in enter
self.audio_reader = aifc.open(self.filename_or_fileobject, "rb") File "C:\Program
Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\aifc.py",
line 917, in open
return Aifc_read(f) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\aifc.py",
line 352, in init
self.initfp(file_object) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\aifc.py",
line 316, in initfp
raise Error('file does not start with FORM id') aifc.Error: file does not start with FORM id
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\schne\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\speech_recognition_init_.py",
line 284, in enter
self.audio_reader = aifc.open(aiff_file, "rb") File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\aifc.py",
line 917, in open
return Aifc_read(f) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\aifc.py",
line 358, in init
self.initfp(f) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\aifc.py",
line 314, in initfp
chunk = Chunk(file) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\chunk.py",
line 63, in init
raise EOFError EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"c:\Users\schne\Desktop\Jarvis\speech to text copy.py", line 17, in
from_file(file_name) File "c:\Users\schne\Desktop\Jarvis\speech to text copy.py", line 5, in from_file
with sr.AudioFile(file_name) as f: File "C:\Users\schne\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\speech_recognition_init_.py",
line 286, in enter
raise ValueError("Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another
format") ValueError: Audio file could not be read as PCM WAV,
AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another
format
The program should recognize text from a file or directly from the microphone, but the terminal does not recognize it or something (I'm a beginner).
I have problem to download files from my private chat.
I've added a bot as administrator to my private chat. To upload on telegram with a python script I have no problems, for example I use successfully this code
import os
import telegram
# Enter your bot's token here
TOKEN = "58819**********************....."
# Enter your private chat ID here
CHAT_ID = -100****...
# Enter the path to the document here
DOCUMENT_PATH = "C:\\temp\\telegram\\snow.epub"
# Create a Bot object using the token
bot = telegram.Bot(token=TOKEN)
# Open the document in binary mode
with open(DOCUMENT_PATH, "rb") as f:
# Send the document to the specified chat
bot.send_document(chat_id=CHAT_ID, document=f)
print("Document sent successfully!")
Problem is download this file (an epub file) from my private chat
i try with this code but nothing happens, powershell returns me this message
PS C:\temp\telegram> python scaricare2.py
The last sent message is not a document.
I test with this code
import os
import os.path
import telegram
# Enter your bot's token here
TOKEN = "588199*****************..."
# Enter your private chat ID here
CHAT_ID = -1001******...
# Create a Bot object using the token
bot = telegram.Bot(token=TOKEN)
# Download the latest file sent in the chat
updates = bot.get_updates(offset=-1, limit=1)
if updates:
# Checks if the Message object contains a document attribute
if hasattr(updates[0].message, "document"):
file_id = updates[0].message.document.file_id
else:
print("The last sent message is not a document.")
exit()
file_info = bot.get_file(file_id)
file = bot.download_file(file_info.file_path)
# Create the path to the directory where to save the file
download_path = "C:/temp/telegram/filexx/"
# Create the full path to the file using the file name
file_path = os.path.join(download_path, file_info.file_name)
# Open the file in binary write mode
with open(file_path, "wb") as f:
# Write the contents of the file to the specified path
f.write(file)
print("File downloaded successfully!")
else:
print("The last sent message is not a document.")
Any idea to solve ?
Download from bot returns this error
PS C:\temp\telegram> python scaricare2.py
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 402, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 398, in _make_request
httplib_response = conn.getresponse()
File "C:\Program Files\Python310\lib\http\client.py", line 1374, in getresponse
response.begin()
File "C:\Program Files\Python310\lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
File "C:\Program Files\Python310\lib\http\client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Program Files\Python310\lib\socket.py", line 705, in readinto
return self._sock.recv_into(b)
File "C:\Program Files\Python310\lib\ssl.py", line 1273, in recv_into
return self.read(nbytes, buffer)
File "C:\Program Files\Python310\lib\ssl.py", line 1129, in read
return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\telegram\utils\request.py", line 259, in _request_wrapper
resp = self._con_pool.request(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\request.py", line 68, in request
return self.request_encode_body(method, url, fields=fields,
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\request.py", line 148, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\poolmanager.py", line 244, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 665, in urlopen
retries = retries.increment(method, url, error=e, _pool=self,
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\util\retry.py", line 347, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\packages\six.py", line 686, in reraise
raise value
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 614, in urlopen
httplib_response = self._make_request(conn, method, url,
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 404, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout,
File "C:\Program Files\Python310\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 321, in _raise_timeout
raise exc_cls(*args)
telegram.vendor.ptb_urllib3.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=5.0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\temp\telegram\scaricare2.py", line 24, in <module>
file_info = bot.get_file(file_id)
File "C:\Program Files\Python310\lib\site-packages\telegram\bot.py", line 134, in decorator
result = func(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\telegram\bot.py", line 2510, in get_file
result = self._post('getFile', data, timeout=timeout, api_kwargs=api_kwargs)
File "C:\Program Files\Python310\lib\site-packages\telegram\bot.py", line 299, in _post
return self.request.post(
File "C:\Program Files\Python310\lib\site-packages\telegram\utils\request.py", line 361, in post
result = self._request_wrapper(
File "C:\Program Files\Python310\lib\site-packages\telegram\utils\request.py", line 261, in _request_wrapper
raise TimedOut() from error
telegram.error.TimedOut: Timed out
I write a little program which writes the audio to text. But it throws an error and I don't know how to fix it.
import speech_recognition as sr
file_name = "halloWelt.wav"
speech_engine = sr.Recognizer()
with sr.AudioFile(file_name) as file:
data = speech_engine.record()
text = speech_engine.recognize_google(data, language='de-DE')
print(text)
The error:
Traceback (most recent call last):
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\speech_recognition\__init__.py", line 203, in __enter__
self.audio_reader = wave.open(self.filename_or_fileobject, "rb")
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\wave.py", line 509, in open
return Wave_read(f)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\wave.py", line 163, in __init__
self.initfp(f)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\wave.py", line 130, in initfp
raise Error('file does not start with RIFF id')
wave.Error: file does not start with RIFF id
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\speech_recognition\__init__.py", line 208, in __enter__
self.audio_reader = aifc.open(self.filename_or_fileobject, "rb")
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\aifc.py", line 917, in open
return Aifc_read(f)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\aifc.py", line 352, in __init__
self.initfp(file_object)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\aifc.py", line 316, in initfp
raise Error('file does not start with FORM id')
aifc.Error: file does not start with FORM id
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\speech_recognition\__init__.py", line 234, in __enter__
self.audio_reader = aifc.open(aiff_file, "rb")
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\aifc.py", line 917, in open
return Aifc_read(f)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\aifc.py", line 358, in __init__
self.initfp(f)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\aifc.py", line 314, in initfp
chunk = Chunk(file)
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\chunk.py", line 63, in __init__
raise EOFError
EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\\OneDrive\Dokumente\Programming\Python\Lets code\speech.py", line 6, in <module>
with sr.AudioFile(file_name) as file:
File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\speech_recognition\__init__.py", line 236, in __enter__
raise ValueError("Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format")
ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format
I'm trying to read a big json file (>1,5Gb), using ijson package and deal with the results.
response = requests.get("https://api.scryfall.com/bulk-data/all-cards")
with urlopen(response.json()["download_uri"]) as all_cards:
for card_object in ijson.items(all_cards, "item"):
do_something_with(card_object)
However each time I run this I get the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 555, in _get_chunk_left
chunk_left = self._read_next_chunk_size()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 522, in _read_next_chunk_size
return int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 587, in _readinto_chunked
chunk_left = self._get_chunk_left()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 557, in _get_chunk_left
raise IncompleteRead(b'')
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/benjamin/PycharmProjects/octavin/venv/bin/flask", line 8, in <module>
sys.exit(main())
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/flask/cli.py", line 985, in main
cli.main()
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/flask/cli.py", line 579, in main
return super().main(*args, **kwargs)
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/flask/cli.py", line 427, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/Users/benjamin/PycharmProjects/octavin/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/benjamin/PycharmProjects/octavin/app/cli.py", line 65, in update
for card_object in ijson.items(all_cards, "item"):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 492, in readinto
return self._readinto_chunked(b)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 603, in _readinto_chunked
raise IncompleteRead(bytes(b[0:total_bytes]))
http.client.IncompleteRead: IncompleteRead(64016 bytes read)
Is that because of any timeout, or because the file's too big? Or anything else?
Note that this is working (all-cards-20220408091307.json being the locally downloaded file):
with open("all-cards-20220408091307.json") as all_cards:
for card_object in ijson.items(all_cards, "item"):
do_something_with(card_object)
This seems to be a problem with http.client's HTTPResponse when reading data from a response with chunked encoding: https://bugs.python.org/issue39371.
Since you're already using requests I'd suggest you use that to perform your second request and avoid this issue altogether. requests's response object has an iter_content method that can be used to incrementally read binary data from the incoming stream. ijson on the other hand expects a file-like object. To bridge the gap you can use a solution similar to the one suggested here: https://github.com/ICRAR/ijson/issues/58#issuecomment-917655522; otherwise you can use ijson's push mechanism, where you do the reading and hand over the data chunks to ijson (which is a bit more complex, see ijson's documentation documentation for more details).
I am using boto for uploading and downloading data from S3 bucket. I first check for key presence and then call download to file api of boto as follows.
#retry_decorator
def _get_data_to_file(self, src_key_object, file_name):
try:
s_key.get_contents_to_filename(file_name)
except Exception, fault:
logger.traceback(fault)
raise
retry_decorator is decorator functions which helps to retry the operation if call fails. I observed following error in my traceback.
[2016-02-02 10:23:09,427] [ERROR] Error <class 'socket.error'>:[Errno 104] Connection reset by peer. Traceback -Traceback (most recent call last):
File "roboClientLib/boto/awsDRLib.py", line 1173, in _get_data_to_file
File "boto/s3/key.py", line 1712, in get_contents_to_filename
File "boto/s3/key.py", line 1650, in get_contents_to_file
File "boto/s3/key.py", line 1482, in get_file
File "boto/s3/key.py", line 1535, in _get_file_internal
File "boto/s3/key.py", line 386, in next
File "boto/connection.py", line 413, in read
File "httplib.py", line 542, in read
File "socket.py", line 377, in read
File "ssl.py", line 215, in recv
File "ssl.py", line 136, in read
error: [Errno 104] Connection reset by peer
[2016-02-02 10:23:39,459] [ERROR] Error <class 'httplib.IncompleteRead'>:IncompleteRead(0 bytes read, 112795648 more expected). Traceback -Traceback (most recent call last):
File "roboClientLib/boto/awsDRLib.py", line 1173, in _get_data_to_file
File "boto/s3/key.py", line 1712, in get_contents_to_filename
File "boto/s3/key.py", line 1650, in get_contents_to_file
File "boto/s3/key.py", line 1482, in get_file
File "boto/s3/key.py", line 1535, in _get_file_internal
File "boto/s3/key.py", line 388, in next
File "boto/s3/key.py", line 370, in close
File "boto/connection.py", line 410, in read
File "httplib.py", line 529, in read
File "httplib.py", line 621, in _safe_read
IncompleteRead: IncompleteRead(0 bytes read, 112795648 more expected)
and similar error continue for further retry. What i observed is first traceback show socket error while subsequent traceback of same call show something else..
Can anybody help to understand why i am able to execute the call after retry..?