Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#8 setting no_warn = True

closed-fixed
None
5
2004-01-19
2004-01-12
Michael Houck
No

By setting no_warn = true, the following error shows
up:
#################################
#################################
#########
### Exception: exceptions.UnboundLocalError
### Time: 12 Jan 2004 11:20:41
### Message: local variable 'warn_msg'
referenced before assignment
### Trace stack:
###
---------------------------------------------------------------
----
### Module: project-deduplicate.py
### Function: ?
### Line: 477
### Text: output_assignment = 'one2one')
###
---------------------------------------------------------------
--
### Module: /home/Mike/febrl-0.2.2/febrl.py
### Function: deduplicate
### Line: 616
### Text: self.block_size)
###
---------------------------------------------------------------
### Module: /home/Mike/febrl-0.2.2/febrl.py
### Function: do_load_standard_indexing
### Line: 2175
### Text: clean_recs =
record_standardiser.standardise_block(input_recs)
###
-------------------------------------------------------------
### Module: /home/Mike/febrl-0.2.
2/standardisation.py
### Function: standardise_block
### Line: 334
### Text: output_record = self.
standardise(record)
###
-----------------------------------------------------------
### Module: /home/Mike/febrl-0.2.
2/standardisation.py
### Function: standardise
### Line: 305
### Text: output_record.update(cs.
standardise(fields, record_id, fields_str))
###
---------------------------------------------------------
### Module: /home/Mike/febrl-0.2.
2/standardisation.py
### Function: standardise
### Line: 1385
### Text: record_id, fields_str)
###
-------------------------------------------------------
### Module: /home/Mike/febrl-0.2.
2/address.py
### Function: get_address_hmm
### Line: 437
### Text: print 'warning:%s
Institution type word is not known: %s%s' % \ ###
-----------------------------------------------------
### Module: /home/Mike/febrl-0.2.
2/febrl.py
### Function: write
### Line: 2018
### Text: for msg_line in
warn_msg: # Print and log the message
#################################
#################################
#########
### Please submit an error report by sending an
e-mail to the Febrl authors
### and attach this error message.
#################################
#################################
#########

This is caused by an error in class ProjectLog on line
2006. warn_msg = [] should be moved up to before
the if (self.project_log.no_warnings == False): line,
because if self.project_log.no_warnings == True,
warn_msg is never initialized. I attached a patch
file (diff -C 5)

Discussion

  • Michael Houck
    Michael Houck
    2004-01-12

    patch file

     
    Attachments
  • Peter Christen
    Peter Christen
    2004-01-19

    • assigned_to: nobody --> christenp
    • status: open --> closed-fixed