Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

refextract: improve argument check #487

Closed
tiborsimko opened this Issue · 4 comments

2 participants

@tiborsimko
Owner

Originally on 2011-02-10

When you run refextract on a non-existent file, it tracebacks with:

UnboundLocalError: local variable 'count_auth_group' referenced before assignment

It should check the parameters properly and report the concrete problem, e.g. file non-existent, permission denied, etc.

@invenio-developers
Collaborator

Originally by chayward on 2011-02-14

on branch: refextract-countauth-fix

paired with support for arxiv file names

@tiborsimko
Owner

Originally on 2011-02-15

Running refextract on a non-existent file does not report an error for
me; it produces empty output:

/opt/invenio/bin/refextract 1:/tmp/nonexistentfile.pdf
<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim">
<record>
   <controlfield tag="001">1</controlfield>
   <datafield tag="999" ind1="C" ind2="6">
      <subfield code="a">Invenio/1.0.0-rc0.40-106ba refextract/1.0.0-rc0.40-106ba-1297762113-1-0-0-0-0-0-0</subfield>
   </datafield>
</record>
</collection>

It should print an error message and exit with some error code
so that clients can know something went wrong. (e.g. workflow can
halt etc)

@invenio-developers
Collaborator

Originally by chayward on 2011-02-15

on branch: refextract-countauth-fix

@invenio-developers
Collaborator

Originally by Christopher Hayward christopher.james.hayward@cern.ch on 2011-02-16

In [3680959]:

#CommitTicketReference repository="" revision="3680959b3640bbe54a013e9c3bf50af0ff7a29bf"
refextract: fix unassigned count_auth_group

- Initialised count_auth_group in main.
  (closes #487)

- Updated usage information with inspire journal title output option.

- When obtaining the recid and the file location for each extraction job,
  split a maximum of one time, since file names with arvix notation
  regularly include a colon e.g. 'arxiv:9834.pdf'.

- Display an error message, regardless of the output mode, and halt
  extraction when either a non-existent or an unreadable pdf/text input
  file is provided as input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.