title: ValueError: stat: path too long for Windows on Jupyter Notebook parsing a URL request
body: <p>I am trying to parse my company Odata data to construct a proportion of late suppliers taking the CompanyName and LateDays fields. </p>
  
  <p>I opened the file and converted it into a string since I found a really helpful post on how request urls with authentication, and I obtained my string text containing the whole report. The report is written in ?XML and I am using Python 3.7 in Jupyter Notebook to handle it.</p>
  
  <p>I found another post that queries a XML file similar to mine using a class method, but my output is the error ValueError: stat: path too long for Windows.</p>
  
  <p>How can I fix this? </p>
  
  <p>Thanks!</p>
  
  <pre><code>import requests
  import pandas as pd
  import numpy as np
  import base64
  import urllib.request
  
  request = urllib.request.Request('https://myUrl_OData')
  base64string = base64.b64encode(bytes('%s:%s' % ('Myusername', 'Mypassword'),'ascii'))
  request.add_header("Authorization", "Basic %s" % base64string.decode('utf-8'))
  result = urllib.request.urlopen(request)
  resulttext = result.read()
  
  text = resulttext.decode(encoding='utf-8',errors='ignore')
  
  from xml.sax import parse
  from xml.sax.handler import ContentHandler
  
  class properties(ContentHandler):
      def __init__(self):
          self.elements = []          # stack of elements
          self.char_data = u''        # string buffer
          self.current_vendor = u'' 
          self.current_latedays = u''
  
      def startElement(self, name, attrs):
          if companyname == u'CompanyName':
              self.elements.append(u'CompanyName')
          if latedays == u'LateDays':
              self.elements.append(u'LateDays')
  
      def characters(self, chars):
          if len(self.elements) &gt; 0 and self.elements[-1] in [u'CompanyName', u'LateDays']:
              self.char_data += chars
  
      def endElement(self, name):
          self.elements.pop() if len(self.elements) &gt; 0 else None
  
          if companyname == u'CompanyName':
              self.current_vendor = self.char_data
              self.char_data = ''
          if latedays == u'LateDays':
              self.current_latedays = self.char_data
              self.char_data = ''
  
          if companyname == 'CompanyName':
              if self.current_latedays == u'LateDays':
                  print('Found:', self.current_customer)
  
              # clear the buffers now that is finished
              self.current_year = u''
              self.current_customer = u''
              self.char_data = u''
  
  
  parse(r"\\\\?\\" + text, properties())
  </code></pre>