Changeset 873:4f4a4541b97a
- Timestamp:
- 2010-06-17 11:49:11 (6 weeks ago)
- Author:
- Stefan Schwarzer <sschwarzer@…>
- Branch:
- default
- Message:
-
Handle status code 150 for an incomplete transfer (see ticket #51).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r869
|
r873
|
|
| 570 | 570 | # |
| 571 | 571 | def test_open_for_reading(self): |
| 572 | | # test for issue #17, http://ftputil.sschwarzer.net/trac/ticket/17 |
| | 572 | # test for issues #17 and #51, |
| | 573 | # http://ftputil.sschwarzer.net/trac/ticket/17 and |
| | 574 | # http://ftputil.sschwarzer.net/trac/ticket/51 |
| | 575 | file1 = self.host.file("debian-keyring.tar.gz", 'rb') |
| | 576 | time.sleep(1) |
| | 577 | # depending on the FTP server, this might return a status code |
| | 578 | # unexpected by `ftplib`, or block the socket connection until |
| | 579 | # a server-side timeout |
| | 580 | file1.close() |
| | 581 | |
| | 582 | def test_subsequent_reading(self): |
| | 583 | # opening a file for reading |
| 573 | 584 | file1 = self.host.file("debian-keyring.tar.gz", 'rb') |
| 574 | 585 | file1.close() |
| … |
… |
|
| 615 | 626 | server, user, password = get_login_data() |
| 616 | 627 | unittest.main() |
| 617 | | |
| | 628 | import __main__ |
| | 629 | #unittest.main(__main__, "RealFTPTest.test_open_for_reading") |
| | 630 | |
-
|
r869
|
r873
|
|
| 216 | 216 | ftp_error._try_with_ioerror(self._session.voidresp) |
| 217 | 217 | except ftp_error.FTPIOError, exception: |
| 218 | | # ignore some errors, see ticket #17 at |
| 219 | | # http://ftputil.sschwarzer.net/trac/ticket/17 |
| | 218 | # ignore some errors, see tickets #51 and #17 at |
| | 219 | # http://ftputil.sschwarzer.net/trac/ticket/51 and |
| | 220 | # http://ftputil.sschwarzer.net/trac/ticket/17, |
| | 221 | # respectively |
| 220 | 222 | error_code = str(exception).split()[0] |
| 221 | | if error_code not in ("426", "450", "451"): |
| | 223 | if error_code not in ("150", "426", "450", "451"): |
| 222 | 224 | raise |
| 223 | 225 | finally: |