title: How can i skip files that does not exist file in the repository using python?
body: <p>I want to download xml file from issue tracking system one by one.It produces error message when file not exist in the repository. I include the python script to better understand my problem.</p>
  
  <p>My code:</p>
  
  <pre><code>import urllib.request
  for i in range(0,1000):
      issue_id1='DERBY-'+str(i)
      url ="https://issues.apache.org/jira/si/jira.issueviews:issue-xml/"+issue_id1+'/'+issue_id1+'.xml'
      s=urllib.request.urlopen(url)
      contents = s.read()
      file = open(issue_id1+'.xml', 'wb')
      file.write(contents)
  
  file.close()
  </code></pre>
  
  <p>Stack Track:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/PhP/Learning/xmldownlaod.py", line 10, in &lt;module&gt;
      s=urllib.request.urlopen(url)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 161, in urlopen
      return opener.open(url, data, timeout)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 469, in open
      response = meth(req, response)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 579, in http_response
      'http', request, response, code, msg, hdrs)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 507, in error
      return self._call_chain(*args)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 441, in _call_chain
      result = func(*args)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 587, in http_error_default
      raise HTTPError(req.full_url, code, msg, hdrs, fp)
  urllib.error.HTTPError: HTTP Error 404: Not Found
  </code></pre>