Returned range name duplicates inner single quote

Open
#2,702 0 comments 0 reactions 0 assignees View on GitHub

@iam-ethan-huang is already working on this.

Since Jan 16, 2026.

Assessment

This issue has not been assessed yet.

Description

api: sheets priority: p3 type: bug

If you request data for a sheet with a inner single quote, like Jon's Data in the example, the returned range name will duplicate the inner quotes: 'Jon''s Data'!A1:Z1000.

Using this range name will then lead to errors like Unable to parse range: Jon''s Data!A1:Z1000 because the returned range name does not exist.

Environment details
  • OS type and version: macOS Tahoe 26.2
  • Python version: Python 3.10.15
  • pip version: pip 25.2
  • google-api-python-client version: google-api-python-client-2.188.0
Steps to reproduce
  1. use any valid credentials, the sheet is public
  2. run the code below, you should see the commented result printed
SPREADSHEET_ID = '1uK8QrcKrc_wierOMaIXxRKeE_fjt_8FfzpvrnuM1BhM'
RANGE_NAME = "'Jon's Data'"
result = service.spreadsheets().values().get(spreadsheetId=SPREADSHEET_ID, range=RANGE_NAME).execute()
print(result.get('range'))
# 'Jon''s Data'!A1:Z1000
Dominant language
Python
Stars
9k
Forks
2.6k
Avg merge
28m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-api-python-client

All issues in googleapis/google-api-python-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.