Solution for exceptions.AttributeError for escape

I was getting error : exceptions.AttributeError: TapeSite instance has no attribute '_escape' while running "tape -P /xmpp-httpbind=http://localhost:5290/xmpp-httpbind" 

Attached modifications in file for solution