parameters: (self, file=None)
return_statement: return resp, list
docstring: Internal: get a response plus following text from the server.
          Raise various errors if the response indicates an error.
docstring_summary: Internal: get a response plus following text from the server.
          Raise various errors if the response indicates an error.
docstring_tokens: Internal : get a response plus following text from the server . Raise various errors if the response indicates an error .
function: def getlongresp(self, file=None):
          """Internal: get a response plus following text from the server.
          Raise various errors if the response indicates an error."""
  
          openedFile = None
          try:
              # If a string was passed then open a file with that name
              if isinstance(file, str):
                  openedFile = file = open(file, "w")
  
              resp = self.getresp()
              if resp[:3] not in LONGRESP:
                  raise NNTPReplyError(resp)
              list = []
              while 1:
                  line = self.getline()
                  if line == '.':
                      break
                  if line[:2] == '..':
                      line = line[1:]
                  if file:
                      file.write(line + "\n")
                  else:
                      list.append(line)
          finally:
              # If this method created the file, then it must close it
              if openedFile:
                  openedFile.close()
  
          return resp, list
function_tokens: def getlongresp ( self , file = None ) : openedFile = None try : # If a string was passed then open a file with that name if isinstance ( file , str ) : openedFile = file = open ( file , "w" ) resp = self . getresp ( ) if resp [ : 3 ] not in LONGRESP : raise NNTPReplyError ( resp ) list = [ ] while 1 : line = self . getline ( ) if line == '.' : break if line [ : 2 ] == '..' : line = line [ 1 : ] if file : file . write ( line + "\n" ) else : list . append ( line ) finally : # If this method created the file, then it must close it if openedFile : openedFile . close ( ) return resp , list