Commit Graph

247 Commits

Author SHA1 Message Date
francois
968edfda11 iputil.py: Add support for FreeBSD 7,8 and 9
committed by: zooko@zooko.com
date: 2010-07-17
and I also patched: NEWS and CREDITS
2010-07-17 19:28:32 -07:00
david-sarah
752897450d fileutil: docstrings for non-obvious usage restrictions on methods of EncryptedTemporaryFile. 2010-07-16 22:46:47 -07:00
david-sarah
05022dca36 Move EncryptedTemporaryFile from SFTP frontend to allmydata.util.fileutil, and make the FTP frontend also use it (fixing #1083). 2010-07-11 14:37:21 -07:00
david-sarah
a8161c915a Correct stringutils->encodingutil patch to be the newer version, rather than the old version that was committed in error. 2010-07-17 18:34:35 -07:00
david-sarah
11077ea74d Rename stringutils to encodingutil, and drop listdir_unicode and open_unicode (since the Python stdlib functions work fine with Unicode paths). Also move some utility functions to fileutil. 2010-07-11 17:30:15 -07:00
david-sarah
b8df25a8d1 stringutils.py: tolerate sys.stdout having no 'encoding' attribute. 2010-06-25 21:08:17 -07:00
david-sarah
7e7644589a stringutils.py: remove unused import. 2010-06-16 20:44:40 -07:00
david-sarah
9f5488b2d1 stringutils.py: don't NFC-normalize the output of listdir_unicode. 2010-06-16 18:55:37 -07:00
david-sarah
e2c7ad1d88 stringutils.py: Add encoding argument to quote_output. Also work around a bug in locale.getpreferredencoding on older Pythons. 2010-06-15 21:20:12 -07:00
david-sarah
ffd1c5aca5 Fix for Unicode-related test failures on Zooko's OS X 10.6 machine. 2010-06-08 22:54:48 -07:00
david-sarah
80a89d3931 stringutils.py, sftpd.py: Portability fixes for Python <= 2.5. 2010-06-08 18:33:02 -07:00
david-sarah
32d9deace3 Back out Windows-specific Unicode argument support for v1.7. 2010-06-08 17:08:03 -07:00
david-sarah
80252debcd Unicode fixes. 2010-06-06 18:02:15 -07:00
Zooko O'Whielacronx
db8a6f3aa6 unicode: make test_cli test a non-ascii argument, and make the fallback term encoding be locale.getpreferredencoding() 2010-06-04 07:12:51 -07:00
Francois Deppierraz
d0ed14e1bb stringutils.py: Unicode helper functions + associated tests
This file contains a bunch of helper functions which converts
unicode string from and to argv, filenames and stdout.
2010-05-19 17:41:05 -07:00
david-sarah
e76092e16c Change relative imports to absolute 2010-02-26 01:14:33 -07:00
Kevan Carstensen
e225f573b9 Fix up the behavior of #778, per reviewers' comments
- Make some important utility functions clearer and more thoroughly 
    documented.
  - Assert in upload.servers_of_happiness that the buckets attributes
    of PeerTrackers passed to it are mutually disjoint.
  - Get rid of some silly non-Pythonisms that I didn't see when I first
    wrote these patches.
  - Make sure that should_add_server returns true when queried about a 
    shnum that it doesn't know about yet.
  - Change Tahoe2PeerSelector.preexisting_shares to map a shareid to a set
    of peerids, alter dependencies to deal with that.
  - Remove upload.should_add_servers, because it is no longer necessary
  - Move upload.shares_of_happiness and upload.shares_by_server to a utility
    file.
  - Change some points in Tahoe2PeerSelector.
  - Compute servers_of_happiness using a bipartite matching algorithm that 
    we know is optimal instead of an ad-hoc greedy algorithm that isn't.
  - Change servers_of_happiness to just take a sharemap as an argument,
    change its callers to merge existing_shares and used_peers before 
    calling it.
  - Change an error message in the encoder to be more appropriate for 
    servers of happiness.
  - Clarify the wording of an error message in immutable/upload.py
  - Refactor a happiness failure message to happinessutil.py, and make
    immutable/upload.py and immutable/encode.py use it.
  - Move the word "only" as far to the right as possible in failure 
    messages.
  - Use a better definition of progress during peer selection.
  - Do read-only peer share detection queries in parallel, not sequentially.
  - Clean up logging semantics; print the query statistics whenever an
    upload is unsuccessful, not just in one case.
2010-05-13 17:49:17 -07:00
Zooko O'Whielacronx
80ae6f2706 setup: fix error in licensing declaration from Shawn Willden, as noted by the FSF compliance division 2010-03-09 08:37:36 -08:00
david-sarah
c984a09fe7 Fix race conditions and missing callback in allmydata.test.test_cli.Cp.test_copy_using_filecap, add utilities for one-liner reading and writing of files, and fix cases in test_cli where files were not being closed after writing. 2010-02-05 17:37:27 -08:00
Brian Warner
731d15e56f hush pyflakes-0.4.0 warnings: remove trivial unused variables. For #900. 2010-01-14 14:15:29 -08:00
Brian Warner
d888bf3377 Clean up log.err calls, for one of the issues in #889.
allmydata.util.log.err() either takes a Failure as the first positional
argument, or takes no positional arguments and must be invoked in an
exception handler. Fixed its signature to match both foolscap.logging.log.err
and twisted.python.log.err . Included a brief unit test.
2010-01-11 17:33:43 -08:00
Brian Warner
bacb6fe5aa tidy up DeadReferenceError handling, ignore them in add_lease calls
Stop checking separately for ConnectionDone/ConnectionLost, since those have
been folded into DeadReferenceError since foolscap-0.3.1 . Write
rrefutil.trap_deadref() in terms of rrefutil.trap_and_discard() to improve
code coverage.
2010-01-11 16:07:23 -08:00
Brian Warner
a4a6c02ef8 more #859: avoid deprecation warning for unit tests too, hush pyflakes
* factor maybe-import-sha logic into util.hashutil
2009-12-14 16:01:47 -08:00
Zooko O'Whielacronx
4706859967 setup: ignore _darcs in the "test-clean" test and make the "clean" step remove all .egg's in the root dir 2009-12-06 10:48:35 -08:00
Brian Warner
96834da0a2 Simplify immutable download API: use just filenode.read(consumer, offset, size)
* remove Downloader.download_to_data/download_to_filename/download_to_filehandle
* remove download.Data/FileName/FileHandle targets
* remove filenode.download/download_to_data/download_to_filename methods
* leave Downloader.download (the whole Downloader will go away eventually)
* add util.consumer.MemoryConsumer/download_to_data, for convenience
  (this is mostly used by unit tests, but it gets used by enough non-test
   code to warrant putting it in allmydata.util)
* update tests
* removes about 180 lines of code. Yay negative code days!

Overall plan is to rewrite immutable/download.py and leave filenode.read() as
the sole read-side API.
2009-12-01 17:53:30 -05:00
Brian Warner
9901a08fd3 Add dirnodes to backupdb and "tahoe backup", closes #606.
* backups now share dirnodes with any previous backup, in any location,
  so renames and moves are handled very efficiently
* "tahoe backup" no longer bothers reading the previous snapshot
* if you switch grids, you should delete ~/.tahoe/private/backupdb.sqlite,
  to force new uploads of all files and directories
2009-11-26 15:42:57 -08:00
Brian Warner
41bcc9f39e PipelineError: fix str() on python2.4 . Closes #842. 2009-11-24 13:25:12 -08:00
Brian Warner
ea373de042 move dirnode.CachingDict to dictutil.AuxValueDict, generalize method names,
improve tests. Let dirnode _pack_children accept either dict or AuxValueDict.
2009-10-17 11:00:05 -07:00
Zooko O'Whielacronx
00a44c057a docs: a few licensing clarifications requested by Ubuntu 2009-09-26 20:32:26 -07:00
Zooko O'Whielacronx
aaaa633f18 setup: remove a convenience copy of figleaf, to ease inclusion into Ubuntu Karmic Koala
We need to carefully document the licence of figleaf in order to get Tahoe-LAFS into Ubuntu Karmic Koala.  However, figleaf isn't really a part of Tahoe-LAFS per se -- this is just a "convenience copy" of a development tool.  The quickest way to make Tahoe-LAFS acceptable for Karmic then, is to remove figleaf from the Tahoe-LAFS tarball itself.  People who want to run figleaf on Tahoe-LAFS (as everyone should want) can install figleaf themselves.  I haven't tested this -- there may be incompatibilities between upstream figleaf and the copy that we had here...
2009-09-23 22:32:15 -07:00
Zooko O'Whielacronx
9f0da4012e docs: Shawn Willden grants permission for his contributions under GPL2+|TGPPL1+ 2009-09-21 09:46:51 -07:00
Zooko O'Whielacronx
603e08c4a9 doc: licensing cleanups
Use nice utf-8 © instead of "(c)". Remove licensing statements on utility modules that have been assigned to allmydata.com by their original authors. (Nattraverso was not assigned to allmydata.com -- it was LGPL'ed -- but I checked and src/allmydata/util/iputil.py was completely rewritten and doesn't contain any line of code from nattraverso.)  Add notes to misc/debian/copyright about licensing on files that aren't just allmydata.com-licensed.
2009-09-20 10:16:31 -07:00
Zooko O'Whielacronx
2a63fc9159 docs: update relnotes.txt, relnotes-short.txt, and others documentation bits for v1.5.0 release! 2009-08-01 19:57:10 -07:00
Zooko O'Whielacronx
b76ca4549a iputil: added "openbsd3" => "bsd" and "openbsd4" => "bsd" per tdelaet's report; should fix ticket #768 2009-07-20 06:13:14 -07:00
Zooko O'Whielacronx
7607268a58 trivial: remove obsolete comment text 2009-07-20 06:08:43 -07:00
Zooko O'Whielacronx
2f704ed001 dirnode: finish renaming "iv" to "salt" in the code and the hash tag 2009-07-12 17:13:20 -07:00
Zooko O'Whielacronx
786ed012b3 directories: make the IV for the writecaps in directory entries be computed from the secure hash of the writecap itself
This makes encoding of directory entries deterministic, and it is also a tad faster on Macbook Pro than getting a random IV with os.urandom(16).
2009-07-04 19:48:15 -07:00
Zooko O'Whielacronx
fcedca966e tests: raise the timeout on pollmixin from 100s to 1000s -- it looks like it may have triggered too eagerly on Zandr's 266 MHz armel 2009-07-08 21:47:29 -07:00
Zooko O'Whielacronx
efafcfb91a directories: keep track of your position as you decode netstring after netstring from an input buffer instead of copying the trailing part
This makes decoding linear in the number of netstrings instead of O(N^2).
2009-07-04 19:51:09 -07:00
Brian Warner
c6ae255847 remove trailing whitespace 2009-06-29 13:03:58 -07:00
Brian Warner
dddc2d0378 remove trailing whitespace from some util classes 2009-06-29 13:03:41 -07:00
midnightmagic
96cda877ff Basically just a trivial platform detection patch for NetBSD. 2009-06-17 16:36:47 -07:00
Brian Warner
aa23ff9180 rrefutil: add trap_deafref utility, to make the callRemote-plus-ignore-DeadReferenceError-plug-log-other-errors pattern easier 2009-06-22 19:08:26 -07:00
Brian Warner
699510c8f1 PollMixin: snoop trial's error observer to halt the test early if an error is seen. This turns a lot of timeouts into fast failures. 2009-06-22 19:07:31 -07:00
Zooko O'Whielacronx
cc2953e663 util: hooray! A clean implementation of this simple utility! Black Dew pointed out that the inverse of time.gmtime() is hidden in the "calendar" module. 2009-06-13 09:01:12 -07:00
Zooko O'Whielacronx
45928315f6 util: Brian's horrible hack to figure out how much localtime and utctime differ. Now we'll see if it works on Windows. 2009-06-12 13:45:56 -07:00
Zooko O'Whielacronx
4a30c5899c util: oops, time.tzset() doesn't work on Windows -- hopefully the new "London" unit test passes on Windows when we skip tzset() on platforms that don't have it 2009-06-11 17:09:20 -07:00
Zooko O'Whielacronx
8978cb0738 util: fix time_format.iso_utc_time_to_seconds() so that it works even in London 2009-06-11 15:11:29 -07:00
Brian Warner
1863aee0aa switch to using RemoteException instead of 'wrapped' RemoteReferences. Should fix #653, the rref-EQ problem 2009-05-21 17:46:32 -07:00
Brian Warner
c9803d5217 switch all foolscap imports to use foolscap.api or foolscap.logging 2009-05-21 17:38:23 -07:00