I changed [distutils] to [pypirc] as per the docs and this worked for me.
Here is my ~/.pypirc file:
[pypirc]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
[pypitest]
repository=https://testpypi.python.org/pypi
[server-login]
username:stav
password:****