| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
http://urlgrabber.baseurl.org/ doesnt link to the current SCM
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Type errors would prevent TextMeter from being used as a
progess_option.
This commit fixes this with a type cast and an initialization of
a variable as int.
Fixes #24
|
|
|
|
|
|
|
| |
ftplib.parse150() expects a string, we need to decode the bytes before
passing them to the function in Python 3.
https://bugzilla.redhat.com/show_bug.cgi?id=1734527
|
| |
|
| |
|
|
|
|
|
|
| |
This module has been in use with YUM for well over a decade, and
the API has not changed much in the last few years. At this point,
most people would consider it production-grade.
|
|
|
|
|
|
| |
This rework removes the cyclic dependency on the urlgrabber code to
install urlgrabber, while still supporting the propagation of setuptools
properties into the module.
|
| |
|
| |
|
|
|
|
| |
With Python3 the internal dict has been renamed to _levelToName.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we would reset the file upon seeing "200" in the response
header. This is, however, easily fooled by the HTTP CONNECT method used
to access an SSL server on behalf of a proxy (a common setting would be
a company intranet behind a proxy server where an internal system is
consuming Red Hat CDN repos with yum). The reason is that, in this
protocol, there are two subsequent headers sent, the first of which is:
"HTTP/1.1 200 Connection established".
Therefore, we need to explicitly check for "200 OK".
More details:
https://tools.ietf.org/html/rfc7231#section-4.3.6
Kudos to Masahiro Matsuya for suggesting this patch!
Note: As an alternative solution, it seems that setting the
CURLOPT_SUPPRESS_CONNECT_HEADERS option on the curl handle would also do
the trick (but that would require more scrutiny to ensure that nothing
else breaks):
https://curl.haxx.se/libcurl/c/CURLOPT_SUPPRESS_CONNECT_HEADERS.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We need to convert the parsed url back into bytes before passing it to
the PyCurlFileObject constructor (since _set_opts() expects self.scheme,
constructed from the url, to be a bytes object).
This caused the unit test "bypassing proxy cache on failure" to fail
(together with a bug in the test itself which is also being fixed here).
Closes #14.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit be8ee10e35319e80200d4ff384434d46fe7783d9.
A list of dicts (as opposed to strings) is valid input as well; see the
module-level doc string for details (section 2 under CUSTOMIZATION). In
fact, the nested estimate() function in MirrorGroup.__init__() accounts
for that, too.
This fixes a traceback in YUM which does pass such a dict list.
Closes #10.
|
|
|
|
|
|
|
| |
Expect that _readlines() returns array of bytes objects in
Python 3 environments.
Fixes rhbz #1707657 and #1688173
|
|
|
|
|
|
|
|
|
|
| |
urlgrabber was relicensed to LGPLv2+ a long time ago, and this file
seemed to have only a partially updated license header for this.
It references the GNU Library General Public License, so clearly
the intent was the header was supposed to be fully updated for it,
so let's just do that by switching to the header used in the other
source files.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Python3 compatibility
|
| |
| |
| |
| | |
2 is the standard code for "command line usage error".
|
| |
| |
| |
| | |
When the expression is already in parentheses, the backslash has no effect.
|
| |
| |
| |
| |
| | |
We know what the types of basic types are, let's just put that directly in the code.
It seems more idiomatic and slightly more efficient to do things this way.
|
| |
| |
| |
| | |
Just a cleanup.
|
| |
| |
| |
| | |
This just updates unittest method names.
|
| | |
|
| |
| |
| |
| |
| | |
Bare except: is never nice. Also, let's put the try..except block around
only the urlgrab() call.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Under python3, the variable defined in "except ... as ..." is only
valid until the end of the block. In this case it would undefine the
variable that was defined above, not reassign it as under python2,
leading to the following tb:
Traceback (most recent call last):
File "test/test_mirror.py", line 379, in test_retry_no_cache
urlgrabber.grabber.parallel_wait()
File "test/../urlgrabber/grabber.py", line 2374, in parallel_wait
perform()
File "test/../urlgrabber/grabber.py", line 2313, in perform
if ug_err is None:
UnboundLocalError: local variable 'ug_err' referenced before assignment
|
| |
| |
| |
| |
| | |
s.endswith('x') works properly with bytes. s[-1] == 'x' doesn't, because
s[-1] returns an integer. But .endswith() is clearer anyway, so that's OK.
|
| |
| |
| |
| |
| | |
The URLs under http://urlgrabber.baseurl.org/ are all broken. Let's switch
until they are fixed.
|
| |
| |
| |
| |
| | |
There isn't much point in defining a nested function which doesn't use
its closure for anything. Also doing it just once is generally quicker.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Otherwise, the tests try to call the installed executable, which
might be stale or not exist at all.
I now run the tests with:
URLGRABBER_EXT_DOWN=scripts/urlgrabber-ext-down PYTHONPATH=. python2 test/runtests.py
URLGRABBER_EXT_DOWN=scripts/urlgrabber-ext-down PYTHONPATH=. python3 test/runtests.py
|
| |
| |
| |
| | |
numbers existed already in 2.6.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I guess those files are not supposed to be there, because otherwise
the test don't get the exception they expect. The test is updated
to expect 404, not 403, because the file is simply missing. It would
be possible to change the server configuration to return 403, but
this doesn't seem particularly important for this test. So let's just
ask for a file that doesn't exist and expect 404.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The tests were fairly consistently failing with:
error: [Errno 98] Address already in use
Actually the port is a well-known port that could be used be some other
program. So let's simplify things by opening a random port.
It'd be nice to use the socket as a context manager, but unfortunately
python2 does not support that.
|
| |
| |
| |
| |
| |
| | |
IIUC, those tests called urlgrab or urlread with a valid address
or a file name and expected it to fail. Let's call it with a URL
that return 404 instead. Now the tests pass.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the patch that has the most potential for trouble in the whole
series, because it affects python2 behaviour directly.
io.BytesIO is the same as StringIO under python2, so this should have
no effect on python2. Under python3 it is necessary to allow reading
bytes from a byte data source.
Under python2, encoding of an already encoding string is allowed, and
actually works fine (is idempotent) for ASCII strings. So the effect
of the .encode() calls under python2 should be limited. Under python3,
they are of course necessary and can only be done once. So if there
are errors here, they should show up when running under python3 pretty
easily.
|
| | |
|
| | |
|