could be cleaned a little with
```
try: 
    k, v = p.split('=')
except ValueError:
    # error handling