Skip to content

Enable absolute imports for modules using Queue. #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2014

Conversation

jcrobak
Copy link
Contributor

@jcrobak jcrobak commented Oct 21, 2013

When running on Linux with code on a case-insensitive file system,
imports of the Queue module fail because python resolves the
wrong file (It is trying to use a relative import of queue.py in
the kafka directory). This change forces absolute imports via PEP328.

When running on Linux with code on a case-insensitive file system,
imports of the `Queue` module fail because python resolves the
wrong file (It is trying to use a relative import of `queue.py` in
the kafka directory). This change forces absolute imports via PEP328.
@jcrobak
Copy link
Contributor Author

jcrobak commented Nov 7, 2013

ping?

@jcrobak
Copy link
Contributor Author

jcrobak commented Nov 13, 2013

Hi @mumrah - are you willing to consider this PR? Or do I need to come up with a different solution?

@mumrah
Copy link
Collaborator

mumrah commented Nov 13, 2013

@jcrobak I'm fine with this change, but I don't have a local linux machine to test it on. Have you run the integration tests with this change?

@mumrah
Copy link
Collaborator

mumrah commented Nov 13, 2013

Also, sorry for the long delay

@jcrobak
Copy link
Contributor Author

jcrobak commented Nov 13, 2013

Thanks @mumrah. I have run the unit tests on mac and linux. It seems as though they were also run as part of the travis ci build, right? https://travis-ci.org/mumrah/kafka-python/builds/12852012

@mumrah
Copy link
Collaborator

mumrah commented Nov 13, 2013

Yea, TravisCI built this PR fine, but the problem you describe wasn't being shown previously - so can't really say if it worked just from Travis.

To clarify, the unit tests are currently disabled and the integration tests that actually start up ZooKeeper and Kafka are the ones I'm interested in. Are these the tests you ran?

Thanks

@jcrobak
Copy link
Contributor Author

jcrobak commented Nov 13, 2013

Yea, TravisCI built this PR fine, but the problem you describe wasn't being shown previously - so can't really say if it worked just from Travis.

Gotcha. Yes, I've verified that this fixes the issue I've seen.

To clarify, the unit tests are currently disabled and the integration tests that actually start up ZooKeeper and Kafka are the ones I'm interested in. Are these the tests you ran?

Yeah, that seems to be which runs when I execute tox. The tests do fail in python 2.6.8, but they pass in python 2.7.5. Output looks like this: https://gist.github.com/jcrobak/7454409

@mumrah
Copy link
Collaborator

mumrah commented Nov 13, 2013

That looks like the mostly broken unit tests. Take at look at how Travis runs the integration tests and make sure things pass

@jcrobak
Copy link
Contributor Author

jcrobak commented Dec 2, 2013

Sorry for the delay. I can't get the integration tests to run via python -m test.test_integration even though they run via tox. I've tried several times both on master and on my branch. There seems to be a race condition that causes test_switch_leader (connection reset by peer), test_switch_leader_async (stack overflow), and TestFailover.tearDownClass ('NoneType' object has no attribute 'stop') to error out.

But the fact that local tox and travis builds are both passing seems to be a pretty strong indication that my code didn't introduce an import-related regression.

@kevinastone
Copy link

👍

Ran into this issue.

mumrah added a commit that referenced this pull request Jan 8, 2014
Enable absolute imports for modules using Queue.
@mumrah mumrah merged commit 354fcdb into dpkp:master Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants