The Tahoe-LAFS decentralized secure filesystem.
Go to file
Ross Patterson baa36157b6 feat(py3): Update Python internal data model refs
As of Python 2.7, some of [the `func_*` and `im_*` attributes also can be accessed
through their corresponding `__*__` attributes for Python 3
compatibility](https://docs.python.org/2/reference/datamodel.html?highlight=__self__#the-standard-type-hierarchy).
I searched for all such occurrences and this is all that needed changing AFAICT.

Converts 9 test errors to errors with new exceptions and improves Python 3 test coverage
a smidge:

```diff
--- ../../.tox/make-test-py3-all-old.log	2020-10-04 15:16:34.054975263 -0700
+++ ../../.tox/make-test-py3-all-new.log	2020-10-04 15:59:59.355692613 -0700
@@ -2273,9 +2273,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.test_node.IntroducerNotListening.test_port_none_introducer
@@ -5935,9 +5935,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.test_client.Basic.test_web_apiauthtoken
 ===============================================================================
@@ -7146,9 +7146,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.test_introducer.Node.test_create
@@ -7171,9 +7171,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.test_introducer.Node.test_furl
@@ -7550,9 +7550,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.test_node.TestCase.test_logdir_is_str
 ===============================================================================
@@ -8448,9 +8448,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.test_system.Connections.test_rref
 allmydata.test.test_system.SystemTest.test_filesystem
@@ -8567,9 +8567,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.web.test_introducer.IntroducerWeb.test_basic_information
 ===============================================================================
@@ -8589,9 +8589,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.web.test_introducer.IntroducerWeb.test_json_front_page
 ===============================================================================
@@ -8611,9 +8611,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.web.test_introducer.IntroducerWeb.test_tahoe_css
 ===============================================================================
@@ -8633,9 +8633,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'

 allmydata.test.web.test_introducer.IntroducerWeb.test_welcome
 ===============================================================================
@@ -8742,9 +8742,9 @@
     node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 734, in __init__
     self.setup_logging()
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 824, in setup_logging
-    ob = o.im_self
-builtins.AttributeError: 'function' object has no attribute 'im_self'
+  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 826, in setup_logging
+    newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
+builtins.AttributeError: module 'types' has no attribute 'UnboundMethodType'
 + test_exit=1
 + ./.tox/py36-coverage/bin/coverage combine
 + ./.tox/py36-coverage/bin/coverage html
@@ -8802,7 +8802,7 @@
 src/allmydata/mutable/repairer.py                       57     37     18      0    29%   13, 15, 17, 19, 29-34, 65-71, 74-126, 129-131
 src/allmydata/mutable/retrieve.py                      489    123    120     33    71%   46, 48, 50, 52, 56, 58, 60, 62, 64, 89-90, 133, 186-193, 204-208, 211-212, 224-226, 231, 240, 251, 312, 318, 344-354, 377, 385-386, 399-400, 425-434, 490, 501, 515-516, 529-540, 564-578, 591-592, 629-630, 653-654, 674-675, 681-682, 698, 712-729, 758-760, 765, 772-774, 790-792, 871, 883, 909-910, 919-941, 965-966, 981-994, 999-1005, 129->133, 167->169, 169->171, 201->204, 223->224, 230->231, 237->239, 239->240, 243->247, 249->251, 309->312, 317->318, 376->377, 381->385, 391->394, 396->399, 424->425, 489->490, 499->501, 514->515, 590->591, 628->629, 652->653, 673->674, 677->687, 680->681, 687->694, 694->698, 755->764, 764->765, 868->871, 880->883, 964->965
 src/allmydata/mutable/servermap.py                     612    240    186     26    56%   45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 74, 130-139, 142, 148, 159-161, 175, 177, 183, 186-199, 206, 213, 217-220, 231, 234-238, 243-252, 255-259, 315, 328-350, 358-363, 370-372, 379, 429, 433, 443-447, 495, 498, 506-508, 514-516, 569-570, 603-611, 623-638, 718-721, 732-741, 792, 796, 803-804, 850-851, 872-874, 911-915, 929-945, 961-975, 982-999, 1003-1013, 1043-1045, 1050-1052, 1060-1064, 1069-1070, 1093-1100, 1106-1186, 1214-1215, 1232-1233, 313->315, 427->429, 432->433, 439->443, 459->461, 493->495, 497->498, 504->506, 509->514, 566->569, 597->603, 687->exit, 702->exit, 710->exit, 717->718, 727->732, 759->exit, 791->792, 795->796, 869->872, 1039->1043, 1047->1050, 1059->1060, 1066->1069, 1092->1093, 1213->1214
-src/allmydata/node.py                                  388     84    146     33    75%   120, 132, 190, 241, 243-245, 278, 284, 294-295, 303-306, 315, 320, 339, 341, 361, 393-396, 422, 449, 453, 490, 493, 500, 511-512, 548, 566, 574, 581, 583, 590-591, 601, 612, 629-633, 679, 681, 738-741, 747, 756, 764, 792-805, 808-809, 814-815, 825-846, 189->190, 240->241, 242->243, 277->278, 314->315, 319->320, 338->339, 340->341, 360->361, 391->393, 421->422, 448->449, 451->453, 489->490, 492->493, 499->500, 510->511, 547->548, 565->566, 573->574, 580->581, 582->583, 589->590, 600->601, 611->612, 622->629, 673->679, 680->681, 737->738, 746->747, 763->764, 821->830, 823->821
+src/allmydata/node.py                                  388     82    146     33    76%   120, 132, 190, 241, 243-245, 278, 284, 294-295, 303-306, 315, 320, 339, 341, 361, 393-396, 422, 449, 453, 490, 493, 500, 511-512, 548, 566, 574, 581, 583, 590-591, 601, 612, 629-633, 679, 681, 738-741, 747, 756, 764, 792-805, 808-809, 814-815, 827-846, 189->190, 240->241, 242->243, 277->278, 314->315, 319->320, 338->339, 340->341, 360->361, 391->393, 421->422, 448->449, 451->453, 489->490, 492->493, 499->500, 510->511, 547->548, 565->566, 573->574, 580->581, 582->583, 589->590, 600->601, 611->612, 622->629, 673->679, 680->681, 737->738, 746->747, 763->764, 821->830, 823->821
 src/allmydata/nodemaker.py                              97     23     38     10    70%   49, 61, 66, 70, 81, 94, 107-115, 130-138, 141-150, 57->61, 65->66, 69->70, 79->81, 86->95, 90->94, 104->107, 124->exit, 129->130, 129->133
 src/allmydata/scripts/admin.py                          51     20      2      1    60%   9-14, 25, 28, 31-37, 40-46, 57, 59, 61-66, 56->57
 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
@@ -8899,7 +8899,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                                                27477  11800   8244    605    54%
+TOTAL                                                27477  11798   8244    605    54%

 18 files skipped due to complete coverage.
 + '[' '!' -z 1 ']'
```
2020-10-04 16:01:32 -07:00
.circleci Add comment 2020-09-14 07:38:54 -04:00
.github Remove references to the bare "coverage" tox environment 2020-08-27 10:37:50 -04:00
docs test(vcs): Reconcile devel docs from PR #798 2020-09-30 07:37:52 -07:00
integration Add note on Tor integration test failures on Windows 2020-07-21 14:59:04 -04:00
misc test(py3): Add diff tests convenience targets 2020-09-30 12:14:06 -07:00
newsfragments feat(py3): Cleanup redundant string cast 2020-10-04 15:57:01 -07:00
nix Try to fix nix. 2020-07-28 13:00:44 -04:00
release-tools refactor more 2018-05-29 13:17:32 -06:00
src/allmydata feat(py3): Update Python internal data model refs 2020-10-04 16:01:32 -07:00
static Eliminate mock dependency. 2015-07-17 22:12:25 +01:00
.codecov.yml Mention known issue with non-determinism in coverage data 2020-09-08 16:07:46 -04:00
.coveragerc test(coverage): Include human-readable coverage report 2020-09-24 11:37:37 -07:00
.gitignore test(vcs): Reconcile devel docs from PR #798 2020-09-30 07:37:52 -07:00
.lgtm.yml Disable another lgtm query. 2018-04-26 15:41:38 -04:00
.pre-commit-config.yaml test(vcs): Add a VCS commit hook to run linters 2020-09-27 09:44:13 -07:00
COPYING.GPL Fix repeated 'the' in license text. 2011-08-19 13:48:36 -07:00
COPYING.TGPPL.rst magic first line tells emacs to use utf8+bom 2013-11-08 21:08:05 +00:00
CREDITS a couple additions to CREDITS 2018-05-18 14:41:48 -06:00
docker-compose.yml add dockerfile for hacking with docker compose file for local environment 2017-09-19 09:25:39 -07:00
Dockerfile Remove $HOME/.cache/ directory after building. 2016-09-26 15:19:04 -07:00
Dockerfile.dev add dockerfile for hacking with docker compose file for local environment 2017-09-19 09:25:39 -07:00
Makefile Merge branch 'master' into 3448.convert-only-unicode-to-str 2020-09-30 11:50:42 -07:00
MANIFEST.in setup.py/MANIFEST.in: include missing files 2017-01-18 16:28:23 -08:00
NEWS.rst update title 2020-03-11 18:41:32 -06:00
pyinstaller.spec Additional hidden imports due to use of Future. 2020-07-03 13:44:47 -04:00
README.rst add some alt text 2020-07-07 09:19:30 -04:00
relnotes.txt bump version to 1.14.0 and update release notes 2020-03-11 17:38:03 -06:00
setup.cfg Add a codecheck for tabs in indentation 2020-08-03 21:14:55 -04:00
setup.py Merge branch 'master' into 3394.py38-tests 2020-09-09 21:42:32 -04:00
Tahoe.home rename bin/allmydata-tahoe to bin/tahoe. Closes #155. 2007-10-11 03:38:24 -07:00
towncrier.pyproject.toml Fix the issue links 2020-02-07 09:27:02 -05:00
tox.ini fix(ci): Remove use of make for Windows CI runs 2020-09-30 10:14:32 -07:00
ws_client.py move to different url 2019-03-21 15:00:02 -04:00

Tahoe-LAFS

Tahoe-LAFS is a Free and Open decentralized cloud storage system. It distributes your data across multiple servers. Even if some of the servers fail or are taken over by an attacker, the entire file store continues to function correctly, preserving your privacy and security.

For full documentation, please see http://tahoe-lafs.readthedocs.io/en/latest/ .

code of conduct documentation status build status circleci test coverage percentage

INSTALLING

There are three ways to install Tahoe-LAFS.

using OS packages

Pre-packaged versions are available for several operating systems:

  • Debian and Ubuntu users can apt-get install tahoe-lafs
  • NixOS, NetBSD (pkgsrc), ArchLinux, Slackware, and Gentoo have packages available, see OSPackages for details
  • Mac and Windows installers are in development.

via pip

If you don't use an OS package, you'll need Python 2.7 and pip. You may also need a C compiler, and the development headers for python, libffi, and OpenSSL. On a Debian-like system, use apt-get install build-essential python-dev libffi-dev libssl-dev python-virtualenv. On Windows, see docs/windows.rst.

Then, to install the most recent release, just run:

  • pip install tahoe-lafs

from source

To install from source (either so you can hack on it, or just to run pre-release code), you should create a virtualenv and install into that:

  • git clone https://github.com/tahoe-lafs/tahoe-lafs.git
  • cd tahoe-lafs
  • virtualenv --python=python2.7 venv
  • venv/bin/pip install --upgrade setuptools
  • venv/bin/pip install --editable .
  • venv/bin/tahoe --version

To run the unit test suite:

  • tox

You can pass arguments to trial with an environment variable. For example, you can run the test suite on multiple cores to speed it up:

  • TAHOE_LAFS_TRIAL_ARGS="-j4" tox

For more detailed instructions, read docs/INSTALL.rst .

Once tahoe --version works, see docs/running.rst to learn how to set up your first Tahoe-LAFS node.

LICENCE

Copyright 2006-2018 The Tahoe-LAFS Software Foundation

You may use this package under the GNU General Public License, version 2 or, at your option, any later version. You may use this package under the Transitive Grace Period Public Licence, version 1.0, or at your option, any later version. (You may choose to use this package under the terms of either licence, at your option.) See the file COPYING.GPL for the terms of the GNU General Public License, version 2. See the file COPYING.TGPPL for the terms of the Transitive Grace Period Public Licence, version 1.0.

See TGPPL.PDF for why the TGPPL exists, graphically illustrated on three slides.