l0b0 / vcard

vCard 3 validator, class and utility functions
https://gitlab.com/victor-engmark/vcard
GNU General Public License v3.0
34 stars 8 forks source link

Fix #4: URL type should not have parameters #25

Closed Zearin closed 10 years ago

Zearin commented 10 years ago

Don’t merge this yet!

The validation is correct. However, it breaks the tests; the test file maximal.vcf, which is supposed to be valid, actually contains an invalid line; the URL type should not have parameters—but in maximal.vcf, it does.

I tried simply deleting the invalid parameter from maximal.vcf. That makes the tests raise the following error:

======================================================================
ERROR: test_valid (test.test_package.TestVCards)
Valid (but not necessarily sane) vCards
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/amrogers/Developer/Projects/GitHub/vcard/test/test_package.py", line 246, in test_valid
    '''.format(vcard_text, error)))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc5' in position 509: ordinal not in range(128)

----------------------------------------------------------------------

I believe that u'\xc5' is the character Å, which is, naturally, not ASCII. However, I have no idea what’s causing this error to occur.

Can you help me track it down?

l0b0 commented 10 years ago

"Å" is part of the characters supported by vCard 3.0 (NON-ASCII range), so the code should be able to handle it.

Zearin commented 10 years ago

Going to try this again, starting with the latest changes…