Ticket #259 (closed defect: fixed)
South cannot inspect zipped eggs
| Reported by: | tyler@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | migrations | Version: | 0.6.1 |
| Keywords: | Cc: |
Description
Exception:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
[...]
File "c:\python26\lib\site-packages\south-0.6.1-py2.6.egg\south\modelsinspector.py", line 264, in get_model_fields
parser_fields = modelsparser.get_model_fields(model, m2m) or {}
File "c:\python26\lib\site-packages\south-0.6.1-py2.6.egg\south\modelsparser.py", line 334, in get_model_fields
tree = get_model_tree(model)
File "c:\python26\lib\site-packages\south-0.6.1-py2.6.egg\south\modelsparser.py", line 192, in get_model_tree
source = open(inspect.getsourcefile(model)).read().replace("\r\n", "\n").replace("\r","\n") + "\n"
IOError: [Errno 2] No such file or directory: 'c:
python26
lib
site-packages
django_messages-0.4.2-py2.6.egg
messages
models.py'
The problem seems to be that South assumes all models are defined in normal files. Unfortunately, this breaks when you have ForeignKey/ManyToManyFields? to models defined in zipped Python eggs. I've attached a patch that makes it work for me.
Attachments
Change History
Changed 4 years ago by tyler@…
- Attachment modelsparser.py.diff added
comment:1 Changed 4 years ago by andrew
- Status changed from new to closed
- Resolution set to fixed
Fixed in [155cf016715f].

Pach to fix inspection of models defined in zipped eggs.