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

nxid "underlying buffer has been detached" error with check_ezid #26

Open
ngeraci opened this issue Oct 9, 2019 · 0 comments
Open

nxid "underlying buffer has been detached" error with check_ezid #26

ngeraci opened this issue Oct 9, 2019 · 0 comments

Comments

@ngeraci
Copy link
Contributor

ngeraci commented Oct 9, 2019

When I run nxid in a Python 3 environment on an item that already has an ARK, I'm getting the following error:
(Expected output is ℹ noop update)

  File "/home/noah/miniconda3/bin/nxid", line 10, in <module>
    sys.exit(main())
  File "/home/noah/miniconda3/lib/python3.7/site-packages/pynux/nxid.py", line 155, in main
    print('ℹ noop update "{}" {} {}'.format(path, ark, owner))
ValueError: underlying buffer has been detached
Exception ignored in: <_io.TextIOWrapper mode='w' encoding='UTF-8'>
ValueError: underlying buffer has been detached

It looks like this may have to do with the stdout stuff in the check_ezid function that gets called if ARK is not none:

pynux/pynux/nxid.py

Lines 167 to 175 in 92f813f

def check_ezid(ark, ezid):
''' check to see if the ARK is listed in EZID, returns raw ERC or `None`'''
try:
sys.stdout = open(os.devnull, 'w')
return ezid.view(ark)
except HTTPError:
return None
finally:
sys.stdout = sys.__stdout__

This doesn't affect the ability to mint new ARKs for items with no ARK, which is my main day to day use case, so it's not a big priority on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant