googleapis / googleapis/google-api-python-client

Returned range name duplicates inner single quote

未關閉
#2,702 0 則留言 0 個 reaction 已指派 1 人 已被 @iam-ethan-huang 認領 在 GitHub 檢視
主要語言
Python
星號
8.9k
分支
2.6k
平均合併
2 天 28 分鐘
30 天內合併 PR
17

描述

If you request data for a sheet with a inner single quote, like `Jon's Data` in the [example](https://developers.google.com/workspace/sheets/api/guides/concepts), 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
```python
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
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。