Skip to main content

Getting error “The runtime parameter of python3.7 is no longer supported use the new runtime (python3.12)”

Code follows;
 

import re

def extract_info(text):
info_dict = {
'Realtor Full Name': 'UNKNOWN',
'Realtor First Name': 'UNKNOWN',
'Realtor Last Name': 'UNKNOWN',
'Realtor Phone': None,
'Realtor Email': None,
'Client Full Name': 'UNKNOWN',
'Client First Name': 'UNKNOWN',
'Client Last Name': 'UNKNOWN',
'Client Phone': None,
'Client Email': None,
}

client_pattern = re.compile(r"Client Name: (\w+)(?: (\w+))?\nClient Phone: (.*?)\nClient Email: (\S+)?")
realtor_pattern = re.compile(r"Realtor Name: (\w+)(?: (\w+))?\nRealtor Phone: (.*?)\nRealtor Email: (\S+)?")

client_match = client_pattern.search(text)
if client_match:
first_name, last_name, phone, email = client_match.groups()
info_dict_'Client First Name'] = first_name
info_dict_'Client Last Name'] = last_name if last_name else 'UNKNOWN'
info_dict_'Client Full Name'] = f"{first_name} {last_name if last_name else 'UNKNOWN'}"
info_dict_'Client Phone'] = phone.strip() if phone else None
info_dict_'Client Email'] = email if email else None

realtor_match = realtor_pattern.search(text)
if realtor_match:
first_name, last_name, phone, email = realtor_match.groups()
info_dict_'Realtor First Name'] = first_name
info_dict_'Realtor Last Name'] = last_name if last_name else 'UNKNOWN'
info_dict_'Realtor Full Name'] = f"{first_name} {last_name if last_name else 'UNKNOWN'}"
info_dict_'Realtor Phone'] = phone.strip() if phone else None
info_dict_'Realtor Email'] = email if email else None

return info_dict

email_content = inputDatat'body_plain']
info = extract_info(email_content)

output = {'output': info}

 

Hi @Mr Anomalous 

You may want to try opening a ticket with Zapier Support about this: https://zapier.com/app/get-help


Hi @Mr Anomalous 

You may want to try opening a ticket with Zapier Support about this: https://zapier.com/app/get-help

Great idea, thank you! Just submitted a ticket. 🙂


Hi there, 
 
Cat here from Zapier - thanks for reaching out about the error message in Python Code by Zapier steps about the Python version being deprecated. This error appeared when creating and testing steps using the Python Code by Zapier action and in Zap runs for Zaps using Python code steps. 
 
Our team identified the issue, updated the Python version in use, and was able to replay any Zap runs that experienced an error. You do not need to make any further updates to your Zaps. 
 
Thanks for your patience and understanding. Please don't hesitate to contact us if any further issues remain.
 
Best,

--
Cat M. - Zapier Support

 

All set!