Ticket #534: tahoe put unicode support.darcspatch

File tahoe put unicode support.darcspatch, 11.2 KB (added by zooko, at 2009-06-09T19:53:18Z)
Line 
1Wed Apr 29 10:20:03 MDT 2009  francois@ctrlaltdel.ch
2  * cli: tahoe put unicode support + encode path elements using unicode_to_url
3 
4  Both changes (tahoe put and url encoding) had to be included in the same patch
5  to prevent failing tests.
6
7New patches:
8
9[cli: tahoe put unicode support + encode path elements using unicode_to_url
10francois@ctrlaltdel.ch**20090429162003
11 Ignore-this: 6285a8c89837290173e9a4d3744e1173
12 
13 Both changes (tahoe put and url encoding) had to be included in the same patch
14 to prevent failing tests.
15] {
16hunk ./src/allmydata/scripts/cli.py 134
17         # tahoe put bar tahoe:FOO        # same
18 
19         if arg1 is not None and arg2 is not None:
20-            self.from_file = arg1
21-            self.to_file = arg2
22+            self.from_file = argv_to_unicode(arg1)
23+            self.to_file =  argv_to_unicode(arg2)
24         elif arg1 is not None and arg2 is None:
25hunk ./src/allmydata/scripts/cli.py 137
26-            self.from_file = arg1 # might be "-"
27+            self.from_file = argv_to_unicode(arg1) # might be "-"
28             self.to_file = None
29         else:
30             self.from_file = None
31hunk ./src/allmydata/scripts/cli.py 142
32             self.to_file = None
33-        if self.from_file == "-":
34+        if self.from_file == u"-":
35             self.from_file = None
36 
37     def getSynopsis(self):
38hunk ./src/allmydata/scripts/common.py 166
39 
40 def escape_path(path):
41     segments = path.split("/")
42-    return "/".join([urllib.quote(s) for s in segments])
43+    return "/".join([urllib.quote(unicode_to_url(s)) for s in segments])
44hunk ./src/allmydata/test/test_cli.py 742
45         d.addCallback(lambda (rc,out,err): self.failUnlessEqual(out, DATA2))
46         return d
47 
48+    def test_immutable_from_file_unicode(self):
49+        # tahoe put file.txt "à trier.txt"
50+        self.basedir = os.path.dirname(self.mktemp())
51+        self.set_up_grid()
52+
53+        rel_fn = os.path.join(self.basedir, "DATAFILE")
54+        abs_fn = os.path.abspath(rel_fn)
55+        # we make the file small enough to fit in a LIT file, for speed
56+        DATA = "short file"
57+        f = open(rel_fn, "w")
58+        f.write(DATA)
59+        f.close()
60+
61+        d = self.do_cli("create-alias", "tahoe")
62+
63+        d.addCallback(lambda res:
64+                      self.do_cli("put", rel_fn, "à trier.txt"))
65+        def _uploaded((rc,stdout,stderr)):
66+            readcap = stdout.strip()
67+            self.failUnless(readcap.startswith("URI:LIT:"))
68+            self.failUnless("201 Created" in stderr, stderr)
69+            self.readcap = readcap
70+        d.addCallback(_uploaded)
71+
72+        d.addCallback(lambda res:
73+                      self.do_cli("get", "tahoe:à trier.txt"))
74+        d.addCallback(lambda (rc,stdout,stderr):
75+                      self.failUnlessEqual(stdout, DATA))
76+
77+        return d
78+
79 class List(GridTestMixin, CLITestMixin, unittest.TestCase):
80     def test_list(self):
81         self.basedir = "cli/List/list"
82}
83
84Context:
85
86[test_cli.Backup: increase timeout massively, it takes 1200s on zandr's ARM linkstation
87warner@lothar.com**20090609052801] 
88[tests: double the timeouts on some tests which time-out on Francois's box
89zooko@zooko.com**20090609021753
90 Ignore-this: b2727b04402f24a9b9123d2f84068106
91] 
92[tests: bump up timeouts so that the tests can finish before timeout on Francois's little arm box
93zooko@zooko.com**20090608225557
94 Ignore-this: fb83698338b2f12546cd3e1dcb896d34
95] 
96[tests: increase timeouts on some other tests that timed-out on Francois's arm box
97zooko@zooko.com**20090605143437
98 Ignore-this: 2903cc20d914fc074c8d7a6c47740ba6
99] 
100[tests: bump up the timeout on a bunch of tests that took longer than the default timeout (120s) on François Lenny-armv5tel
101zooko@zooko.com**20090605031444
102 Ignore-this: 84d67849b1f8edc88bf7001e31b5f7f3
103] 
104[backup: remove the --no-backupdb command, the handling of "can't import sqlite", and the related tests, and change an error message to more correctly indicate failure to load the database from disk rather than failure to import sqlite module
105zooko@zooko.com**20090604173131
106 Ignore-this: 8200a9fdfc49243c280ecd1d0c44fa19
107 Fixes #728.
108] 
109[more refactoring: move get_all_serverids() and get_nickname_for_serverid() from Client to storage_broker
110warner@lothar.com**20090602030750] 
111[more storage_broker refactoring: downloader gets a broker instead of a client,
112warner@lothar.com**20090602022511
113 use Client.get_storage_broker() accessor instead of direct attribute access.
114] 
115[test_runner.py: remove test_client_no_noise: the issue in question is
116warner@lothar.com**20090601225007
117 ticketed in http://divmod.org/trac/ticket/2830 and doesn't need a Tahoe-side
118 change, plus this test fails on win32 for unrelated reasons (and test_client
119 is the place to think about the win32 issue).
120] 
121[remove plaintext-hashing code from the helper interface, to close #722
122warner@lothar.com**20090601224916
123 and deny the Helper the ability to mount a partial-information-guessing
124 attack. This will probably break compatibility between new clients and very
125 old (pre-1.0) helpers.
126] 
127[start to factor server-connection-management into a distinct 'StorageServerFarmBroker' object, separate from the client and the introducer. This is the starting point for #467: static server selection
128warner@lothar.com**20090601210604] 
129[mutable: catch and display first error, so code bugs which break all servers get displayed better
130warner@lothar.com**20090601210407] 
131[misc/run-with-pythonpath.py: exec() the child (on unix), to remove the intermediate process
132warner@lothar.com**20090601210137] 
133[setup: require pysqlite >= v2.0.5. if we are running on Python < 2.5
134zooko@zooko.com**20090604154548
135 Ignore-this: cf04f46079821df209d01dad2e24b40b
136] 
137[setup: add pysqlite and sqlite to get_package_versions()
138zooko@zooko.com**20090604153728
139 Ignore-this: a1dea7fabeab2b08fb0d8d462facdb4d
140] 
141[docs: small edit to about.html
142zooko@zooko.com**20090528233422
143 Ignore-this: 1cfbb1f8426ed6d63b2d3952e4464ddc
144] 
145[docs: add links to Tahoe-LAFS for Paranoids and Tahoe-LAFS for Corporates in about.html
146zooko@zooko.com**20090528232717
147 Ignore-this: 7b70baa700d6b6f6e9ceec4132efe5
148] 
149[docs: edit about.html and include network-and-reliance-topology.png (loaded from http://allmydata.org )
150zooko@zooko.com**20090527150916
151 Ignore-this: 44adc61cde8ced8be2f0a7dfc7d95dad
152] 
153[docs: a few more edits to network-and-reliance-topology.svg
154zooko@zooko.com**20090527150458
155 Ignore-this: 2eac8c33fe71be25ff809b399c6193c1
156] 
157[docs: update NEWS, relnotes.txt, CREDITS to mention WUI Style
158zooko@zooko.com**20090526233654
159 Ignore-this: 72d16ec833bc4a22af23d29ea1d5ff8b
160] 
161[docs: update network-and-reliance-topology.svg for beauty and clarity
162zooko@zooko.com**20090527031123
163 Ignore-this: 5510914849771900ac29b4312470d84
164] 
165[Modify markup of Tahoe web pages to be more amenable to styling; some minor changes of wording.
166Kevin Reid <kpreid@mac.com>**20090526232545
167 Ignore-this: 8845937f0df6c7ddc07abe3211428a6f
168] 
169[Tweak wording in directory page: not-read-only is "modifiable", mention creating a directory _in this directory_.
170Kevin Reid <kpreid@mac.com>**20090526232414
171 Ignore-this: f006ec52ba2051802e025a60bcface56
172] 
173[Comment on duplication of code/markup found during styling project.
174Kevin Reid <kpreid@mac.com>**20090503203442
175 Ignore-this: a4b7f9f0ab57d2c03be9ba761be8d854
176] 
177[Add CSS styles to spiff up the Tahoe WUI's appearance, particularly the welcome page and directories.
178Kevin Reid <kpreid@mac.com>**20090503203142
179 Ignore-this: 5c50af241c1a958b5180ef2b6a49f626
180] 
181[Link all Tahoe web pages to the /tahoe_css stylesheet which already exists.
182Kevin Reid <kpreid@mac.com>**20090503202533
183 Ignore-this: 2ea8d14d3168b9502cf39d5ea3f2f2a8
184] 
185[Fix broken link from Provisioning to Reliability page.
186Kevin Reid <kpreid@mac.com>**20090501191050
187 Ignore-this: 56dc1a5e659b70cc02dc4df7b5d518cd
188] 
189[docs: network-and-reliance-topology.svg: nicer server icons, mv out of the "specifications" subdir
190zooko@zooko.com**20090526165842
191 Ignore-this: 8f47ab3a0ab782c1f0d46e10bcaebe5b
192] 
193[accounting-overview.txt: more edits
194warner@lothar.com**20090523190359] 
195[accounting-overview.txt: small edits
196warner@lothar.com**20090523184011] 
197[_auto_deps.py: require foolscap-0.4.1, which adds an important fix for py2.4
198warner@lothar.com**20090523011103] 
199[immutable/encode.py: tolerate immediate _remove_shareholder by copying the
200warner@lothar.com**20090522184424
201 landlord list before iterating over it. This can probably only happen in unit
202 tests, but cleaning it up makes certain test failures easier to analyze.
203] 
204[switch to using RemoteException instead of 'wrapped' RemoteReferences. Should fix #653, the rref-EQ problem
205warner@lothar.com**20090522004632] 
206[switch all foolscap imports to use foolscap.api or foolscap.logging
207warner@lothar.com**20090522003823] 
208[_auto_deps.py: bump our foolscap dependency to 0.4.0, since I'm about to start using its new features
209warner@lothar.com**20090522002100] 
210[test_runner.py: fix minor typo
211warner@lothar.com**20090520033620] 
212[docs: update network-and-reliance-topology.svg
213zooko@zooko.com**20090526163105
214 Ignore-this: 2b864b4ed8743d4a15dfbb7eff3fa561
215] 
216[setup: fix bug (wrong import) in error message, as noticed by pyflakes
217zooko@zooko.com**20090519195642
218 Ignore-this: f1b9f8c00b46c1b5f2f20e5fc424f341
219] 
220[setup: fix trivial bug in recent patch to test base64.py at startup
221zooko@zooko.com**20090519195129
222 Ignore-this: f6be038f74b53ca69e7109fe34adfbc
223] 
224[setup: make Tahoe exit at startup with a useful error message if the base64.py module is buggy (fixes part of #710)
225zooko@zooko.com**20090519194555
226 Ignore-this: aa4d398235ddca8d417d61c9688e154
227] 
228[test_introducer.py: add a test for the python2.4.0/2.4.1 bug in base64.b32decode
229warner@lothar.com**20090519034101] 
230[immutable WriteBucketProxy: use pipeline to speed up uploads by overlapping roundtrips, for #392
231warner@lothar.com**20090518234422] 
232[util/pipeline.py: new utility class to manage size-limited work pipelines, for #392
233warner@lothar.com**20090518234326] 
234[docs: add a diagram that I'm about to show to the Boulder Linux Users Group: network-and-reliance-topology.svg
235zooko@zooko.com**20090514232059
236 Ignore-this: 2420c0a7c254c9f0f2349d9130490d33
237] 
238[tests: mark test_runner as coded in utf-8 instead of ascii
239zooko@zooko.com**20090507223151
240 Ignore-this: ccf1ba9e5a9b53602701a36f9fdb545e
241] 
242[tests: raise timeout on test_runner.RunNode.test_introducer from 120s to 240s, since it hit the 120s time-out on François Lenny-armv5tel
243zooko@zooko.com**20090507215012
244 Ignore-this: ba18fe6832ba255d4971e8f623ed7da5
245] 
246[setup: fix comment in setup.py
247zooko@zooko.com**20090507215003
248 Ignore-this: c46ef664630d52733138ef7fbc551c1c
249] 
250[docs: how_to_make_a_tahoe_release.txt: a couple of small edits
251zooko@zooko.com**20090507214932
252 Ignore-this: ae92aa835ad369f4b9e6e49d681957a3
253] 
254[.darcs-boringfile: also ignore .gitignore
255warner@allmydata.com**20090415210550
256 Ignore-this: d29db314a1e506f6240859559436b4c3
257] 
258[.darcs-boringfile: ignore .git, I'm starting to play around with it
259warner@allmydata.com**20090415205929
260 Ignore-this: 89234453516483c9586cd6e1351e88b5
261] 
262[fix quicktest: stop using setuptools, add misc/run-with-pythonpath.py, to make it run faster
263warner@lothar.com**20090414201400] 
264[TAG allmydata-tahoe-1.4.1
265zooko@zooko.com**20090414025636
266 Ignore-this: de78fc32364c83e9f4e26b5abcfdea4a
267] 
268Patch bundle hash:
26977183b8dde742015c9dc8dc2a88d1957377179b9