-
Notifications
You must be signed in to change notification settings - Fork 178
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
Exception TypeError: "'NoneType' object is not callable" in ignored #238
Comments
I'm having trouble reproducing this, though I think I found the solution: http://stackoverflow.com/a/2978282. |
Well, that's weird. That was from 5 years ago, haha. I'm on Ubuntu Trusty and Python 2.7.6. |
I am also experiencing this, on Ubuntu Vivid and python 2.7.9. |
I get the same error on Windows 7, python 2.7 with the latest release. |
Also running into this error on Fedora 23 with both python 2.7 and 3.4. After some digging, while the error is related to http://stackoverflow.com/a/2978282, it is actually more directly related to https://bugs.python.org/issue6294 and more specifically how the check modules are being shutdown when proselint() is finished running. You can check this by removing some of the modules, and the errors for those disappear. I don't see a good way around this with the current framework, as it appears this has been a longstanding issue in python 2.x and 3.x, although the bug report hints that the issue might be fixed in more recent 3.x releases. I tried installing proselint for python 3.x, but it appears not all the code was ported over correctly yet. This route will have to be put on hold. The approach of separate modules that are dynamically loaded at runtime is nice in theory, but I'm not sure I would have chosen that layout. Was there a reason for this? I propose that proselint instead switch to a system of classes, of the form e.g. class Carlin(Checker):
def __init__(self):
# Do initialization here
def check(self):
# Do check here This way there is no dealing with modules or the need to cache and/or clear cache. Porting the code over to this should be fairly simple, and there's the possibility to remove a lot of unnecessary bulk in the process. Do you agree this is a good solution? |
@jdahm, just to make sure that I understand, you found that the error arises from the dynamic loading of the modules? Yours sounds like a good solution, though I'm uncertain about how this removes the need to cache, which is there to provide memoization for any functions that could benefit from it. Thanks for pointing out the incompatibility with Python 3. @michaelpacer got us to 2/3 compatibility a few months ago; it must have eroded since. I'll open an issue now. |
Last night I suspected that was the case, by removing modules. This morning when I commented out select memoize decorators error messages disappeared, so I'm back to believing the issue is with the shelving inside the memoization. It seems to be more difficult to memoize class methods as opposed to function evaluations, so I'll shelve that discussion for the moment :) |
I can confirm it happens on Debian Testing, with Python 2.7.11, and doesn't happen with Python 3.5.1. |
I successfully reproduced this in a docker container running ubuntu 1404 (Which runs python 2.7.6). Steps: $ docker run -it --rm ubuntu:14.04 bash
# apt-get update && apt-get install python python-pip
# pip install proselint
# proselint --i A similar attempt with the python:2.7.10 image did not reproduce the issue. |
I'm seeing this on Ubuntu 14.04 with Python 2.7.6 and with Python 3.4.3 (seems to be the same underlying issue in each). |
I'm seeing this on Windows 8.1 with Python 2.7.11. Proselint finds a few actual prose issues, then throws a ton of those same TypeErrors. |
Having the same issue on Fedora 23 with Python 2.7.10. The linter works. There's just a bunch of TypeError noise afterwards. |
Linux Mint and Python Python 2.7.6 seems to have the same issue. |
Apologies if this is piling onto a known issue, I just thought it might be useful to report a slightly different data point. I am seeing this issue on Windows 10 running Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32. |
25USD for whoever fixes this: https://bountify.co/squash-bug-in-proselint-a-python-based-linter-for-prose |
I've coded a solution. I assume I have to fork and then submit a pull request? During shutdown, caused by system.exit(x), a whole lot of "with x as y:" statements try to finish executing, causing calls to objects which no longer exist. The fix is to abort this ridonculous cleanup. Ultimately, I think the python interpreter or spec might be responsible, but rather than understand the with x as y spec, I'm just catching the SystemExit exception, and shutting down.
|
@richard-fairthorne Excellent, thank you. If you submit a pull request, we can test the updated version, merge, and then award the bounty. |
@alphapapa, @benjaminjkraft, @jorisvandenbossche, @jdahm, @viccuad, @stevenkaras, @hughgrigg, @jrmain, @etcinit, @plaindocs, @pwiesner — Can you see if PR #361 solves this issue for you? |
No change. I still get the same error messages. |
Can you cut and paste your command line and the output? Also, the output of python -V The behavior may be dependent on the version of the python interpreter. |
|
Same issue ~> proselint -i
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
Exception TypeError: "'NoneType' object is not callable" in ignored
|
Same error. After:
Produces a few useful comments, followed by:
|
Wait.. are you all doing "pip install prosilent"? |
(that won't work because that installs the release version of prosilent, not these unmerged changes. |
I'll try to post instructions to install this version tomorrow, so you can test this version, not the release version. |
I modified Lib\site-packages\proselint\command_line.py directly. With no other instructions, it was all I could think of. I notice that when I ran proselint, a 'pyc' version was created. |
@richard-fairthorne - |
Unfortunately I am still seeing the issue. It has been a while since I worked with python, so I am not 100% sure my methodology was sound. A summary of my actions is listed below. $ pip uninstall proselint
$ git clone https://github.com/richard-fairthorne/proselint
$ cd proselint
$ git checkout origin/errors_on_cmd_exit I then stopped and reviewed the $ python setup.py build
$ python setup.py install
$ proselint --version
$ proselint README.md |
Just as a note, I'm seeing this on Windows 7 / Python 2.7.11, following the "pip install proselint" instructions :) |
No joy. I did "cd /home/dwheeler/.local/lib/python2.7/site-packages" and put the following in ",1":
Running "patch -p1 < ,1" produced the no-problems report "patching file proselint/command_line.py". I then reran proselint, and got a few normal messages followed by 182 lines of:
|
The bin/proseline file does this: load_entry_point('proselint==0.4.0', 'console_scripts', 'proselint')() That runs the proselint method, but when the proselint method tries to return it appears to fail. |
Fix does not fix the issue here |
A quick note to report that the issue is still present on 0.4.3. Gets triggered by:
|
This may be related: https://emptysqua.re/blog/a-normal-accident-in-python-and-mod-wsgi/ |
Hi all, can someone try #432 and see if the issue is resolved for you? Thanks. |
I'm away for the weekend, but am happy to take a look on Monday when I get back. |
On 01/04/2016 23:40, Jordan Suchow wrote:
Seems OK to me! Thanks! Sergio |
Any chance someone can provide instructions for trying the changes in #432? I tried
|
cc @CraigKelly, could you take a look at this? |
TL;DR everything is working for me. Thanks for all your help. It looks like this issue has already been resolved, but I thought I would document my observations.
|
Well...oops. :(
The text was updated successfully, but these errors were encountered: