Skip to content

BF: there is no exc variable, raising NotASurrogateError if that is the right thing todo - #598

Merged
Byron merged 1 commit into
gitpython-developers:masterfrom
yarikoptic:bf-exc
Mar 1, 2017
Merged

BF: there is no exc variable, raising NotASurrogateError if that is the right thing todo#598
Byron merged 1 commit into
gitpython-developers:masterfrom
yarikoptic:bf-exc

Conversation

@yarikoptic

@yarikopticyarikoptic commented Feb 28, 2017

Copy link
Copy Markdown
Contributor

a blind fix for a blind (not tested) line of code which has some variable lost from old pre-refactoring code I guess ;)

PS FWIW -- we have managed to run into it in quite a strange place, so not really sure how yet, here is our backtrace with 2.1.0 GitPython on Debian stretch

======================================================================
ERROR: Failure: NameError (global name 'exc' is not defined)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/buildbot/datalad-pr-docker-dl-nd90/build/datalad/tests/test__main__.py", line 17, in <module>
from .. import __main__, __version__
File "/home/buildbot/datalad-pr-docker-dl-nd90/build/datalad/__main__.py", line 13, in <module>
from .auto import AutomagicIO
File "/home/buildbot/datalad-pr-docker-dl-nd90/build/datalad/auto.py", line 20, in <module>
import h5py
File "/usr/lib/python2.7/dist-packages/h5py/__init__.py", line 60, in <module>
from .tests import run_tests
File "/usr/lib/python2.7/dist-packages/h5py/tests/__init__.py", line 15, in <module>
from . import old, hl
File "/usr/lib/python2.7/dist-packages/h5py/tests/old/__init__.py", line 4, in <module>
from . import ( test_attrs,
File "/usr/lib/python2.7/dist-packages/h5py/tests/old/test_group.py", line 41, in <module>
fsencode(u"α")
File "/usr/lib/python2.7/dist-packages/h5py/_hl/compat.py", line 68, in fsencode
return filename.encode(encoding, errors)
File "/usr/lib/python2.7/dist-packages/git/compat.py", line 180, in surrogateescape_handler
decoded = replace_surrogate_encode(mystring)
File "/usr/lib/python2.7/dist-packages/git/compat.py", line 207, in replace_surrogate_encode
raise exc
NameError: global name 'exc' is not defined

@yarikoptic

Copy link
Copy Markdown
ContributorAuthor

looking at that traceback -- are you overloading some str.encode builtin methods? then better make sure they do not blow, and if they blow -- just relay to original/non-overloaded ;)

@codecov-io

codecov-io commented Feb 28, 2017

Copy link
Copy Markdown

Codecov Report

Merging #598 into master will decrease coverage by -7.48%.
The diff coverage is 0%.

@@ Coverage Diff @@## master #598 +/- ##
==========================================
- Coverage 94.48% 87.01% -7.48% 
==========================================
Files 63 63 Lines 9958 9956 -2 ==========================================
- Hits 9409 8663 -746 - Misses 549 1293 +744
Impacted FilesCoverage Δ
git/compat.py40.74% <0%> (-22.45%)
git/test/test_tree.py18.33% <0%> (-81.67%)
git/test/test_remote.py31.33% <0%> (-67.03%)
git/test/test_submodule.py59.92% <0%> (-39.3%)
git/odict.py20% <0%> (-30%)
git/objects/submodule/root.py64.39% <0%> (-28.04%)
git/remote.py78.08% <0%> (-14.89%)
git/test/test_base.py90.8% <0%> (-8.05%)
git/test/lib/asserts.py61.53% <0%> (-7.7%)
... and 23 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 72dddc7...de4999b. Read the comment docs.

@Byron
Byron merged commit 7e84122 into gitpython-developers:masterMar 1, 2017
@Byron

Byron commented Mar 1, 2017

Copy link
Copy Markdown
Member

Thanks a lot!

@yarikoptic

Copy link
Copy Markdown
ContributorAuthor

@Byron -- I am still curious about why this all happened since we are importing another module entirely, so smells like GitPython is messing some unrelated things up ;) for us it happens only on that debian buildbot

@Byron

Byron commented Mar 2, 2017

Copy link
Copy Markdown
Member

@yarikoptic To me all this belongs to the field of ... python is an inherently unsafe language which by now is plagued by plenty of systemic problems, many of which GitPython suffers from too. Understanding how it happened doesn't matter (to me) knowing that it will never be fixed or functioning properly in all cases. Maybe a bit dark, but the opinion I arrived at over the years.

yarikoptic added a commit to yarikoptic/GitPython that referenced this pull request Mar 8, 2017
@yarikoptic

Copy link
Copy Markdown
ContributorAuthor

ok @Byron -- now had some conscious look at it, #603 should fix my fix and the original issue ;)

Byron pushed a commit that referenced this pull request Mar 8, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@yarikoptic@codecov-io@Byron