Ticket #1389: preserve-importerror-messages.darcs.patch

File preserve-importerror-messages.darcs.patch, 8.3 KB (added by davidsarah, at 2011-04-09T00:46:47Z)

allmydata/init.py: preserve the message of ImportErrors? in the package versions string. fixes #1389

Line 
11 patch for repository davidsarah@dev.allmydata.org:/home/darcs/tahoe/trunk:
2
3Sat Apr  9 01:44:33 BST 2011  david-sarah@jacaranda.org
4  * allmydata/__init__.py: preserve the message of ImportErrors in the package versions string. fixes #1389
5
6New patches:
7
8[allmydata/__init__.py: preserve the message of ImportErrors in the package versions string. fixes #1389
9david-sarah@jacaranda.org**20110409004433
10 Ignore-this: caff24ad49573d66bc61d0a397b51afe
11] {
12hunk ./src/allmydata/__init__.py 189
13             try:
14                 __import__(modulename)
15                 module = sys.modules[modulename]
16-            except ImportError:
17-                packages.append( (pkgname, (None, None, modulename)) )
18+            except ImportError, e:
19+                packages.append( (pkgname, (None, None, "%s because of: %s" % (modulename, str(e)))) )
20             else:
21                 if 'sqlite' in pkgname:
22                     packages.append( (pkgname, (get_version(module, 'version'), package_dir(module.__file__),
23hunk ./src/allmydata/__init__.py 221
24         return
25     (actual, location, comment) = vers_and_locs[name]
26     if actual is None:
27-        # comment is the module name
28-        raise ImportError("could not import %r for requirement %r" % (comment, req))
29+        # comment is the module name and message of the original ImportError
30+        raise ImportError("for requirement %r, could not import %s" % (req, comment))
31     if actual == 'unknown':
32         return
33     actualver = normalized_version(actual, what="actual version %r of %s from %r" % (actual, name, location))
34}
35
36Context:
37
38[allmydata/__init__.py: Nicer reporting of unparseable version numbers in dependencies. fixes #1388
39david-sarah@jacaranda.org**20110401202750
40 Ignore-this: 9c6bd599259d2405e1caadbb3e0d8c7f
41]
42[update FTP-and-SFTP.rst: the necessary patch is included in Twisted-10.1
43Brian Warner <warner@lothar.com>**20110325232511
44 Ignore-this: d5307faa6900f143193bfbe14e0f01a
45]
46[control.py: remove all uses of s.get_serverid()
47warner@lothar.com**20110227011203
48 Ignore-this: f80a787953bd7fa3d40e828bde00e855
49]
50[web: remove some uses of s.get_serverid(), not all
51warner@lothar.com**20110227011159
52 Ignore-this: a9347d9cf6436537a47edc6efde9f8be
53]
54[immutable/downloader/fetcher.py: remove all get_serverid() calls
55warner@lothar.com**20110227011156
56 Ignore-this: fb5ef018ade1749348b546ec24f7f09a
57]
58[immutable/downloader/fetcher.py: fix diversity bug in server-response handling
59warner@lothar.com**20110227011153
60 Ignore-this: bcd62232c9159371ae8a16ff63d22c1b
61 
62 When blocks terminate (either COMPLETE or CORRUPT/DEAD/BADSEGNUM), the
63 _shares_from_server dict was being popped incorrectly (using shnum as the
64 index instead of serverid). I'm still thinking through the consequences of
65 this bug. It was probably benign and really hard to detect. I think it would
66 cause us to incorrectly believe that we're pulling too many shares from a
67 server, and thus prefer a different server rather than asking for a second
68 share from the first server. The diversity code is intended to spread out the
69 number of shares simultaneously being requested from each server, but with
70 this bug, it might be spreading out the total number of shares requested at
71 all, not just simultaneously. (note that SegmentFetcher is scoped to a single
72 segment, so the effect doesn't last very long).
73]
74[immutable/downloader/share.py: reduce get_serverid(), one left, update ext deps
75warner@lothar.com**20110227011150
76 Ignore-this: d8d56dd8e7b280792b40105e13664554
77 
78 test_download.py: create+check MyShare instances better, make sure they share
79 Server objects, now that finder.py cares
80]
81[immutable/downloader/finder.py: reduce use of get_serverid(), one left
82warner@lothar.com**20110227011146
83 Ignore-this: 5785be173b491ae8a78faf5142892020
84]
85[immutable/offloaded.py: reduce use of get_serverid() a bit more
86warner@lothar.com**20110227011142
87 Ignore-this: b48acc1b2ae1b311da7f3ba4ffba38f
88]
89[immutable/upload.py: reduce use of get_serverid()
90warner@lothar.com**20110227011138
91 Ignore-this: ffdd7ff32bca890782119a6e9f1495f6
92]
93[immutable/checker.py: remove some uses of s.get_serverid(), not all
94warner@lothar.com**20110227011134
95 Ignore-this: e480a37efa9e94e8016d826c492f626e
96]
97[add remaining get_* methods to storage_client.Server, NoNetworkServer, and
98warner@lothar.com**20110227011132
99 Ignore-this: 6078279ddf42b179996a4b53bee8c421
100 MockIServer stubs
101]
102[upload.py: rearrange _make_trackers a bit, no behavior changes
103warner@lothar.com**20110227011128
104 Ignore-this: 296d4819e2af452b107177aef6ebb40f
105]
106[happinessutil.py: finally rename merge_peers to merge_servers
107warner@lothar.com**20110227011124
108 Ignore-this: c8cd381fea1dd888899cb71e4f86de6e
109]
110[test_upload.py: factor out FakeServerTracker
111warner@lothar.com**20110227011120
112 Ignore-this: 6c182cba90e908221099472cc159325b
113]
114[test_upload.py: server-vs-tracker cleanup
115warner@lothar.com**20110227011115
116 Ignore-this: 2915133be1a3ba456e8603885437e03
117]
118[happinessutil.py: server-vs-tracker cleanup
119warner@lothar.com**20110227011111
120 Ignore-this: b856c84033562d7d718cae7cb01085a9
121]
122[upload.py: more tracker-vs-server cleanup
123warner@lothar.com**20110227011107
124 Ignore-this: bb75ed2afef55e47c085b35def2de315
125]
126[upload.py: fix var names to avoid confusion between 'trackers' and 'servers'
127warner@lothar.com**20110227011103
128 Ignore-this: 5d5e3415b7d2732d92f42413c25d205d
129]
130[refactor: s/peer/server/ in immutable/upload, happinessutil.py, test_upload
131warner@lothar.com**20110227011100
132 Ignore-this: 7ea858755cbe5896ac212a925840fe68
133 
134 No behavioral changes, just updating variable/method names and log messages.
135 The effects outside these three files should be minimal: some exception
136 messages changed (to say "server" instead of "peer"), and some internal class
137 names were changed. A few things still use "peer" to minimize external
138 changes, like UploadResults.timings["peer_selection"] and
139 happinessutil.merge_peers, which can be changed later.
140]
141[storage_client.py: clean up test_add_server/test_add_descriptor, remove .test_servers
142warner@lothar.com**20110227011056
143 Ignore-this: efad933e78179d3d5fdcd6d1ef2b19cc
144]
145[test_client.py, upload.py:: remove KiB/MiB/etc constants, and other dead code
146warner@lothar.com**20110227011051
147 Ignore-this: dc83c5794c2afc4f81e592f689c0dc2d
148]
149[test: increase timeout on a network test because Francois's ARM machine hit that timeout
150zooko@zooko.com**20110317165909
151 Ignore-this: 380c345cdcbd196268ca5b65664ac85b
152 I'm skeptical that the test was proceeding correctly but ran out of time. It seems more likely that it had gotten hung. But if we raise the timeout to an even more extravagant number then we can be even more certain that the test was never going to finish.
153]
154[docs/configuration.rst: add a "Frontend Configuration" section
155Brian Warner <warner@lothar.com>**20110222014323
156 Ignore-this: 657018aa501fe4f0efef9851628444ca
157 
158 this points to docs/frontends/*.rst, which were previously underlinked
159]
160[web/filenode.py: avoid calling req.finish() on closed HTTP connections. Closes #1366
161"Brian Warner <warner@lothar.com>"**20110221061544
162 Ignore-this: 799d4de19933f2309b3c0c19a63bb888
163]
164[Add unit tests for cross_check_pkg_resources_versus_import, and a regression test for ref #1355. This requires a little refactoring to make it testable.
165david-sarah@jacaranda.org**20110221015817
166 Ignore-this: 51d181698f8c20d3aca58b057e9c475a
167]
168[allmydata/__init__.py: .name was used in place of the correct .__name__ when printing an exception. Also, robustify string formatting by using %r instead of %s in some places. fixes #1355.
169david-sarah@jacaranda.org**20110221020125
170 Ignore-this: b0744ed58f161bf188e037bad077fc48
171]
172[Refactor StorageFarmBroker handling of servers
173Brian Warner <warner@lothar.com>**20110221015804
174 Ignore-this: 842144ed92f5717699b8f580eab32a51
175 
176 Pass around IServer instance instead of (peerid, rref) tuple. Replace
177 "descriptor" with "server". Other replacements:
178 
179  get_all_servers -> get_connected_servers/get_known_servers
180  get_servers_for_index -> get_servers_for_psi (now returns IServers)
181 
182 This change still needs to be pushed further down: lots of code is now
183 getting the IServer and then distributing (peerid, rref) internally.
184 Instead, it ought to distribute the IServer internally and delay
185 extracting a serverid or rref until the last moment.
186 
187 no_network.py was updated to retain parallelism.
188]
189[TAG allmydata-tahoe-1.8.2
190warner@lothar.com**20110131020101]
191Patch bundle hash:
1927442114a1fc127f5c234f29b1f1cf2be555c94a4