refindlyllc / rets

A thin RETS client
MIT License
69 stars 26 forks source link

Basic sample gets IndexError: pop from empty list #196

Closed andrerivas closed 6 years ago

andrerivas commented 6 years ago

Hello! I'm able to use other Python clients to connect to this RETS server, but this library fails right away with the error below. Any thoughts?

Basic sample code:

login_url = 'https://pt.rets.crmls.org/contact/rets/login'
username = '***'
password = '***'
rets_client = Session(login_url, username, password)
rets_client.login()
system_data = rets_client.get_system_metadata()
print(system_data)

Error:

  File "refindly.py", line 7, in <module>
    system_data = rets_client.get_system_metadata()
  File "/usr/local/lib/python3.7/site-packages/rets/session.py", line 150, in get_system_metadata
    return result.pop()
IndexError: pop from empty list
andrerivas commented 6 years ago

Never mind! I found the metadata_format parameter which fixes this. The client doesn't seem to try and auto-detect from what I saw but no big deal.

rets_client = Session(login_url, username, password, metadata_format="STANDARD_XML")