Opened 14 years ago

Closed 10 years ago

#210 closed enhancement (fixed)

apt:: gracefully handle md5 mismatch

Reported by: maphew Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords: pkg-apt
Cc:

Description

Currently when a calculated md5 sum doesn't match what setup.ini says it's supposed the error message is noisy and obscures the real problem. Update to simply report the mismatch and exit, not dump the stack trace.

bf9d4dbe75bebd59b788b586bbb2f5a2  qgis-1.6.0-2.tar.bz2 - remote
aba6054cbcef8cf3e24d852733b8178f  qgis-1.6.0-2.tar.bz2 - local
Traceback (most recent call last):
  File "d:\dee\code\o4w\apt\apt.py", line 1029, in <module>
    __main__.__dict__[command] ()
  File "d:\dee\code\o4w\apt\apt.py", line 144, in install
    download ()
  File "d:\dee\code\o4w\apt\apt.py", line 109, in download
    md5 ()
  File "d:\dee\code\o4w\apt\apt.py", line 208, in md5
    raise 'file md5 does not match for ' + ball
TypeError: exceptions must be classes or instances, not str

The real issue, also happening in several other places, is that string exceptions have been deprecated in python for some time.

Change History (2)

comment:1 by maphew, 13 years ago

As a user: when this happens delete the local cache copy of the package and try again. Installation should work the second time around. The file %osgeo4w_root%\etc\setup\last-cache contains the cache location.

comment:2 by maphew, 10 years ago

Resolution: fixed
Status: newclosed

closed in https://github.com/maphew/apt/commit/2128c63bfb7db531670ed44afff539efc7b4d624

(though we could use a new function to force overwrite or delete bad local file)

Note: See TracTickets for help on using tickets.