Commit Graph

6398 Commits

Author SHA1 Message Date
Itamar Turner-Trauring
4051a17313 Merge remote-tracking branch 'origin/master' into 3453.downloader-share-python-3 2020-09-30 13:28:18 -04:00
Itamar Turner-Trauring
6c72c8b77f Merge branch '3451.immutable-downloader-start-python-3' into 3452.immutable-downloader-more-python-3 2020-09-30 11:52:37 -04:00
Ross Patterson
362c121426 feat(py3): Convert unicode-only modules to str
Modules that reference `unicode` but do *not* reference `str` can safely be converted to
use `str` in a way that's closest to the way it should be done under Python 3 but that
is still Python 2 compatible [per
`python-future`](https://python-future.org/compatible_idioms.html?highlight=unicode#unicode).

This change results in 4 additional tests passing under Python 3 that weren't before,
one previous test error is now a failure, and more coverage in a few modules.  Here's
the diff of the output from running all tests under Python 3 before these changes and
after.  I've elided the irrelevant changes (time stamps, object ids, etc.):

```diff
--- .tox/make-test-py3-all-old.log	2020-09-27 20:56:55.761691130 -0700
+++ .tox/make-test-py3-all-new.log	2020-09-27 20:58:16.242075678 -0700
@@ -1,6 +1,6 @@
...
@@ -4218,7 +4218,7 @@
 [ERROR]
 (#.### secs)
 allmydata.test.mutable.test_version.Version.test_download_version ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/mutable/test_version.py", line 274, in test_download_version
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/mutable/test_version.py", line 279, in test_download_version
     d = self.publish_multiple()
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/mutable/util.py", line 372, in publish_multiple
     self._nodemaker = make_nodemaker(self._storage)
@@ -4438,40 +4438,26 @@
 allmydata.test.test_abbreviate.Abbreviate.test_time ... [OK]
 (#.### secs)
 allmydata.test.test_auth.AccountFileCheckerKeyTests.test_authenticated ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_auth.py", line 42, in setUp
-    abspath = abspath_expanduser_unicode(unicode(self.account_file.path))
-builtins.NameError: name 'unicode' is not defined
+Failure: twisted.cred.error.UnauthorizedLogin:
 [ERROR]
 (#.### secs)
 allmydata.test.test_auth.AccountFileCheckerKeyTests.test_missing_signature ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_auth.py", line 42, in setUp
-    abspath = abspath_expanduser_unicode(unicode(self.account_file.path))
-builtins.NameError: name 'unicode' is not defined
-[ERROR]
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/trial/_asynctest.py", line 75, in _eb
+    raise self.failureException(output)
+twisted.trial.unittest.FailTest:
+Expected: (<class 'twisted.conch.error.ValidPublicKey'>,)
+Got:
+[Failure instance: Traceback (failure with no frames): <class 'twisted.cred.error.UnauthorizedLogin'>:
+]
+[FAILURE]
 (#.### secs)
-allmydata.test.test_auth.AccountFileCheckerKeyTests.test_password_auth_user ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_auth.py", line 42, in setUp
-    abspath = abspath_expanduser_unicode(unicode(self.account_file.path))
-builtins.NameError: name 'unicode' is not defined
-[ERROR]
+allmydata.test.test_auth.AccountFileCheckerKeyTests.test_password_auth_user ... [OK]
 (#.### secs)
-allmydata.test.test_auth.AccountFileCheckerKeyTests.test_unknown_user ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_auth.py", line 42, in setUp
-    abspath = abspath_expanduser_unicode(unicode(self.account_file.path))
-builtins.NameError: name 'unicode' is not defined
-[ERROR]
+allmydata.test.test_auth.AccountFileCheckerKeyTests.test_unknown_user ... [OK]
 (#.### secs)
-allmydata.test.test_auth.AccountFileCheckerKeyTests.test_unrecognized_key ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_auth.py", line 42, in setUp
-    abspath = abspath_expanduser_unicode(unicode(self.account_file.path))
-builtins.NameError: name 'unicode' is not defined
-[ERROR]
+allmydata.test.test_auth.AccountFileCheckerKeyTests.test_unrecognized_key ... [OK]
 (#.### secs)
-allmydata.test.test_auth.AccountFileCheckerKeyTests.test_wrong_signature ... Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_auth.py", line 42, in setUp
-    abspath = abspath_expanduser_unicode(unicode(self.account_file.path))
-builtins.NameError: name 'unicode' is not defined
-[ERROR]
+allmydata.test.test_auth.AccountFileCheckerKeyTests.test_wrong_signature ... [OK]
 (#.### secs)
 allmydata.test.test_backupdb.BackupDB.test_basic ... [OK]
 (#.### secs)
@@ -4615,7 +4601,7 @@
 src/allmydata/crypto/util.py                            12      2      4      2    75%   13, 32, 12->13, 30->32
 src/allmydata/deep_stats.py                             83     63     26      0    18%   27-52, 56-58, 62-82, 86-91, 94, 97, 103-114, 117-121, 125-131, 135
 src/allmydata/dirnode.py                               525    420    178      0    15%   70-103, 112-116, 119-135, 140-143, 146-160, 165-173, 176-177, 180-205, 208-217, 223-229, 248-286, 293-299, 302, 310, 315, 318-324, 327-332, 336-340, 344-346, 355-406, 410, 413, 416, 419, 422, 425, 428, 431-433, 436, 439, 442, 445, 448-450, 453, 457, 459, 464, 469-472, 475-478, 481-484, 489-492, 498-501, 504-507, 510-518, 530-532, 539-555, 558-566, 570-589, 600-610, 613-620, 628-641, 646-652, 657-678, 693-714, 752-761, 765-770, 774-812, 819-820, 825, 828, 831, 836-839, 842-849, 852-853, 862-877, 880-881, 884-891, 894, 897-899
-src/allmydata/frontends/auth.py                        100     71     28      0    26%   21-22, 30-48, 51, 54-56, 59-70, 80-87, 100-110, 117-118, 121, 124-142, 147-150, 156-159
+src/allmydata/frontends/auth.py                        100     52     28      4    47%   21-22, 38, 41-44, 51, 54-56, 65-70, 80-87, 106-108, 117-118, 121, 124-142, 147-150, 156-159, 37->38, 40->41, 59->65, 101->106
 src/allmydata/frontends/ftpd.py                        255    254     84      0     1%   4-337
 src/allmydata/frontends/sftpd.py                      1211   1208    488      0     1%   4-2014
 src/allmydata/hashtree.py                              174    135     72      1    16%   59, 75-78, 106-108, 114-117, 123-126, 132-136, 142-149, 152-162, 165-169, 172, 175, 180, 183, 186, 218-232, 259-262, 295-306, 320-323, 326-331, 384-484, 58->59
@@ -4653,7 +4639,7 @@
 src/allmydata/scripts/admin.py                          51     31      2      0    38%   9-14, 17-21, 25, 28, 31-37, 40-46, 56-57, 59, 61-66, 74-78
 src/allmydata/scripts/backupdb.py                      146     91     14      1    36%   84-91, 94-96, 99, 103, 106, 111-114, 117-119, 122, 125, 128, 176-221, 231-242, 245-263, 266-272, 308-324, 327-333, 336-341, 306->308
 src/allmydata/scripts/cli.py                           259    124     46      6    46%   25-49, 69-72, 79-81, 103, 142-146, 175, 221-222, 258, 265-266, 284-285, 330-331, 338-341, 346-355, 361-362, 366-373, 388, 405, 417, 432, 449, 479-481, 484-486, 489-491, 494-496, 499-501, 504-515, 518-520, 523-525, 528-530, 533, 536-538, 541-543, 546-548, 551-553, 556-558, 561-563, 566-568, 571-573, 576-577, 60->exit, 61->exit, 174->175, 180->exit, 181->exit, 219->221
-src/allmydata/scripts/common.py                        153     74     60      4    48%   64, 82, 88, 100, 114-126, 130-152, 159-163, 168-169, 172, 177, 191-236, 240-241, 47->49, 63->64, 79->82, 87->88
+src/allmydata/scripts/common.py                        154     74     60      4    49%   69, 87, 93, 105, 119-131, 135-157, 164-168, 173-174, 177, 182, 196-241, 245-246, 52->54, 68->69, 84->87, 92->93
 src/allmydata/scripts/common_http.py                    77     58     20      0    20%   15-30, 34-36, 38, 42-83, 87, 90, 94-96, 101
 src/allmydata/scripts/create_node.py                   302    185    114      8    30%   24, 61-96, 99-111, 114-128, 136-139, 169-174, 191-194, 205-208, 224-229, 235, 242, 256-278, 289-292, 295-298, 329, 339, 347-380, 385-445, 448-450, 455-477, 223->224, 234->235, 241->242, 252->256, 288->289, 294->295, 328->329, 338->339
 src/allmydata/scripts/debug.py                         719    638    202      0     9%   14, 31-32, 35-49, 52-60, 63-142, 146-154, 157-164, 168-217, 220-304, 307-401, 407, 417, 437-465, 468-485, 488-602, 606, 609-611, 637-648, 653-656, 659, 683-689, 692-810, 813-842, 845-848, 851-865, 869, 888, 891-940, 946, 949-950, 957, 960-961, 967-972, 984-985, 999-1000, 1003-1004, 1020-1021, 1025-1031, 1046-1050
@@ -4661,10 +4647,10 @@
 src/allmydata/scripts/run_common.py                    135     18     24      6    85%   37, 41-46, 59-60, 149, 158, 192-193, 216-220, 226-227, 55->62, 135->exit, 135->exit, 148->149, 191->192, 225->226
 src/allmydata/scripts/runner.py                        138     53     42     11    56%   84-85, 91, 97-99, 104, 114, 123-132, 140, 146, 149-160, 174-181, 186, 189-190, 204-232, 248, 255, 31->36, 103->104, 113->114, 139->140, 145->146, 147->149, 185->186, 188->189, 202->204, 247->248, 254->255
 src/allmydata/scripts/slow_operation.py                 69     56     22      0    14%   15-44, 47-52, 55-61, 64-83
-src/allmydata/scripts/stats_gatherer.py                 41     25     10      0    31%   20-25, 62-86
+src/allmydata/scripts/stats_gatherer.py                 42     25     10      0    33%   25-30, 67-91
 src/allmydata/scripts/tahoe_add_alias.py               106     91     30      0    11%   20-32, 35-59, 63-98, 102-111, 115-144
 src/allmydata/scripts/tahoe_backup.py                  331    267     85      0    15%   20-35, 38-51, 54-58, 71-73, 76-152, 155-157, 160-161, 164-174, 178-209, 212-242, 246-274, 278-279, 287-311, 322-331, 336, 339, 342-351, 356, 359, 362-367, 372-374, 379, 384, 389, 398, 417-425, 428, 431-461, 469-480, 483-486, 500-504, 511-512, 525, 538-542, 545-549, 552-555, 558-561, 564, 571, 578, 586-594
-src/allmydata/scripts/tahoe_check.py                   263    235    121      0     7%   15, 20-100, 103-112, 120-129, 132-167, 170-173, 179-192, 195-256, 259-270, 277-323, 327-336, 339
+src/allmydata/scripts/tahoe_check.py                   264    235    121      0     8%   20, 25-105, 108-117, 125-134, 137-172, 175-178, 184-197, 200-261, 264-275, 282-328, 332-341, 344
 src/allmydata/scripts/tahoe_cp.py                      602    503    226      0    12%   22, 26, 30-31, 34-37, 40-41, 44-47, 50-53, 56-60, 63-70, 75-77, 80, 83, 86, 90-91, 94, 98-99, 102, 106-111, 114, 117-134, 138-142, 145-159, 162-172, 175-177, 180, 185-189, 192, 195-197, 200-203, 206, 210-214, 218-223, 230-233, 236, 239-253, 256-263, 266-297, 303, 307-309, 316, 320-323, 326-333, 336-350, 354-358, 361-397, 403-413, 416-433, 436-437, 440-454, 465-496, 504-580, 583, 589-630, 636-689, 693-698, 701-703, 706-719, 723-762, 765-775, 778-806, 810-818, 821-838, 842, 845-857, 862-863, 867
 src/allmydata/scripts/tahoe_get.py                      37     32     12      0    10%   9-45
 src/allmydata/scripts/tahoe_invite.py                   59     41      8      0    27%   27-31, 36-71, 76-101
@@ -4679,7 +4665,7 @@
 src/allmydata/scripts/tahoe_stop.py                     60     47     10      0    19%   16, 24-84
 src/allmydata/scripts/tahoe_unlink.py                   28     23      6      0    15%   12-40
 src/allmydata/scripts/tahoe_webopen.py                  27     24     12      0     8%   7-31
-src/allmydata/stats.py                                 242    156     54      3    33%   28-34, 37-40, 43-47, 50-64, 67-72, 101, 104-110, 113-125, 144-146, 154-155, 160-163, 169-174, 178-187, 191, 200-207, 210, 213-219, 222-228, 232-234, 237, 241, 246-250, 253, 256-257, 263-278, 281-285, 288-293, 299-325, 100->101, 143->144, 153->154
+src/allmydata/stats.py                                 242    156     54      3    33%   29-35, 38-41, 44-48, 51-65, 68-73, 102, 105-111, 114-126, 145-147, 155-156, 161-164, 170-175, 179-188, 192, 201-208, 211, 214-220, 223-229, 233-235, 238, 242, 247-251, 254, 257-258, 264-279, 282-286, 289-294, 300-326, 101->102, 144->145, 154->155
 src/allmydata/storage/common.py                         24      2      4      2    86%   11, 28, 10->11, 36->39
 src/allmydata/storage/crawler.py                       222    125     64      6    37%   16, 90, 111-113, 148-178, 192-193, 231, 244, 251, 275-312, 315-363, 377-384, 393, 416, 428, 445, 453, 488-492, 495-508, 13->16, 89->90, 96->99, 228->231, 248->251, 268->271
 src/allmydata/storage/expirer.py                       240    183     81      2    21%   9, 74-79, 119, 122, 125-167, 171-233, 236-253, 256-261, 264-266, 269-274, 280-284, 288-322, 388-435, 7->9, 71->74
@@ -4748,7 +4734,7 @@
 src/allmydata/windows/fixups.py                        133    133     54      0     0%   1-237
 src/allmydata/windows/registry.py                       42     42     12      0     0%   1-77
 ------------------------------------------------------------------------------------------------
-TOTAL                                                27427  20411   8234    294    22%
+TOTAL                                                27430  20392   8234    298    22%

 18 files skipped due to complete coverage.
 + '[' '!' -z 1 ']'
```

Trac: refs #3448, https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3448
2020-09-30 08:47:02 -07:00
Itamar Turner-Trauring
d797ca1162 Merge remote-tracking branch 'origin/master' into 3451.immutable-downloader-start-python-3 2020-09-30 11:42:58 -04:00
Itamar Turner-Trauring
df69ca8b5b
Merge pull request #836 from tahoe-lafs/3450.immutable-literal-python-3
Port allmydata.immutable.literal to Python 3 (and fix a bug)

Fixes ticket:3450
2020-09-30 11:39:07 -04:00
Jean-Paul Calderone
751bc14521 Always make the todo message a native string.
If the todo message isn't a native string, trial ignores it completely.  Awesome.
2020-09-30 11:11:44 -04:00
Itamar Turner-Trauring
206f25d87e Port to Python 3. 2020-09-29 13:50:59 -04:00
Itamar Turner-Trauring
9eb6241c0a Fix lint. 2020-09-29 13:46:36 -04:00
Itamar Turner-Trauring
2a1e108722 Port to Python 3. 2020-09-29 11:29:49 -04:00
Itamar Turner-Trauring
867a1b71a1 Ported to Python 3. 2020-09-29 11:22:52 -04:00
Itamar Turner-Trauring
87838dd2bb
Merge pull request #834 from tahoe-lafs/3449.interfaces-to-python-3
Port allmydata.introducer.interfaces to Python 3

Fixes ticket:3449
2020-09-29 11:05:18 -04:00
Itamar Turner-Trauring
1fa724899b Port to Python 3. 2020-09-29 11:04:14 -04:00
Itamar Turner-Trauring
b721e3c5f2 Fix missing test coverage in fetcher.py. 2020-09-29 10:51:21 -04:00
Itamar Turner-Trauring
369cd98d5a Clarify what "JSON-serializable bytes" means. 2020-09-29 10:17:26 -04:00
Sajith Sasidharan
9c8fb6f901
Merge pull request #781 from sajith/3382.remove-multi-format-page
Remove web.common.MultiFormatPage

Fixes ticket:3382
2020-09-28 21:28:23 -04:00
Sajith Sasidharan
769f87c24d Remove unused import 2020-09-28 20:39:13 -04:00
Itamar Turner-Trauring
c84a2ef869
Merge pull request #835 from tahoe-lafs/3417.audit-for-loops-mutable-dict-views-python-3
Audit for loops for mutable dict views bugs on Python 3

Fixes ticket:3417
2020-09-28 16:53:12 -04:00
Itamar Turner-Trauring
f42634cfe7 Port to Python 3. 2020-09-28 16:51:29 -04:00
Itamar Turner-Trauring
e3a9f5fa75 Test and bugfix for LiteralFileNode equality. 2020-09-28 16:49:30 -04:00
Itamar Turner-Trauring
66c6522325 Unused code. 2020-09-28 16:44:50 -04:00
Itamar Turner-Trauring
7aa7716f3a Wrap with list(), just in case. 2020-09-28 15:44:29 -04:00
Itamar Turner-Trauring
66b4330ca2 Remove unused API. 2020-09-28 15:43:42 -04:00
Jean-Paul Calderone
76ecae2e44 Merge remote-tracking branch 'origin/master' into 3382.remove-multi-format-page 2020-09-28 15:09:29 -04:00
Jean-Paul Calderone
6d14eb55b5
Merge pull request #832 from tahoe-lafs/3443.referrer-policy-tests
Add a test for referrer-policy

Fixes: ticket:3443
2020-09-28 15:04:55 -04:00
Itamar Turner-Trauring
eb787ae540 Make items into list, just in case someone tries to merge object into itself. 2020-09-28 11:55:35 -04:00
Itamar Turner-Trauring
5e6201aede
Merge pull request #833 from tahoe-lafs/3446.test-helper-python-3
Port test_helper.py to Python 3

Fixes ticket:3446
2020-09-28 11:35:15 -04:00
Jean-Paul Calderone
a5686de460 Don't claim behavior about *all* pages 2020-09-28 10:26:00 -04:00
Itamar Turner-Trauring
64516aac41 Port to Python 3. 2020-09-28 10:20:00 -04:00
Itamar Turner-Trauring
d7b5230f0e Explain why __remote_name__ is a native string. 2020-09-28 10:06:06 -04:00
Itamar Turner-Trauring
f796b8a7da Fix typo. 2020-09-28 10:02:43 -04:00
Itamar Turner-Trauring
4e7e84796a
Merge pull request #829 from tahoe-lafs/3439.test-download-python-3
Port test_download.py to Python 3

Fixes ticket:3439
2020-09-28 09:59:53 -04:00
Chad Whitacre
afd28f3402
Merge pull request #823 from tahoe-lafs/3431.port-test_immutable
Port test_immutable to Python 3
2020-09-28 08:34:03 -04:00
Jean-Paul Calderone
60f531e970
Merge pull request #831 from tahoe-lafs/3438.test_introweb
Split `_test_introweb` into a separate suite

Fixes: ticket:3438
2020-09-27 19:14:24 -04:00
Itamar Turner-Trauring
21e3b355ec Finish porting to Python 3. 2020-09-25 14:03:25 -04:00
Itamar Turner-Trauring
d19ae1e511 Apparently __remote_name__ needs to be a native string. 2020-09-25 14:00:18 -04:00
Sajith Sasidharan
65f206e39b
Merge pull request #816 from sajith/3427.return-error-page-from-unlinked
Return ErrorPage from unlinked

Fixes ticket:3427
2020-09-25 13:30:02 -04:00
Itamar Turner-Trauring
565c48045e Closer to passing tests. 2020-09-25 13:28:59 -04:00
Itamar Turner-Trauring
d8c9affccb Bunch more places that need to be bytes for protocol backwards compatibility. 2020-09-25 13:28:49 -04:00
Itamar Turner-Trauring
9e5d5b5f8b Remove typo. 2020-09-25 13:16:47 -04:00
Itamar Turner-Trauring
47aa724c42 Merge remote-tracking branch 'origin/master' into 3439.test-download-python-3 2020-09-25 13:16:12 -04:00
Itamar Turner-Trauring
5e52691433
Merge pull request #827 from tahoe-lafs/3437.test-filenode-python-3
Port test_filenode.py to Python 3

Fixes ticket:3437
2020-09-25 13:15:30 -04:00
Sajith Sasidharan
569ac924ec
Merge pull request #825 from sajith/3436.remove-web-common-getxmlfile
Remove unused web.common.getxmlfile()

Fixes ticket:3436
2020-09-25 12:54:51 -04:00
Itamar Turner-Trauring
5d9a1a5ab5 Some progress towards passing tests. 2020-09-25 11:46:31 -04:00
Jean-Paul Calderone
8cdf5cbf26 unused import 2020-09-25 11:09:55 -04:00
Jean-Paul Calderone
2314a9f2f6 add a test for referrer-policy 2020-09-25 11:06:54 -04:00
Jean-Paul Calderone
3dddcd6f62 Remove assertions about Twisted Web's quoting behavior
It quotes stuff.  It's cool.  BeautifulSoup even looks at it for us and will
tell us if something is amiss.
2020-09-25 09:44:04 -04:00
Jean-Paul Calderone
dc15f19ee0 Merge remote-tracking branch 'origin/master' into 3382.remove-multi-format-page 2020-09-25 09:37:02 -04:00
Jean-Paul Calderone
44cc42351f remove duplicate request 2020-09-25 09:32:06 -04:00
Jean-Paul Calderone
05def35c26 nicer cleanup plus a comment 2020-09-25 09:31:57 -04:00
Jean-Paul Calderone
b218b5426b docstrings 2020-09-25 09:31:53 -04:00
Jean-Paul Calderone
dcb834c7a6 Merge remote-tracking branch 'origin/master' into 3438.test_introweb 2020-09-25 09:26:34 -04:00
Itamar Turner-Trauring
51709d5562
Merge pull request #817 from tahoe-lafs/3430-test-upload-python-3
Port test_upload.py to Python 3

Fixes ticket:3430
2020-09-24 16:57:38 -04:00
Jean-Paul Calderone
1c5f4e2bf0 Compatible with the interface I used in test_web.py 2020-09-24 11:08:18 -04:00
Jean-Paul Calderone
16ab1690de rewrite _test_introweb part of SystemTest as its own test suite 2020-09-24 11:08:18 -04:00
Jean-Paul Calderone
e981fea007 make FakeCanary more realistic 2020-09-24 11:08:18 -04:00
Itamar Turner-Trauring
26f28f341f Finish port to Python 3. 2020-09-24 11:03:42 -04:00
Itamar Turner-Trauring
8167a9fda6 All tests pass on Python 3. 2020-09-24 11:01:35 -04:00
Itamar Turner-Trauring
5cd00d6f2e And even more tests passing in Python 3. 2020-09-24 10:55:47 -04:00
Itamar Turner-Trauring
37bc022edc Even more tests passing on Python 3. 2020-09-24 10:46:10 -04:00
Jean-Paul Calderone
f1bcf4eb07 remove unused imports 2020-09-24 10:42:57 -04:00
Itamar Turner-Trauring
d9036e83b2 More tests passing on Python 3. 2020-09-24 10:39:06 -04:00
Itamar Turner-Trauring
e7fe2f0a3f It imports on Python 3. 2020-09-24 10:32:41 -04:00
Jean-Paul Calderone
e7101b1711 Turn exceptions into error pages like Nevow does 2020-09-24 10:23:05 -04:00
Jean-Paul Calderone
34bade4091 Use the newly introduced helper instead of our own internal thing 2020-09-24 10:22:07 -04:00
Jean-Paul Calderone
ed049da34f Add a helper that can render a Page or a Resource 2020-09-24 10:21:18 -04:00
Chad Whitacre
06cd64c891 De-lint 2020-09-23 21:41:23 -04:00
Chad Whitacre
3ae927eab9 Respond to review
- Preserve int division
- Dial back the __future__ imports
2020-09-23 21:18:24 -04:00
Itamar Turner-Trauring
5a2728fa05 Finish port to Python 3. 2020-09-23 15:56:09 -04:00
Itamar Turner-Trauring
5790ae8ece Tests pass on Python 3. 2020-09-23 15:53:13 -04:00
Sajith Sasidharan
c2e9d6057f
Merge pull request #819 from sajith/3425.return-errorpage-from-root
Return ErrorPage from web.root

Fixes ticket:3425
2020-09-23 10:18:44 -04:00
Chad Whitacre
42eaf08a52 Remove duplicate import 2020-09-23 08:32:34 -04:00
Sajith Sasidharan
a413eb8626 Use BeautifulSoup in RenderSlashUri tests 2020-09-23 08:32:19 -04:00
Chad Whitacre
d21046fe9f A couple more cleanups
- attempt the same future imports in both common and common_util
- put an import in a better place
2020-09-23 08:31:08 -04:00
Chad Whitacre
9fccf37053 Make new code more idiomatic 2020-09-23 08:24:39 -04:00
Chad Whitacre
de48dff981 Dial back future imports in common_util.py
Don't set the plow too deep.
2020-09-23 08:19:07 -04:00
Sajith Sasidharan
704b36d7e1 Remove test for web.common.getxmlfile() 2020-09-22 21:15:58 -04:00
Sajith Sasidharan
e6a5dda7e1 Rearrange imports 2020-09-22 21:14:00 -04:00
Sajith Sasidharan
22a1721b62 Remove unused web.common.getxmlfile() 2020-09-22 21:05:17 -04:00
Sajith Sasidharan
9aee312d8c
Merge pull request #822 from sajith/3429.return-errorpage-from-check-results
Return ErrorPage from web.check_results

Fixes ticket:3429
2020-09-22 20:40:00 -04:00
Sajith Sasidharan
4e4c5f9b7f
Merge pull request #820 from sajith/3424.return-errorpage-from-operations
Return ErrorPage from web.operations

Fixes ticket:3424
2020-09-22 20:38:34 -04:00
Sajith Sasidharan
da78bc05d0
Merge pull request #818 from sajith/3423.return-errorpage-from-filenode
Return ErrorPage from filenode

Fixes ticket:3423
2020-09-22 20:37:55 -04:00
Sajith Sasidharan
0f118bdd67 Return error page from unlinked 2020-09-22 12:23:40 -04:00
Chad Whitacre
0b6b4b69e9 Port test_immutable to Python 3 2020-09-22 08:36:39 -04:00
Sajith Sasidharan
136a70217c Remove unused import 2020-09-21 20:44:49 -04:00
Sajith Sasidharan
fd5436b867 Expect ErrorPage in RenderSlashUri tests 2020-09-21 18:34:53 -04:00
Sajith Sasidharan
18e56e41fc Return error page when an exception is raised from web.check_results 2020-09-21 18:18:29 -04:00
Sajith Sasidharan
20101f8146 Return ErrorPage when an exception is raised in web.status 2020-09-21 16:51:27 -04:00
Sajith Sasidharan
c16cf00c6b Return an error page when an exception is raised from web.root 2020-09-21 16:37:36 -04:00
Sajith Sasidharan
e8f7643a8f Return ErrorPage when web.operations raises an exception 2020-09-21 16:26:51 -04:00
Sajith Sasidharan
c34dc78875 Merge 'origin/master' into 3423.return-errorpage-from-filenode 2020-09-21 16:22:57 -04:00
Jean-Paul Calderone
58c99d0c0c
Merge pull request #815 from tahoe-lafs/3422.directory-weberror
Handle exceptions raised by getChild and render_* in directory.py

Fixes: ticket:3422
2020-09-21 16:04:39 -04:00
Jean-Paul Calderone
0e139114f7 add a limited amount of missing test coverage for humanize_exception 2020-09-21 14:07:11 -04:00
Sajith Sasidharan
199fbfcc1c Return error pages when an exception is raised in filenode 2020-09-21 13:24:01 -04:00
Itamar Turner-Trauring
40b4244146 Port to Python 3. 2020-09-21 13:21:19 -04:00
Itamar Turner-Trauring
6fe68c792c Tests pass on Python 2 and 3. 2020-09-21 13:21:19 -04:00
Itamar Turner-Trauring
0cee40c009 Even more progress towards test_upload on Python 3. 2020-09-21 13:21:19 -04:00
Itamar Turner-Trauring
125a6855d6 More progress towards test_upload on Python 3. 2020-09-21 13:21:19 -04:00
Itamar Turner-Trauring
9f00343478 Some progress towards test_upload running on Python 3. 2020-09-21 13:21:19 -04:00
Sajith Sasidharan
c674198074 Rearrage imports 2020-09-21 13:03:51 -04:00
Itamar Turner-Trauring
139bcb1500
Merge pull request #814 from tahoe-lafs/3419.test-encode-python-3-trying-again
Port test_encode to Python 3

Fixes ticket:3419
2020-09-21 11:52:34 -04:00
Itamar Turner-Trauring
7c6e3104ac
Merge pull request #812 from tahoe-lafs/3416.test-encode-python-3
Port allmydata.test.no_network to Python 3

Fixes ticket:3416
2020-09-21 11:51:34 -04:00
Itamar Turner-Trauring
a4da6c3dbe Clarify comment. 2020-09-21 10:35:56 -04:00
Itamar Turner-Trauring
02b4ec8101 Get rid of stray print(). 2020-09-21 10:33:16 -04:00
Jean-Paul Calderone
b200d20430 minor cleanups/rearranging 2020-09-18 15:01:53 -04:00
Jean-Paul Calderone
97872118a5 derived function below 2020-09-18 14:50:45 -04:00
Jean-Paul Calderone
e648965fb6 Add helpers to implement the desired exception behavior and use them 2020-09-18 14:49:19 -04:00
Itamar Turner-Trauring
8ef2252bd4 Finish porting to Python 3. 2020-09-18 14:32:19 -04:00
Itamar Turner-Trauring
c3bb367a93 Tests pass on Python 3. 2020-09-18 14:31:23 -04:00
Itamar Turner-Trauring
050388ee12 Work better on Python 3, until Nevow is gone. 2020-09-18 14:31:21 -04:00
Jean-Paul Calderone
059bb2250b Add a BadRequest resource to help with BAD REQUEST 2020-09-18 14:10:09 -04:00
Itamar Turner-Trauring
cb24c3eccf Merge branch '3416.test-encode-python-3' into 3419.test-encode-python-3-trying-again 2020-09-18 13:38:44 -04:00
Itamar Turner-Trauring
a0ff941fff Try to fix Python 3 again. 2020-09-18 13:36:54 -04:00
Itamar Turner-Trauring
e75beb6eae
Merge pull request #811 from tahoe-lafs/3415.storage-server-python-3
Port allmydata.storage.server to Python 3

Fixes ticket:3415
2020-09-18 13:32:36 -04:00
Jean-Paul Calderone
9682e68528
Merge pull request #805 from jaraco/3408.print-functions
Convert print statements to print functions, even when commented

Fixes: ticket:3408
2020-09-18 12:59:44 -04:00
Itamar Turner-Trauring
7b302871e4 Python 2 tests pass again. 2020-09-18 11:41:28 -04:00
Itamar Turner-Trauring
c5ce988c7e Merge branch '3416.test-encode-python-3' into 3419.test-encode-python-3-trying-again 2020-09-18 11:33:15 -04:00
Itamar Turner-Trauring
1a4744d1f7 Merge branch '3415.storage-server-python-3' into 3416.test-encode-python-3 2020-09-18 11:32:45 -04:00
Itamar Turner-Trauring
02cb451a6b Fix failing tests. 2020-09-17 16:06:26 -04:00
Itamar Turner-Trauring
3d79793ee8 Try to fix hashutil. 2020-09-17 15:38:08 -04:00
Itamar Turner-Trauring
6c85f392dd Fix another future newbytes leak that was breaking Foolscap. 2020-09-17 13:39:47 -04:00
Itamar Turner-Trauring
b784f9654c Merge branch '3415.storage-server-python-3' into 3416.test-encode-python-3 2020-09-17 13:12:46 -04:00
Itamar Turner-Trauring
9818512802 Fix newbytes leak. 2020-09-17 13:10:52 -04:00
Itamar Turner-Trauring
03fd566e2c Fix flake error. 2020-09-17 12:37:10 -04:00
Itamar Turner-Trauring
cecbc260fa Fix order. 2020-09-17 11:43:35 -04:00
Itamar Turner-Trauring
498e69c72e Some progress. 2020-09-16 14:57:55 -04:00
Itamar Turner-Trauring
2588e757e5 Only semi-break the web service. 2020-09-16 14:42:39 -04:00
Itamar Turner-Trauring
833bc72ac3 Merge remote-tracking branch 'origin/master' into 3416.test-encode-python-3 2020-09-16 14:40:40 -04:00
Itamar Turner-Trauring
e8743a607f Fix failing tests. 2020-09-16 14:37:16 -04:00
Itamar Turner-Trauring
bea1d657f3 Better debug output. 2020-09-16 14:37:11 -04:00
Itamar Turner-Trauring
b4116239b5 Merge remote-tracking branch 'origin/master' into 3415.storage-server-python-3 2020-09-16 11:27:03 -04:00
Itamar Turner-Trauring
7cb574f7c5 Port to Python 3. 2020-09-16 11:23:11 -04:00
Itamar Turner-Trauring
985e8a0244 More Python 3 changes. 2020-09-16 11:21:17 -04:00
Itamar Turner-Trauring
c035ea0698 It's better if extension keys are unicode (native strings for Python 3, same key
as bytes on Python 2) so as not to modify lots and lots and lots of code.
2020-09-16 11:20:08 -04:00
Itamar Turner-Trauring
7d8320b843 Python 3 fixes. 2020-09-16 11:13:23 -04:00
Sajith Sasidharan
0ca3192640 Merge 'origin/master' into 3382.remove-multi-format-page 2020-09-15 18:25:07 -04:00
Itamar Turner-Trauring
a552bb53a7 Merge remote-tracking branch 'origin/master' into 3409.allmydata-storage-immutable-python-3 2020-09-15 09:05:55 -04:00
Itamar Turner-Trauring
65d38055e4 Merge branch '3409.allmydata-storage-immutable-python-3' into 3415.storage-server-python-3 2020-09-14 14:48:24 -04:00
Itamar Turner-Trauring
31aa594290 Looks like float is fine for mean. 2020-09-14 14:47:26 -04:00
Itamar Turner-Trauring
d84a7a61f3 Port to Python 3. 2020-09-14 14:46:08 -04:00
Itamar Turner-Trauring
947cb1c11b Tiny bit more test coverage for server.py. 2020-09-14 14:40:02 -04:00
Itamar Turner-Trauring
1d508c74e8 Port to Python 3. 2020-09-14 14:13:07 -04:00
Itamar Turner-Trauring
6196a1c650 Port to Python 3. 2020-09-14 14:06:27 -04:00
Itamar Turner-Trauring
aef293fbca Port to Python 3. 2020-09-14 14:04:02 -04:00
Itamar Turner-Trauring
6983c79b26 Tests for allmydata.storage.common. 2020-09-14 14:03:02 -04:00
Itamar Turner-Trauring
4590c1d1f5 Port to Python 3. 2020-09-14 13:56:45 -04:00
Itamar Turner-Trauring
26a8a0bfc5 Make stats code deal with keys that are unicode. 2020-09-14 13:29:28 -04:00
Itamar Turner-Trauring
7de84e32a3 Port to Python 3. 2020-09-11 15:02:42 -04:00
Itamar Turner-Trauring
e86e0d761f Better test coverage for allmydata.storage.immutable. 2020-09-11 14:51:08 -04:00
Jason R. Coombs
5a40bf47f4 Convert print statements to print functions, even when commented. Fixes #3408. 2020-09-11 14:50:44 -04:00
Sajith Sasidharan
89d354dd66 Remove unused WebError import 2020-09-10 10:54:44 -04:00