#NEWLINE# def _Open( self , path_spec = None , mode = 'rb' ) : #NEWLINE# #INDENT# "Opens the file-like object defined by path specification.\n\n    Args:\n      path_spec: optional path specification (instance of PathSpec).\n      mode: optional file access mode. The default is 'rb' read-only binary.\n\n    Raises:\n      AccessError: if the access to open the file was denied.\n      IOError: if the file-like object could not be opened.\n      PathSpecError: if the path specification is incorrect.\n      ValueError: if the path specification is invalid.\n    " #NEWLINE# if ( not path_spec ) : #NEWLINE# #INDENT# raise ValueError ( 'Missing path specification.' ) #NEWLINE# #UNINDENT# if path_spec . HasParent ( ) : #NEWLINE# #INDENT# raise errors . PathSpecError ( 'Unsupported path specification with parent.' ) #NEWLINE# #UNINDENT# location = getattr ( path_spec , 'location' , None ) #NEWLINE# if ( location is None ) : #NEWLINE# #INDENT# raise errors . PathSpecError ( 'Path specification missing location.' ) #NEWLINE# #UNINDENT# self . _current_offset = 0 #NEWLINE# self . _size = len ( self . _file_data )