#14145 closed (fixed)
undeterministic behavior when project or app template contains dotdir
Reported by: | marbu | Owned by: | Paul McMillan |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This bug is minor and is not causing any problems in current release, but if you are interested:
I found a bug in function copy_helper() from django/core/management/base. This functions manages the copy process of project or app template and tries to avoid copying certain files and directories. But the method used to skip directories starting with dot character is wrong - it deletes from the array it is iterating on, thus behaving in a non deterministic way.
Attachments (1)
Change History (5)
by , 14 years ago
Attachment: | minor-django-bug.diff added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 14 years ago
Just a further note: It looks like the existing code tried to solve this problem by using enumerate
. Since enumerate
is lazy, it behaves like a generator rather than creating the tuples immediately, and so the error remains.
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Good catch here. It is a minor point, but as you said, it's non-deterministic and could be a problem for some python implementations. Modifying iterators while in use is always a bad idea.