Open KarandeepKaur1 opened 6 months ago
I get a similar error:
InvalidURL Traceback (most recent call last)
17 frames /usr/lib/python3.10/http/client.py in _validate_path(self, url) 1226 match = _contains_disallowed_url_pchar_re.search(url) 1227 if match: -> 1228 raise InvalidURL(f"URL can't contain control characters. {url!r} " 1229 f"(found at least {match.group()!r})") 1230
Looks like the request is including spaces where the second line of the fstrings formatted populated_url is indented. Changing it to the following will fix it:
populated_url = f'all_data/csv/by_profile_id?child_area_type_id={area}' \ f'&parent_area_type_id={parent_area_type_id}&profile_id={profile_id}'
Getting the following error for get_all_data_for_profile()
raise InvalidURL(f"URL can't contain control characters. {url!r} "
InvalidURL: URL can't contain control characters. '/api/all_data/csv/by_profile_id?child_area_type_id=502 &parent_area_type_id=15&profile_id=19' (found at least ' ')
Tried:
profile_id=19 phof = ftp.get_all_data_for_profile(profile_id, area_type_id=502)
and
phof = ftp.get_all_data_for_profile(profile_id=19, area_type_id=502)