diff options
author | Joe Urciuoli <joseph.w.urciuoli@gmail.com> | 2018-09-19 13:40:23 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-10-01 16:57:51 -0400 |
commit | cacc3c2057ab14faaf6c5b679bb2dbb6f8b98f8e (patch) | |
tree | 60dce8d33da5aefec2ccc566482ff8d0e5e8845d /lib/sqlalchemy/sql/default_comparator.py | |
parent | 95094d3789a558b310782c27a33b95dddb092dfc (diff) | |
download | sqlalchemy-cacc3c2057ab14faaf6c5b679bb2dbb6f8b98f8e.tar.gz |
Fix dependency_for final argument
Fixed issue where part of the utility language helper internals was passing
the wrong kind of argument to the Python ``__import__`` builtin as the list
of modules to be imported. The issue produced no symptoms within the core
library but could cause issues with external applications that redefine the
``__import__`` builtin or otherwise instrument it. Pull request courtesy Joe
Urciuoli.
Per the submitter: "The fourth argument provided to `__import__` (which
`import_` feeds in to) is supposed to be a a list of strings, but this code is
passing a single string. This was causing the sqlalchemy `import_` function to
break the string (for example 'interfaces') into an array of single characters
['i', 'n', ...], which causes the actual `__import__` to not find the module
`sqlalchemy.orm.i` (since it's trying to import `sqlalchemy.orm.i` and
`sqlalchemy.orm.n` .. etc)"
No issue could be reproduced locally as it seems you can put anything non-
empty/None into that last argument, even a list like ``['X']``, and all the
sub-modules seem to appear. Omit it, and then the sub-modules aren't present.
Perhaps it just runs the module or not if this attribute is present.
Change-Id: Ia15c74620f24d24f0df4882f9b36a04e2c3725b8
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/473
Diffstat (limited to 'lib/sqlalchemy/sql/default_comparator.py')
0 files changed, 0 insertions, 0 deletions