Skip to content

Commit

Permalink
Update BluetoothCellularWiFi.py
Browse files Browse the repository at this point in the history
Fixed UTF-8 encoding error
  • Loading branch information
D14b0l1c authored Apr 8, 2024
1 parent cd82d9f commit da5e095
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BluetoothCellularWiFi.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def send_request(api_type, headers, only_mine, last_updated):
# Ensure the output folder exists
os.makedirs("output", exist_ok=True)

with open(filename, "a") as f:
# Open the file for writing with UTF-8 encoding
with open(filename, "a", encoding="utf-8") as f:
while retries < MAX_RETRIES:
try:
response = requests.get(BASE_URL + api_endpoint, params=query_params, headers=headers)
Expand Down Expand Up @@ -144,4 +145,4 @@ def main():


if __name__ == "__main__":
main()
main()

0 comments on commit da5e095

Please sign in to comment.