Giter VIP home page Giter VIP logo

Comments (4)

ecederstrand avatar ecederstrand commented on June 26, 2024

Your script is missing the mailbox argument to DistinguishedFolderId. Additionally, SingleFolderQuerySet requires a full Folder object:

folder = SingleFolderQuerySet(
    account=account,
    folder=Folder(
        root=account.root,
        _distinguished_id=DistinguishedFolderId(
            id='calendar',
            mailbox=Mailbox(email_address=account.primary_smtp_address),
        )
    ),
).resolve()
print("folder name:", folder.name)

from exchangelib.

quzhi1 avatar quzhi1 commented on June 26, 2024

I added mailbox argument here https://github.com/quzhi1/EwsPlayground/blob/main/debugging_find_calendar_folder.py#L19

And this is the new error:

Traceback (most recent call last):
  File "/Users/[email protected]/EwsPlayground/debugging_find_calendar_folder.py", line 20, in <module>
    ).resolve()
      ^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/exchangelib/folders/queryset.py", line 187, in resolve
    return list(self.folder_collection.resolve())[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/exchangelib/folders/collections.py", line 335, in resolve
    yield from self.__class__(account=self.account, folders=resolveable_folders).get_folders(
  File "/opt/homebrew/lib/python3.12/site-packages/exchangelib/folders/collections.py", line 403, in get_folders
    yield from GetFolder(account=self.account).call(
  File "/opt/homebrew/lib/python3.12/site-packages/exchangelib/services/get_folder.py", line 55, in _elems_to_objs
    yield parse_folder_elem(elem=elem, folder=folder)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/exchangelib/services/common.py", line 978, in parse_folder_elem
    raise ValueError(f"Unsupported folder class: {folder}")
ValueError: Unsupported folder class: DistinguishedFolderId(id='calendar', mailbox=Mailbox(name=None, email_address='[email protected]', routing_type='SMTP', mailbox_type='Mailbox', item_id=None))

from exchangelib.

ecederstrand avatar ecederstrand commented on June 26, 2024

You're missing the Folder(...) part. Try copying the script exactly as I posted it.

from exchangelib.

quzhi1 avatar quzhi1 commented on June 26, 2024

It is working again! Thanks @ecederstrand . I can close this issue.

from exchangelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.