digits = ''.join(c for c in temp_str if c.isdigit())
if len(digits) >= 2:
temp_value = int(digits[:2]) # Takes first 2 digits - could be wrong!
If temperature is "123°C", this gives "12" instead of "123". Fix:
Extract the first complete number
temp_match = re.search(r'(\d+)', temp_str)
if temp_match:
temp_value = int(temp_match.group(1))
Lines 1706-1713 have a dangerous assumption:
digits = ''.join(c for c in temp_str if c.isdigit())
if len(digits) >= 2:
temp_value = int(digits[:2]) # Takes first 2 digits - could be wrong!
If temperature is "123°C", this gives "12" instead of "123". Fix:
# Extract the first complete number
temp_match = re.search(r'(\d+)', temp_str)
if temp_match:
temp_value = int(temp_match.group(1))
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Lines 1706-1713 have a dangerous assumption:
digits = ''.join(c for c in temp_str if c.isdigit())
if len(digits) >= 2:
temp_value = int(digits[:2]) # Takes first 2 digits - could be wrong!
If temperature is "123°C", this gives "12" instead of "123". Fix:
Extract the first complete number
temp_match = re.search(r'(\d+)', temp_str)
if temp_match:
temp_value = int(temp_match.group(1))