Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Marc416
Copy link
Contributor

@Marc416 Marc416 commented Apr 7, 2025

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!

Copy link

google-cla bot commented Apr 7, 2025

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
Copy link
Contributor Author

Marc416 commented Apr 8, 2025

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
Copy link
Contributor Author

Marc416 commented Apr 9, 2025

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