-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
twisted.plugin should be quiet when it can't write cache file #2409
Comments
[#3649](#3649) was a duplicate of this, except that #3649 was asking for a more explicit message explaining what is wrong and how it is merely a warning, where this ticket is asking for it to be silent. You could make a plugin directory unwritable by removing it and replacing it with an unwritable file. |
Someone was just running the unit tests of Tahoe-LAFS, and they got this permission-denied error, and so they re-ran the test with "sudo". Now they probably have root owning some of the automatically generated files that are created by running the tests. :-( http://allmydata.org/trac/tahoe/ticket/802#comment:1 This is evidence that fixing this ticket would be good. :-) |
Someone else just installed Tahoe-LAFS and opened a bug report saying that the unit tests failed and including the following text in their bug report:
I take this as more evidence that this ticket is important. Let's see... So what's the next step on this. Write a unit test? Maybe the unit test just manually makes the Glyph or exarkun: please tell me if that is an appropriate test. |
One thing to do, perhaps, is to file a bug against Apple, since Apple is distributing a misinstalled version of Twisted? And also encourage anyone who encounters this to also file one (it's not like they can become nosy on the existing tickets). As far as making a unit test goes, it should be easy. Just start from the assumption that global state is bad, and so the Twisted plugins directory isn't the thing you want to be fiddling around with. Make a fake plugins package in the test and fiddle with it, instead. It should assert that something is logged. If someone was good, then there'd already be a test like this for the current behavior (I don't know if they were or not). The new test would presumably differ only in what exactly it is asserting about what is logged. Sounds like people want a warning of some sort without an accompanying traceback. That's fine, I suppose. From my earlier comment, it sounds like |
Replying to exarkun:
For those of you who may not know the URL to do this, it's bugreport.apple.com; more information is available at developer.apple.com/bugreporter.
I was going to point at good and bad examples, but apparently therve fixed the plugin tests a couple of years ago to stop mangling global state quite so badly, so most of the tests in test_plugin are actually pretty reasonable examples, except for their unfortunate dalliance with
I believe the test in question is |
The attached patch is a little weird. I'm not sure how parameterizing the |
In my very humble opinion, the original patch parameterizes the error I have therefore simplified the patch to issue a warning in addition Please review. |
I fixed the tags: you're not supposed to put comments in |
Commas. Sorry: it's 4:30 AM here at the Pycon sprint. |
Also see #2410. |
(In [31061]) Branching to 'plugin-cache-2409' |
Buildbot: [http://buildbot.twistedmatrix.com/boxes-supported?branch=/branches/plugin-cache-2409]. There were some bzr failures but ignore those: I forgot the |
I made a few more changes on this. I switched to |
Thanks for the review! Did one more build and the results look good. Merging. |
The cache file is not important enough to emit a traceback every time you run a program using twisted just because your OS' twisted install doesn't have an up-to-date cache file. It used to log.msg an error if it couldn't write it. I bet that didn't actually write anything because there was no logger initialized yet.
Attachments:
Searchable metadata
The text was updated successfully, but these errors were encountered: