1 diff -up mc-4.8.24/src/vfs/extfs/helpers/uc1541.python3 mc-4.8.24/src/vfs/extfs/helpers/uc1541
2 --- mc-4.8.24/src/vfs/extfs/helpers/uc1541.python3 2020-01-20 14:40:30.637996501 +0100
3 +++ mc-4.8.24/src/vfs/extfs/helpers/uc1541 2020-01-20 14:37:55.253442507 +0100
6 +#!/usr/bin/env python3
8 UC1541 Virtual filesystem
10 --- a/src/vfs/extfs/helpers/s3+.in (original)
11 +++ b/src/vfs/extfs/helpers/s3+.in (refactored)
13 Propagates exception safely.
15 from threading import Thread
19 items = list(iterable)
22 - return map(fun, items)
23 + return list(map(fun, items))
25 # Create and fill input queue
26 - input = Queue.Queue()
27 - output = Queue.Queue()
28 + input = queue.Queue()
29 + output = queue.Queue()
31 for i,item in enumerate(items):
34 output.put( (i,result) )
36 output.put( (None,sys.exc_info()) )
46 - raise res[0],res[1],res[2]
48 + raise res[0](res[1]).with_traceback(res[2])
54 b = s3.get_bucket(name, validate=False)
55 b.get_location() # just to raise an exception on error
57 - except boto.exception.S3ResponseError, e:
58 + except boto.exception.S3ResponseError as e:
59 # Seems this is the only proper way to switch to the bucket's region.
60 # Requesting of the default region for "?location" does not work unfortunately.
61 m = re.search(r'<Region>(.*?)</Region>', e.body)
63 expr = re.compile(r'^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.\d{3}Z$')
64 def convDate(awsdatetime):
65 m = expr.match(awsdatetime)
66 - ye,mo,da,ho,mi,se = map(int,m.groups())
67 + ye,mo,da,ho,mi,se = list(map(int,m.groups()))
69 dt = datetime.datetime(ye,mo,da,ho,mi,se, tzinfo=pytz.utc)
70 return dt.astimezone(tz).strftime('%m-%d-%Y %H:%M')