Frappe function doc.get_url() throwing error

im trying to get the url of a doctype but getting an error in version 13 but not int version 12.
TypeError(‘quote_from_bytes() expected bytes’) this is the error im getting.
do i need to parse it to string i dont get it why its throwing this error

any help would be appreciated