-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
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-clientversion:google-api-python-client-2.188.0
Steps to reproduce
- use any valid credentials, the sheet is public
- 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:Z1000Metadata
Metadata
Assignees
Labels
No labels