linkedin / pyexchange

Python wrapper for Microsoft Exchange
Apache License 2.0
153 stars 98 forks source link

Listing event calendar stopped working #26

Closed h3 closed 9 years ago

h3 commented 9 years ago

I was using the latest official release (0.5) which is available with pip and everything was working as expected.

Then I needed to list events of delegate calendar. I monkey patched the schema and it worked on first try (hurray !).

So I decided to do things cleanly, make a fork, create a fix and a merge request. But then everything stopped working. After removing my code I realized that it was not my patch which broke pyexchange..

I started trying with every commit between the latest release (@a596a23) and the @HEAD and it turns out that the commit just after the release commit (@66f0824) is the last time the calendar list_event feature worked..

Every commit after, the feature is broken in one way or the other.. For example with commit @5960c66:

# python fetch.py
Traceback (most recent call last):
  File "fetch.py", line 103, in <module>
    print fetch()
  File "fetch.py", line 75, in fetch
    calendar_list = service.calendar().list_events(
AttributeError: 'Exchange2010CalendarService' object has no attribute 'list_events'

With later commit the Exchange server start returning 500 internal errors and with more recent commits, it always returns an empty list..

I'm trying to figure out what changed, but it seems there was a lot of refactoring in the last commits..

Any clue of what might have broken the list_event feature ?

h3 commented 9 years ago

Well I ended up forking and patching the 0.5 version since above that everything seems broken..

You know, git offers a wonderful feature called branches to commit broken code without breaking the master.

And FYI, the Python indentation standard is 4 spaces .. not 2.

catermelon commented 9 years ago

Dude, that was rude and uncalled for. I'm sorry it's broken for you, but you don't need to be abusive about it.

I'll look into it.

h3 commented 9 years ago

Sarcasm may be unpleasant, but in no way it was meant to be rude ;)

Thank you for looking into it !

h3 commented 9 years ago

By the way, here's the branch where I added support for delegates if you are interested..

https://github.com/h3/pyexchange/compare/linkedin:master...delegate_calendar_support

got-root commented 9 years ago

Taking a quick look at it, seems like it is only broken when you specify details=True in the call. In which, it will return an empty list. This is off the current master.

By the way, I think we all know that PEP8 says 4 spaces for indentation. But projects usually have their own amendments. You may have missed the style guide for this project: https://github.com/linkedin/pyexchange/blob/master/CONTRIBUTING.rst#style-guide

And yes, we do use that thing they call branches, and that is the reason why you are getting that exception above... Multiple people working on different parts of code. You were trying to call the list_events method on a commit that had branched off before that code was introduced.

This bug just seems to have gotten passed the automated testing.

catermelon commented 9 years ago

Thanks so much, Alejandro, you're the best. New bugfix release should go out shortly!

catermelon commented 9 years ago

OK, 0.5.1. is up on PyPI! I'm going to close this ticket, but feel free to reopen if there are problems.

Sorry about breaking it - I'm glad people care enough to use it. :)