minor code clean-up in dirnode.py #967
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#967
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I don't want to commit this to trunk until after v1.6.1 release, but please go ahead and review it.
Impose micro-POLA by passing only the writekey instead of the whole node object to
_encrypt_rw_uri()
. Remove DummyImmutableFileNode in nodemaker.py, which is obviated by this. Add micro-optimization by precomputing the netstring of the empty string and branching on whether the writekey is present or not outside of_encrypt_rw_uri()
. Add doc about writekey to docstring.Attachment dirnode-minor-cleanup.darcs.patch.txt (8778 bytes) added
All of the tests pass when the patch is applied.
The changes to _encrypt_rw_uri look good, and you don't appear to have missed any of its callers. I think that the same can be said for pack_children; I don't see any problems with those changes, and you appear to have changed all of its callers that needed changing.
There appears to be trailing whitespace on line 188 of dirnode.py (right after
assert isinstance(rw_uri, str), rw_uri
). Your patch didn't introduce that, but, as long as you're doing code cleanup, you may as well fix it. :)Unless I'm missing something, DummyImmutableFileNode is no longer necessary. If you agree, then you should remove it from nodemaker.py.
Other than that, this looks good.
Heh, then I forgot to commit it and now I don't want to commit it before the v1.7.0 release.
However! I have created a "post-1.7" branch, and I can commit it to that...
changeset:20100221052527-92b7f-3ee334f0e78c3890d3f8b8d2b5d9b440b2a5343d/post-1.7/
Applied your two clean-up suggestions in changeset:20100617045339-92b7f-940b4924686845e26ec03bd6c7d6094beec14c7e/post-1.7. Thanks!
Attachment dirnodecleanup.dpatch.txt (11761 bytes) added
reopen to port to trunk (from the post-1.7 branch) and apply Brian's suggestion from comment:75791. Please review!
Not a bugfix, so not going into 1.7.1.
Applied in changeset:6e8477114e9dfd06. Was that intentional?
FWIW, the port to trunk looks correct.
That was not intentional. I accidentally committed this patch to trunk. Haven't decided yet whether to undo it for 1.7.1 or just leave it.
I checked that your port is equivalent to the similar version that was on the post1.7 branch. (The only difference was whether the writekey argument has a default -- in your version it doesn't, which is better.)