Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PY3: safeguard __del__ in Annex and Git Repo to not breed useless exceptions #3527

Merged
merged 2 commits into from Jul 16, 2019

Conversation

@yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Jul 12, 2019

as e.g. reported in datalad/datalad-crawler#47


def safe__del__debug(e):
"""We might be too late in the game and either .debug or exc_str
are no longer bound"""
Copy link
Contributor

@kyleam kyleam Jul 12, 2019

Only an AttributeError is caught below. If exc_str() was no longer bound, wouldn't that be a NameError?

Copy link
Member Author

@yarikoptic yarikoptic Jul 15, 2019

good question... may be? let me add it as well just in case ;-) thanks!

Copy link
Member Author

@yarikoptic yarikoptic Jul 15, 2019

although I do not think local binds disappear first... at least I can't recall if I ran into such before. But shouldn't hurt - pushed 59d7d48

Copy link
Contributor

@kyleam kyleam Jul 15, 2019

OK, thanks. If exc_str is not a known problem, of course it'd be fine to just remove the false information from the docstring. But not a big deal either way.

Copy link
Member Author

@yarikoptic yarikoptic Jul 15, 2019

ah, I see ! thanks for spotting that -- I forgot that I wrote it ;)

@codecov
Copy link

@codecov codecov bot commented Jul 12, 2019

Codecov Report

Merging #3527 into 0.11.x will increase coverage by 23.89%.
The diff coverage is 12.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           0.11.x   #3527       +/-   ##
==========================================
+ Coverage   57.61%   81.5%   +23.89%     
==========================================
  Files          94     255      +161     
  Lines       14966   33573    +18607     
==========================================
+ Hits         8622   27365    +18743     
+ Misses       6344    6208      -136
Impacted Files Coverage Δ
datalad/support/gitrepo.py 69.17% <0%> (+3.65%) ⬆️
datalad/support/annexrepo.py 60.88% <14.28%> (+16.44%) ⬆️
datalad/downloaders/tests/utils.py 92.3% <0%> (ø)
datalad/customremotes/tests/__init__.py 100% <0%> (ø)
datalad/cmdline/tests/test_helpers.py 100% <0%> (ø)
datalad/support/tests/test_stats.py 100% <0%> (ø)
datalad/tests/test_utils.py 96.49% <0%> (ø)
datalad/metadata/extractors/__init__.py 100% <0%> (ø)
datalad/distribution/tests/test_dataset_binding.py 100% <0%> (ø)
datalad/tests/test_misc.py 90.47% <0%> (ø)
... and 196 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91c09ba...59d7d48. Read the comment docs.

kyleam
kyleam approved these changes Jul 15, 2019
@yarikoptic yarikoptic merged commit 938603d into datalad:0.11.x Jul 16, 2019
4 of 5 checks passed
@yarikoptic yarikoptic added this to the Release 0.11.6 milestone Jul 26, 2019
yarikoptic added a commit that referenced this issue Jul 31, 2019
0.11.6 (Jul 30, 2019) -- am I the last of 0.11.x?

Primarily bug fixes to achieve more robust performance

Fixes

- Our tests needed various adjustments to keep up with upstream
  changes in Travis and Git. ([#3479][]) ([#3492][]) ([#3493][])

- `AnnexRepo.is_special_annex_remote` was too selective in what it
  considered to be a special remote.  ([#3499][])

- We now provide information about unexpected output when git-annex is
  called with `--json`.  ([#3516][])

- Exception logging in the `__del__` method of `GitRepo` and
  `AnnexRepo` no longer fails if the names it needs are no longer
  bound.  ([#3527][])

- [addurls][] botched the construction of subdataset paths that were
  more than two levels deep and failed to create datasets in a
  reliable, breadth-first order.  ([#3561][])

- Cloning a `type=git` special remote showed a spurious warning about
  the remote not being enabled.  ([#3547][])

Enhancements and new features

- For calls to git and git-annex, we disable automatic garbage
  collection due to past issues with GitPython's state becoming stale,
  but doing so results in a larger .git/objects/ directory that isn't
  cleaned up until garbage collection is triggered outside of DataLad.
  Tests with the latest GitPython didn't reveal any state issues, so
  we've re-enabled automatic garbage collection.  ([#3458][])

- [rerun][] learned an `--explicit` flag, which it relays to its calls
  to [run][[]].  This makes it possible to call `rerun` in a dirty
  working tree ([#3498][]).

- The [metadata][] command aborts earlier if a metadata extractor is
  unavailable.  ([#3525][])

* tag '0.11.6': (56 commits)
  [DATALAD RUNCMD] make update-changelog
  finalize CHANGELOG.md entry and boost version
  BF(DOC): close [create] with [] to not cause WARNING by md-strict pandoc
  CHANGELOG.md: Link entry from b3e8adb
  CHANGELOG.md: Add entry for gh-3547
  CHANGELOG.md: Add entry for gh-3561
  CHANGELOG.md: Add link for addurls
  RF: inform about special remotes based on autoenable config
  CHANGELOG.md: Second batch for 0.11.6
  BF: addurls: Process datasets in a stable, breadth-first order
  BF: addurls: Fix construction of nested subpaths
  TST: addurls: Don't hard-code path separator
  BF(TST): skip test_v7_detached_get in direct mode - fails to annex upgrade
  TST: benchmark-travis-pr: Swap 'pip install' and 'git show'
  TST: benchmark-travis-pr: Move repeated logic to run_asv()
  TST: benchmark-travis-pr: Support other bases
  TST: benchmark-travis-pr: Tweak message about current HEAD
  TST: benchmark-travis-pr: Simplify two git commands into one
  TST: benchmark-travis-pr: Reorder and break up lines
  TST: benchmark-travis-pr: Move command for running asv into function
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants