title: Python maximum recursion depth exceeded getting sharepoint metadata only after compilation in .exe
body: <p>I´ve written a script that connects to Sharepoint and downloads the metadata from all the new files added into a dataframe.</p>
  <p>I have developed it in Spyder and it works just fine. But after I compile it into an .exe file with pyinstaller and I run it, I keep getting the following error: <strong>maximum recursion depth exceeded</strong></p>
  <p>I´m using Windows10 and Python 3.6.10 (conda)</p>
  <pre><code>from office365.runtime.auth.clientCredential import ClientCredential
  from office365.sharepoint.client_context import ClientContext
  
  import pandas as pd
  
  clien_id = XXX
  cient_secret = XXX
  site_url = XXX
  
  ctx = ClientContext.connect_with_credentials(site_url, ClientCredential(client_id, client_secret))
  
  lib = ctx.web.lists.get_by_title(&quot;REO&quot;)
  
  doc = 1
  
  while cuenta_error &lt; 10:
                      try: 
                          item = lib.get_item_by_id(doc)
                          ctx.load(item)
                          ctx.execute_query()
                          id_documento = &quot;{0}&quot;.format(item.properties[&quot;IdDocumentoSistemaOrigen&quot;])
                          id_sharepoint = &quot;{0}&quot;.format(item.properties[&quot;Id&quot;])
                          ts_alta = datetime.strptime(str(datetime.now()), '%Y-%m-%d %H:%M:%S.%f').strftime('%Y-%m-%d %H:%M:%S')
                          origen = &quot;{0}&quot;.format(item.properties[&quot;AplicacionOrigen&quot;])
                          tipo_doc_SH = &quot;{0}&quot;.format(item.properties[&quot;TipoDocumento&quot;]['Label'])
                          fecha_alta_origen = datetime.strptime(&quot;{0}&quot;.format(item.properties[&quot;Created&quot;])[0:10], '%Y-%m-%d').strftime('%Y-%m-%d')
                          id_inmueble = &quot;{0}&quot;.format(item.properties[&quot;IdActivoPrinex&quot;])
                          dni = &quot;{0}&quot;.format(item.properties[&quot;NumeroIdentificacion&quot;])
                          id_promocion = &quot;{0}&quot;.format(item.properties[&quot;CodigoPromocion&quot;])
                          file = item.file
                          ctx.load(file)
                          ctx.execute_query()
                          nombre_documento = &quot;{0}&quot;.format(file.properties[&quot;Name&quot;])
                          fecha_envio = None
                          IAObjeto = None
                          #print(id_documento)
                          doc +=1
                          cuenta_error = 0
                          fecha_envio = None
                          ind_error = None
                          to_append = [id_documento, id_sharepoint, tipo_documento, ts_alta, nombre_documento,
                                  origen, tipo_doc_SH, fecha_alta_origen, id_inmueble, fecha_envio, ind_error,dni, id_promocion, IAObjeto]
                          a_series = pd.Series(to_append, index = df.columns)
                          df = df.append(a_series, ignore_index=True)
                          export_doc +=1
                      except Exception as e:
                          print(e)
  </code></pre>
  <p>I have tryied with sys.setrecursionlimit(1500) but I still get the same error and with sys.setrecursionlimit(1000**6) the code end up crashing.</p>
  <p>Does anybody have any suggestion about how to fix this?</p>