I get the following when running a script.
 
TypeError: argument 1 must be string or read-only character buffer, not _sre.SRE_Pattern
 
Here is the script I am trying to run.   I am trying to verify that my search is returning what I am trying to search for, but due to the error I can verify it.
 
import re
 
log = open('audit.log') # Opens audit log
log2 = open('timaudit.log','w')
for line in log:
    line =re.compile(r"""
        \w      #match any alphanumeric character
        \Audit report for user+
        \User reported as inactive+
        """, re.VERBOSE)
    line.search('Audit report for user () User reported as inactive')
    log2.write(line)
 
log.close()
log2.close()
 
Thank you,
 
Tim Finley
Novell IT Services Engineer
Novell Technical Services
Novell

Attachment: timaudit.log
Description: Binary data

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to