Skip to content
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

Extract fails: UnicodeEncodeError: 'latin-1' codec can't encode character #4

Open
hashworks opened this issue Oct 15, 2024 · 2 comments

Comments

@hashworks
Copy link

INFO: Calculating location history for 2000-01-01 to 2024-10-16
Traceback (most recent call last):
  File "/TimelineExtractor/src/extract.py", line 97, in <module>
    main()
    ~~~~^^
  File "/TimelineExtractor/src/extract.py", line 87, in main
    History = GetLocationHistoryForDateRange(Args.start, Args.end, AuthCookie, Args.authuser, Args.rapt)
  File "/TimelineExtractor/src/extract.py", line 30, in GetLocationHistoryForDateRange
    return LocationHistory.GetDateRange(StartDate, EndDate, AuthCookie, AuthUser, Rapt)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/TimelineExtractor/src/LocationHistory.py", line 110, in GetDateRange
    LocationHistory = GetDate(StartDate, AuthCookie, AuthUser, Rapt)
  File "/TimelineExtractor/src/LocationHistory.py", line 64, in GetDate
    Response = requests.get(Url, cookies=dict(cookie=AuthCookie))
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
        method=request.method,
    ...<9 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
        conn,
    ...<10 lines>...
        **response_kw,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
    ~~~~~~~~~~~~^
        method,
        ^^^^^^^
    ...<6 lines>...
        enforce_content_length=enforce_content_length,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/urllib3/connection.py", line 440, in request
    self.putheader(header, value)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/connection.py", line 354, in putheader
    super().putheader(header, *values)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/http/client.py", line 1309, in putheader
    values[i] = one_value.encode('latin-1')
                ~~~~~~~~~~~~~~~~^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 519: ordinal not in range(256)
@Stadly
Copy link
Owner

Stadly commented Oct 27, 2024

Very strange. Do you encounter the issue both when running the python script directly and through Docker?

@hashworks
Copy link
Author

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants