#747064 apt-offline: does not work with password protected apt repositories

#747064#5
Date:
2014-05-05 07:45:35 UTC
From:
To:
pabs@chianamo ~ $ apt-offline get apt-offline.txt --threads 5

Fetching APT Data

WARNING: If you are on a slow connection, it is good to
WARNING: limit the number of threads to a low number like 2.
WARNING: Else higher number of threads executed could cause
WARNING: network congestion and timeouts.

Downloading https://user:password@repo/debian/dists/wheezy/main/binary-amd64/Packages.bz2.
Downloading https://user:password@repo/debian/dists/wheezy/non-free/binary-amd64/Packages.bz2.
Downloading https://user:password@repo/debian/dists/wheezy/Release.
Downloading https://user:password@repo/debian/dists/wheezy/Release.gpg.
Downloading https://user:password@repo/debian/dists/wheezy-proposed/main/binary-amd64/Packages.bz2.
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineLib.py", line 601, in run
    self.responseQueue.put( self.WorkerFunction( item, thread_name ) )
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 798, in DataFetcher
    if DownloadPackages(url) is False and guiTerminateSignal is False:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 773, in DownloadPackages
    if FetcherInstance.download_from_web(url, file, Str_DownloadDir) == True:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 235, in download_from_web
    temp = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1153, in do_open
    h = http_class(host, timeout=req.timeout) # will parse host:port
  File "/usr/lib/python2.7/httplib.py", line 1164, in __init__
    source_address)
  File "/usr/lib/python2.7/httplib.py", line 704, in __init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
InvalidURL: nonnumeric port: 'password@repo'

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineLib.py", line 601, in run
    self.responseQueue.put( self.WorkerFunction( item, thread_name ) )
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 798, in DataFetcher
    if DownloadPackages(url) is False and guiTerminateSignal is False:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 773, in DownloadPackages
    if FetcherInstance.download_from_web(url, file, Str_DownloadDir) == True:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 235, in download_from_web
    temp = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1153, in do_open
    h = http_class(host, timeout=req.timeout) # will parse host:port
  File "/usr/lib/python2.7/httplib.py", line 1164, in __init__
    source_address)
  File "/usr/lib/python2.7/httplib.py", line 704, in __init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
InvalidURL: nonnumeric port: 'password@repo'

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineLib.py", line 601, in run
    self.responseQueue.put( self.WorkerFunction( item, thread_name ) )
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 798, in DataFetcher
    if DownloadPackages(url) is False and guiTerminateSignal is False:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 773, in DownloadPackages
    if FetcherInstance.download_from_web(url, file, Str_DownloadDir) == True:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 235, in download_from_web
    temp = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1153, in do_open
    h = http_class(host, timeout=req.timeout) # will parse host:port
  File "/usr/lib/python2.7/httplib.py", line 1164, in __init__
    source_address)
  File "/usr/lib/python2.7/httplib.py", line 704, in __init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
InvalidURL: nonnumeric port: 'password@repo'

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineLib.py", line 601, in run
    self.responseQueue.put( self.WorkerFunction( item, thread_name ) )
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 798, in DataFetcher
    if DownloadPackages(url) is False and guiTerminateSignal is False:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 773, in DownloadPackages
    if FetcherInstance.download_from_web(url, file, Str_DownloadDir) == True:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 235, in download_from_web
    temp = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1153, in do_open
    h = http_class(host, timeout=req.timeout) # will parse host:port
  File "/usr/lib/python2.7/httplib.py", line 1164, in __init__
    source_address)
  File "/usr/lib/python2.7/httplib.py", line 704, in __init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
InvalidURL: nonnumeric port: 'password@repo'

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineLib.py", line 601, in run
    self.responseQueue.put( self.WorkerFunction( item, thread_name ) )
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 798, in DataFetcher
    if DownloadPackages(url) is False and guiTerminateSignal is False:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 773, in DownloadPackages
    if FetcherInstance.download_from_web(url, file, Str_DownloadDir) == True:
  File "/usr/lib/python2.7/dist-packages/apt_offline_core/AptOfflineCoreLib.py", line 235, in download_from_web
    temp = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1153, in do_open
    h = http_class(host, timeout=req.timeout) # will parse host:port
  File "/usr/lib/python2.7/httplib.py", line 1164, in __init__
    source_address)
  File "/usr/lib/python2.7/httplib.py", line 704, in __init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
InvalidURL: nonnumeric port: 'password@repo'


Downloaded data to /tmp/user/1000/apt-offline-downloads-999

#747064#10
Date:
2014-05-05 17:18:01 UTC
From:
To:
Control: tag  -1 wishlist

Thank you for the bug report. Yes. that's a feature I'll implement some
time.

#747064#15
Date:
2015-11-20 07:36:31 UTC
From:
To:
Hi pabs,

Just a background on why I wrote this mail:

I'm working on refactoring the apt-offline and making it compatible
with python3. My work is currently available here [1]. I'm currently
working on get subcommand and was looking at bts to see for any bugs
in current get subcommand. I stumbled across your bug and needed some
more information from you.

So the password protected apt repo's you mentioned, are they using
basic or digest authentication?. Is it desirable to have the user
specify authentication mechanism from command line switch?.

Also feel free to poke with new branch of apt-offline :-). At the
moment set command is correctly working.

Best Regards

[1] https://github.com/copyninja/apt-offline/tree/py3-port

#747064#20
Date:
2015-11-20 08:16:02 UTC
From:
To:
Looks like basic currently.

Would be better if it could choose automatically.