You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! First of all, thank you for this wonderful package. I would just like to ask why is it everytime I run tts.save() using my remote linux server (SSH, ubuntu), it gets stuck on "sock.connect(sa)". My gTTS version is the latest one (2.2.3) and python is 3.8.
My code is very simple:
from gtts import gTTS
tts = gTTS('hello', lang='en')
tts.save('hello.mp3')
the first 2 lines work very fast but when i run "tts.save()", the wait time is too long (around 15-20 mins) and when i interrupt it, this is the error:
KeyboardInterrupt Traceback (most recent call last)
/tmp/ipykernel_3507/2063019592.py in <module>
----> 1 tts.save('hello.mp3')
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/gtts/tts.py in save(self, savefile)
311 """
312 with open(str(savefile), 'wb') as f:
--> 313 self.write_to_fp(f)
314 log.debug("Saved to %s", savefile)
315
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/gtts/tts.py in write_to_fp(self, fp)
262 with requests.Session() as s:
263 # Send request
--> 264 r = s.send(request=pr,
265 proxies=urllib.request.getproxies(),
266 verify=False)
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/requests/sessions.py in send(self, request, **kwargs)
653
654 # Send the request
--> 655 r = adapter.send(request, **kwargs)
656
657 # Total elapsed time of the request (approximately)
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
437 try:
438 if not chunked:
--> 439 resp = conn.urlopen(
440 method=request.method,
441 url=url,
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
697
698 # Make the request on the httplib connection object.
--> 699 httplib_response = self._make_request(
700 conn,
701 method,
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
380 # Trigger any extra validation we need to do.
381 try:
--> 382 self._validate_conn(conn)
383 except (SocketTimeout, BaseSSLError) as e:
384 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
1008 # Force connect early to allow us to validate the connection.
1009 if not getattr(conn, "sock", None): # AppEngine might not have `.sock`
-> 1010 conn.connect()
1011
1012 if not conn.is_verified:
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/urllib3/connection.py in connect(self)
351 def connect(self):
352 # Add certificate verification
--> 353 conn = self._new_conn()
354 hostname = self.host
355 tls_in_tls = False
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/urllib3/connection.py in _new_conn(self)
167
168 try:
--> 169 conn = connection.create_connection(
170 (self._dns_host, self.port), self.timeout, **extra_kw
171 )
~/.local/share/virtualenvs/TTS-KCkul8D_/lib/python3.8/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
84 if source_address:
85 sock.bind(source_address)
---> 86 sock.connect(sa)
87 return sock
88
KeyboardInterrupt:
Hoping to resolve this problem as I really need this for school. Thank you very much in advance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello! First of all, thank you for this wonderful package. I would just like to ask why is it everytime I run tts.save() using my remote linux server (SSH, ubuntu), it gets stuck on "sock.connect(sa)". My gTTS version is the latest one (2.2.3) and python is 3.8.
My code is very simple:
the first 2 lines work very fast but when i run "tts.save()", the wait time is too long (around 15-20 mins) and when i interrupt it, this is the error:
Hoping to resolve this problem as I really need this for school. Thank you very much in advance!
Beta Was this translation helpful? Give feedback.
All reactions