citation-file-format / doi2cff

Generate a CFF file using the metadata from a software release on Zenodo.
Apache License 2.0
22 stars 4 forks source link

file mode issue #7

Closed jiskattema closed 6 years ago

jiskattema commented 6 years ago

Description

trying to get a CITATION.cff file from a DOI for https://zenodo.org/record/45925#.WsNmdJ-WbwY

What I Did

   virtualenv env
   . env/bin/activate
   pip install git+https://github.com/citation-file-format/doi2cff
   doic2cff init  https://doi.org/10.5281/zenodo.45925

Output:

(env) x  ~/Code/lll $ doi2cff init https://doi.org/10.5281/zenodo.45925
Traceback (most recent call last):
  File "/home/jiska/Code/lll/env/bin/doi2cff", line 11, in <module>
    load_entry_point('doi2cff==1.0.0', 'console_scripts', 'doi2cff')()
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1064, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 621, in make_context
    self.parse_args(ctx, args)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 880, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1396, in handle_parse_result
    value = self.full_process_value(ctx, value)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1681, in full_process_value
    return Parameter.full_process_value(self, ctx, value)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1368, in full_process_value
    value = self.get_default(ctx)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1636, in get_default
    return Parameter.get_default(self, ctx)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1312, in get_default
    return self.type_cast_value(ctx, rv)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1344, in type_cast_value
    return _convert(value, (self.nargs != 1) + bool(self.multiple))
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/core.py", line 1342, in _convert
    return self.type(value, self, ctx)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/types.py", line 38, in __call__
    return self.convert(value, param, ctx)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/types.py", line 323, in convert
    atomic=self.atomic)
  File "/home/jiska/Code/lll/env/lib/python2.7/site-packages/click/_compat.py", line 434, in open_stream
    return open(filename, mode), True
ValueError: mode string must begin with one of 'r', 'w', 'a' or 'U', not 'x'
ridderl commented 6 years ago

Not entirely sure, but I seem to remember similar errors popping up when I tried to run with python 2. I think I managed by switching to python 3.