s11 7ty raises a TypeError exception during validation #1

marklit opened this Issue Jan 23, 2015 · 0 comments


None yet
1 participant

marklit commented Jan 23, 2015

In [1]: from postcode import uk

In [2]: uk.validate('s11 7ty')
TypeError                                 Traceback (most recent call last)
<ipython-input-2-9fb2a6b2674e> in <module>()
----> 1 uk.validate('s11 7ty')

/home/mark/.virtualenvs/backend/src/postcode/postcode/uk.pyc in validate(raw_postcode, incode_required)
     81         if re.match('^[A-Z][1I]$', parts[0]):
---> 82             parts[0] = parts[0][0]
     83             parts[1] = '1' + parts[1]

TypeError: 'tuple' object does not support item assignment

I wrote a small script that ran the library over a current list of full uk postcodes and ~41,000 postcodes which raised the same exception: https://gist.github.com/marklit/49f10c49438a5a328dc9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment