Ticket #259 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

modelsparser.py.diff (1.1 KB) - added by tyler@… 5 years ago.
Pach to fix inspection of models defined in zipped eggs.

Change History

Changed 5 years ago by tyler@…

Pach to fix inspection of models defined in zipped eggs.

comment:1 Changed 5 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [155cf016715f].

Note: See TracTickets for help on using tickets.