question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pypi.org is not accessible from Iran

See original GitHub issue

Environment

  • pip version: 18.1
  • Python version: 3.7.2
  • OS: Archlinux

Description

I’m not sure if it’s something that fits in here, but I just noticed pypi.org is not accessible for some of Iranian users Tried the a search command with Tor and it worked pretty well, I can ping pypi.org, it replies the ping, but I can’t access the website

Expected behavior

Pip show me a list of results

How to Reproduce

  1. Use one of Iranian’s ISPs without VPN, Proxy and --proxy flag
  2. Run pip search graphics # or every other package
  3. An error occurs.

Output

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 453, in wrap_socket
    cnx.do_handshake()
  File "/usr/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1915, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1622, in _raise_ssl_error
    raise WantReadError()
OpenSSL.SSL.WantReadError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/usr/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 456, in wrap_socket
    raise timeout('select timed out')
socket.timeout: select timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3.7/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 306, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/lib/python3.7/site-packages/pip/_internal/commands/search.py", line 48, in run
    pypi_hits = self.search(query, options)
  File "/usr/lib/python3.7/site-packages/pip/_internal/commands/search.py", line 65, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/usr/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.7/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/usr/lib/python3.7/site-packages/pip/_internal/download.py", line 788, in request
    headers=headers, stream=True)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3.7/site-packages/pip/_internal/download.py", line 396, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.7/site-packages/cachecontrol/adapter.py", line 53, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:6

github_iconTop GitHub Comments

3reactions
DarkSuniuMcommented, Mar 19, 2019

Pypi.org is not accessible in Iran for sure, I’m curious is it because of sanctions or it’s something that Iranian government did

0reactions
lock[bot]commented, May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

django-iranian-cities - PyPI
The django-iranian-cities is a valuable package based on Django Web Framework for Iranian cities support. You can see full documentation here ...
Read more >
PyPI maintainers warn of ongoing phishing attack
The maintainers of the Python Package Index (PyPI) have warned of an ... We're also working to provide security features like 2FA more ......
Read more >
Pypi.org blocked from command prompt Windows. Pip install ...
But this is not available for this package: https://pypi.org/project/jupyter-lsp/#files. Any alternatives to install the package?
Read more >
Python team fixes bug that allowed takeover of PyPI repository
The Record by Recorded Future gives exclusive, behind-the-scenes access to leaders, policymakers, researchers, and the shadows of the cyber ...
Read more >
Cleft Palate in Newborns Diagnosed With Prematurity - Jennifer N ...
The incidence of isolated cleft palate is not influenced by race/ethnicity, whereas cleft lip with or without cleft palate occurs at different rates ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found