Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 655856

Summary: urlgrabber does not raise an exception for non-existent files (using ftp protocol)
Product: Red Hat Enterprise Linux 5 Reporter: Petr Šplíchal <psplicha>
Component: python-urlgrabberAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: low    
Version: 5.6CC: jzeleny, ohudlick, psplicha
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-02 13:04:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
work around a bug in urllib's ftpwrapper. none

Description Petr Šplíchal 2010-11-22 14:45:30 UTC
Description of problem:

Trying to fetch a non-existent file using python urlgrabber module
results in a silent pass although no files are actually fetched.

Version-Release number of selected component (if applicable):
python-urlgrabber-3.1.0-6.el5

Steps to Reproduce:
# python -c 'import urlgrabber; urlgrabber.urlgrab("ftp://ftp.redhat.com/redhat/missing.txt", "missing.txt")'
  
Actual results:
# echo $?
0
# cat missing.txt
<nothing>

Expected results:
An exception raised, "Not Found" or similar error message
displayed.

Additional info:
Works as expected when using httpd protocol.

Comment 1 RHEL Program Management 2011-05-31 14:32:10 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Program Management 2011-09-23 00:33:41 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2013-05-01 06:55:35 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 4 Zdeněk Pavlas 2013-12-18 15:38:19 UTC
Reproduced.  Indeed, this is a serious bug that should be fixed.

Comment 5 Zdeněk Pavlas 2013-12-18 17:16:44 UTC
It's a bug in Python's urllib.py module, but we can very likely work this around in urlgrabber.

Comment 6 Zdeněk Pavlas 2013-12-18 17:21:10 UTC
Created attachment 838481 [details]
work around a bug in urllib's ftpwrapper.

For some reasons, ftpwrapper first checks if file exists with ftp NLST command, then downloads with RETR, ignoring 550 file not found errors. But since ftp.nlst () just returns an empty list instead of raising an exception, the error is ignored.  The missing content-length seems to be a reliable inidicator that the file was not found, so we may use it to work this around in urlgrabber.

Comment 9 RHEL Program Management 2014-02-25 00:18:30 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 10 RHEL Program Management 2014-03-07 12:40:51 UTC
This bug/component is not included in scope for RHEL-5.11.0 which is the last RHEL5 minor release. This Bugzilla will soon be CLOSED as WONTFIX (at the end of RHEL5.11 development phase (Apr 22, 2014)). Please contact your account manager or support representative in case you need to escalate this bug.

Comment 11 RHEL Program Management 2014-06-02 13:04:08 UTC
Thank you for submitting this request for inclusion in Red Hat Enterprise Linux 5. We've carefully evaluated the request, but are unable to include it in RHEL5 stream. If the issue is critical for your business, please provide additional business justification through the appropriate support channels (https://access.redhat.com/site/support).