HTTP 401 Error: Unknown authentication scheme when using deploy tokens for tarball download

When I try to download a tarball of the repository (for an example to be specified as a dependency link in “setup.py” of the Python package) and I get an HTTP 401 error with message:

Unknown authentication scheme

user@station:~$ wget "https://gitlab%2Bdeploy-token-XXXXX:SECRET@gitlab.com/team/repo/-/archive/dev/repo-dev.tar"
--2019-04-24 10:06:09--  https://gitlab+deploy-token-XXXXX:*password*@gitlab.com/team/repo/-/archive/dev/repo-dev.tar
Resolving gitlab.com (gitlab.com)... 35.231.145.151
Connecting to gitlab.com (gitlab.com)|35.231.145.151|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Unknown authentication scheme.

Username/Password Authentication Failed.

I also found a similar question on Stack-Overflow

If deploy tokens are for repository access then why cannot we use them to get repository in a tarball form?

Edited by Ghost User