Skip to content

[Bugfix] Wrong ISO time format in Python quickstart for Calendar API#2116

Closed
Marc416 wants to merge 3 commits into
googleworkspace:mainfrom
Marc416:bugfix/issue2115
Closed

[Bugfix] Wrong ISO time format in Python quickstart for Calendar API#2116
Marc416 wants to merge 3 commits into
googleworkspace:mainfrom
Marc416:bugfix/issue2115

Conversation

@Marc416

@Marc416 Marc416 commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

Hi team,

issue #2115

While testing the Calendar API using the Python quickstart guide, I noticed an issue in the time formatting line.

The current code is:

now = datetime.datetime.now(tz=datetime.timezone.utc).isoformat() + "Z"  # 'Z' indicates UTC time

However, this results in an invalid ISO 8601 timestamp like:

makefile

2025-04-07T14:39:12.345678+00:00Z

Appending "Z" after a timezone-aware ISO string (which already includes +00:00) makes the timestamp invalid. This can cause unexpected errors when calling the API.

It should be corrected to:

now = datetime.datetime.now(tz=datetime.timezone.utc).isoformat()

When the incorrect format is used, it leads to errors like this:

{
  "error": {
    "code": 403,
    "message": "Method doesn't allow unregistered callers (callers without established identity)...",
    "status": "PERMISSION_DENIED"
  }
}

Thanks!

@google-cla

google-cla Bot commented Apr 7, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Marc416

Marc416 commented Apr 8, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Thank you for info me.
I registered with CLA.

@Marc416 Marc416 marked this pull request as draft April 8, 2025 08:49
@Marc416 Marc416 marked this pull request as ready for review April 8, 2025 08:49
@Marc416 Marc416 closed this Apr 9, 2025
@Marc416

Marc416 commented Apr 9, 2025

Copy link
Copy Markdown
Contributor Author

check this
#2117

@Marc416 Marc416 deleted the bugfix/issue2115 branch April 9, 2025 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants