rbarrois/factory_boy — pull request #114 by pelme (2013-12-19 14:11:14+00:00)
Title: use proper encoding when checking version

The version is parsed incorrectly (without specifying encoding when parsing `__init__.py`) in setup.py.

Python version:
```
Python 3.3.3 (default, Dec 10 2013, 11:21:59)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
```

This is what happens when I try to install factory boy:
```
[py33] [master] ~/code/factory_boy $ python setup.py install
Traceback (most recent call last):
File "setup.py", line 36, in
version=get_version(PACKAGE),
File "setup.py", line 18, in get_version
for line in f:
File "/Users/andreas/.virtualenvs/py33/bin/../lib/python3.3/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 91: ordinal not in range(128)
```

The same issue exists when I try to install factory boy with pip from pypi:
```
[py33] $ pip --version
pip 1.4.1 from /Users/andreas/.virtualenvs/py33/lib/python3.3/site-packages (python 3.3)
[py33] $ pip install factory-boy
Downloading/unpacking factory-boy
Using download cache from /Users/andreas/.pip_download_cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Ff%2Ffactory_boy%2Ffactory_boy-2.2.1.tar.gz
Running setup.py egg_info for package factory-boy
Traceback (most recent call last):
File "", line 16, in
File "/Users/andreas/.virtualenvs/py33/bin/../lib/python3.3/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1018: ordinal not in range(128)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 16, in

File "/Users/andreas/.virtualenvs/py33/bin/../lib/python3.3/encodings/ascii.py", line 26, in decode

return codecs.ascii_decode(input, self.errors)[0]

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1018: ordinal not in range(128)

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/andreas/.virtualenvs/py33/build/factory-boy
Storing complete log in /Users/andreas/.pip/pip.log
```

I have used factory boy on another machine earlier with Python 3.3 without this issue, so I am not sure why it shows up here and not at the other places.