<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getBagTags(bagInfoPath):
 """ get bag tags """


    try:
        bagInfoString = open(bagInfoPath, "r").read().decode('utf-8')
    except UnicodeDecodeError:
        bagInfoString = open(bagInfoPath, "r").read().decode('iso-8859-1')
    bagTags = anvl.readANVLString(bagInfoString)
    return bagTags