Skip to content
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

Closed
alphapapa opened this issue Oct 17, 2015 · 42 comments
Closed

Exception TypeError: "'NoneType' object is not callable" in ignored #238

alphapapa opened this issue Oct 17, 2015 · 42 comments

Comments

@alphapapa
Copy link

Well...oops. :(

$ pip install --user proselint
$ proselint --debug /tmp/argh.txt
Deleting the cache...
checks.garner.archaism.check
checks.misc.chatspeak.check
checks.consistency.spacing.check
checks.garner.dates.check_dash_and_from
checks.garner.dates.check_decade_apostrophes_long
checks.garner.dates.check_decade_apostrophes_short
checks.garner.dates.check_month_of_year
checks.garner.dates.check_month_year_comma
checks.pinker.apologizing.check
checks.garner.back_formations.check
checks.wsj.athletes.check
checks.misc.annotations.check
checks.misc.eponymous_adjectives.check
checks.consistency.spelling.check
checks.garner.jargon.check
checks.misc.currency.check
checks.garner.commercialese.check
checks.szekely.nword.check_repeated_exclamations
checks.garner.am_pm.check_lowercase_periods
checks.garner.am_pm.check_midnight_noon
checks.garner.am_pm.check_redundancy
checks.garner.am_pm.check_spacing
checks.lilienfeld.terms_to_avoid.check_lie_detector_test
checks.lilienfeld.terms_to_avoid.check_mental_telepathy
checks.lilienfeld.terms_to_avoid.check_p_equals_zero
checks.inc.corporate_speak.check_repeated_exclamations
checks.leonard.hell.check_repeated_exclamations
checks.garner.illogic.check
checks.garner.illogic.check_coin_a_phrase_from
checks.garner.illogic.check_without_your_collusion
checks.palahniuk.suddenly.check_ellipsis
checks.norris.denizen_labels.check
checks.garner.preferred_forms.check
checks.garner.preferred_forms.check_able_atable
checks.garner.preferred_forms.check_able_ible
checks.garner.preferred_forms.check_em_vs_em_and_en_vs_in
checks.pinker.hedging.check
checks.garner.capitalization.check
checks.garner.capitalization.check_days
checks.garner.capitalization.check_months
checks.garner.airlinese.check
checks.ogilvy.pretension.check_repeated_exclamations
checks.garner.sexism.check
checks.pinker.latin.check
checks.wallace.uncomparables.check
checks.garner.animal_labels.check
checks.garner.denizen_labels.check
checks.twain.damn.check_very_damn
checks.misc.hyperbolic.check
checks.pinker.narcisissm.check
checks.garner.needless_variants.check
checks.butterick.symbols.check_copyright_symbol
checks.butterick.symbols.check_ellipsis
checks.butterick.symbols.check_registered_trademark_symbol
checks.butterick.symbols.check_sentence_spacing
checks.butterick.symbols.check_trademark_symbol
checks.nordquist.redundancy.check
checks.wallace.tense_present.check
checks.gowers.overworked_metaphors.check_biggest_bottleneck
checks.garner.redundancy.check
checks.garner.redundancy.check_redundant_acronym_syndrome
checks.misc.credit_card.check
checks.strunk_white.greylist.check
checks.strunk_white.composition.check
checks.garner.many_a.check
checks.garner.cliches.check
checks.orwell.debased.check_debased_language
checks.garner.mixed_metaphors.check
checks.garner.punctuation.check_et_al
checks.write_good.cliches.check
checks.garner.oxymorons.check
checks.leonard.exclamation.check_exclamations_ppm
checks.leonard.exclamation.check_repeated_exclamations
checks.garner.bureaucratese.check
checks.misc.whence.check
checks.write_good.lexical_illusions.check
checks.misc.password.check
checks.carlin.filth.check_debased_language
checks.garner.malapropisms.check
checks.pinker.scare_quotes.check
checks.garner.misspelling.check
argh.txt:3:149: twain.damn Substitute 'damn' every time you're inclined to write 'very;' your editor will delete it and the writing will be just as it should be.
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
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
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
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
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
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
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
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
@suchow
Copy link
Member

suchow commented Oct 18, 2015

I'm having trouble reproducing this, though I think I found the solution: http://stackoverflow.com/a/2978282.

@suchow suchow added the bug label Oct 18, 2015
@alphapapa
Copy link
Author

Well, that's weird. That was from 5 years ago, haha. I'm on Ubuntu Trusty and Python 2.7.6.

@benjaminjkraft
Copy link

I am also experiencing this, on Ubuntu Vivid and python 2.7.9.

@jorisvandenbossche
Copy link

I get the same error on Windows 7, python 2.7 with the latest release.

@jdahm
Copy link

jdahm commented Feb 26, 2016

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?

@suchow
Copy link
Member

suchow commented Feb 26, 2016

@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.

@jdahm
Copy link

jdahm commented Feb 26, 2016

@jdahm, just to make sure that I understand, you found that the error arises from the dynamic loading of the modules?

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 :)

@viccuad
Copy link
Contributor

viccuad commented Feb 27, 2016

I can confirm it happens on Debian Testing, with Python 2.7.11, and doesn't happen with Python 3.5.1.

@stevenkaras
Copy link

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.

@hughgrigg
Copy link

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).

@jrmain
Copy link

jrmain commented Mar 7, 2016

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.

@etcinit
Copy link

etcinit commented Mar 7, 2016

Having the same issue on Fedora 23 with Python 2.7.10. The linter works. There's just a bunch of TypeError noise afterwards.

@plaindocs
Copy link

Linux Mint and Python Python 2.7.6 seems to have the same issue.

@pwiesner
Copy link

pwiesner commented Mar 8, 2016

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.

@notslang
Copy link

notslang commented Mar 9, 2016

25USD for whoever fixes this: https://bountify.co/squash-bug-in-proselint-a-python-based-linter-for-prose

@richard-fairthorne
Copy link

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.

diff --git a/proselint/command_line.py b/proselint/command_line.py
index b5001a2..a3ba3f3 100644
--- a/proselint/command_line.py
+++ b/proselint/command_line.py
@@ -193,4 +193,7 @@ def proselint(files=None, version=None, initialize=None, clean=None,
         show_errors(click.format_filename(f.name), errors, json)

 if __name__ == '__main__':
-    proselint()
+    try:
+        proselint()
+    except SystemExit:
+        os._exit(0)

@suchow
Copy link
Member

suchow commented Mar 9, 2016

@richard-fairthorne Excellent, thank you. If you submit a pull request, we can test the updated version, merge, and then award the bounty.

@suchow
Copy link
Member

suchow commented Mar 9, 2016

@alphapapa, @benjaminjkraft, @jorisvandenbossche, @jdahm, @viccuad, @stevenkaras, @hughgrigg, @jrmain, @etcinit, @plaindocs, @pwiesner

Can you see if PR #361 solves this issue for you?

@jrmain
Copy link

jrmain commented Mar 9, 2016

No change. I still get the same error messages.

@richard-fairthorne
Copy link

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.

@jrmain
Copy link

jrmain commented Mar 10, 2016

λ proselint "C:\xampp\htdocs\testsite\documents\Registry.htm"
Registry.htm:15:14: butterick.symbols.curly_quotes Use curly quotes “”, not straight quotes "".
Registry.htm:6:15: butterick.symbols.curly_quotes Use curly quotes “”, not straight quotes "". Found 6 times elsewhere.
Registry.htm:206:55: butterick.symbols.ellipsis '...' is an approximation, use the ellipsis symbol '…'.
Registry.htm:283:9: butterick.symbols.sentence_spacing More than two spaces after the period; use 1 or 2.
Registry.htm:104:74: consistency.spacing Inconsistent spacing after period (1 vs. 2 spaces).
Registry.htm:187:63: consistency.spacing Inconsistent spacing after period (1 vs. 2 spaces).
Registry.htm:410:7: consistency.spacing Inconsistent spacing after period (1 vs. 2 spaces).
Registry.htm:457:20: consistency.spacing Inconsistent spacing after period (1 vs. 2 spaces).
Registry.htm:55:16: garner.phrasal_adjectives.ly No hyphen is necessary in phrasal adjectives with an adverb ending in -ly.
Registry.htm:179:10: garner.phrasal_adjectives.ly No hyphen is necessary in phrasal adjectives with an adverb ending in -ly.
Registry.htm:336:39: garner.redundancy.ras RAS syndrome. Use 'GUI' instead of 'GUI interface'.
Registry.htm:28:1: garner.skunked_terms 'hopefully' is a bit of a skunked term — impossible to use without issue. Find some other way to say it.
Registry.htm:34:2: leonard.exclamation.30ppm More than 30 ppm of exclamations. Keep them under control.
Registry.htm:263:58: twain.damn Substitute 'damn' every time you're inclined to write 'very;' your editor will delete it and the writing will be just as it should be. Found 3 times elsewhere.
Registry.htm:351:62: write_good.cliches 'Needless to say,' is a cliché.
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
(+ a bunch more)
λ python -V
Python 2.7.11

@nxnfufunezn
Copy link

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
python2 --version
Python 2.7.11

@david-a-wheeler
Copy link

Same error.

After:

pip install --user proselint
export PATH="$PATH:$HOME/.local/bin"
proselint README.md 

Produces a few useful comments, followed by:

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
....
python --version
Python 2.7.6
cat /etc/os-release 
NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

@richard-fairthorne
Copy link

Wait.. are you all doing "pip install prosilent"?

@richard-fairthorne
Copy link

(that won't work because that installs the release version of prosilent, not these unmerged changes.

@richard-fairthorne
Copy link

I'll try to post instructions to install this version tomorrow, so you can test this version, not the release version.

@jrmain
Copy link

jrmain commented Mar 10, 2016

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.

@david-a-wheeler
Copy link

@richard-fairthorne -
I can't speak for the others, but since the instructions said to do
"pip install proselint"
that is what I did. Actually I used the --user option, but otherwise I just followed the instructions.

@pwiesner
Copy link

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 command_line.py file to make sure I had the updated copy.

$ python setup.py build
$ python setup.py install
$ proselint --version
$ proselint README.md

@AlgyTaylor
Copy link

Just as a note, I'm seeing this on Windows 7 / Python 2.7.11, following the "pip install proselint" instructions :)

@david-a-wheeler
Copy link

No joy.

I did "cd /home/dwheeler/.local/lib/python2.7/site-packages" and put the following in ",1":

--- a/proselint/command_line.py
+++ b/proselint/command_line.py
@@ -193,4 +193,7 @@ def proselint(files=None, version=None, initialize=None, clean=None,
         show_errors(click.format_filename(f.name), errors, json)

 if __name__ == '__main__':
-    proselint()
+    try:
+        proselint()
+    except SystemExit:
+        os._exit(0)

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:

Exception TypeError: "'NoneType' object is not callable" in  ignored

@david-a-wheeler
Copy link

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.

@callegar
Copy link

Fix does not fix the issue here
running proselint --demo is enough to trigger the problem

@callegar
Copy link

A quick note to report that the issue is still present on 0.4.3.

Gets triggered by:

  1. running proselint on a file
  2. running proselint --demo
  3. runnint proselint --initialize

@suchow
Copy link
Member

suchow commented Mar 25, 2016

@suchow
Copy link
Member

suchow commented Apr 1, 2016

Hi all, can someone try #432 and see if the issue is resolved for you? Thanks.

@pwiesner
Copy link

pwiesner commented Apr 1, 2016

I'm away for the weekend, but am happy to take a look on Monday when I get back.

@callegar
Copy link

callegar commented Apr 2, 2016

On 01/04/2016 23:40, Jordan Suchow wrote:

Hi all, can someone try #432 #432
and see if the issue is resolved for you? Thanks.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#238 (comment)

Seems OK to me! Thanks!

Sergio

@suchow suchow closed this as completed in fea4b4d Apr 2, 2016
@jrmain
Copy link

jrmain commented Apr 2, 2016

Any chance someone can provide instructions for trying the changes in #432? I tried pip install proselint and now I get this:

Traceback (most recent call last):
File "C:\Python27\Scripts\proselint-script.py", line 9, in
load_entry_point('proselint==0.5.1', 'console_scripts', 'proselint')()
File "C:\Python27\lib\site-packages\pkg_resources__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python27\lib\site-packages\pkg_resources__init__.py", line 2682, in load_entry_point
return ep.load()
File "C:\Python27\lib\site-packages\pkg_resources__init__.py", line 2355, in load
return self.resolve()
File "C:\Python27\lib\site-packages\pkg_resources__init__.py", line 2361, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "C:\Python27\lib\site-packages\proselint-0.5.1-py2.7.egg\proselint\command_line.py", line 12, in
from .tools import (
File "C:\Python27\lib\site-packages\proselint-0.5.1-py2.7.egg\proselint\tools.py", line 11, in
import dbm
ImportError: No module named dbm

@suchow
Copy link
Member

suchow commented Apr 2, 2016

cc @CraigKelly, could you take a look at this?

@CraigKelly
Copy link
Contributor

Apologies @jrmain - I just submitted PR #439 to handle the missing dbm module.

@pwiesner
Copy link

pwiesner commented Apr 4, 2016

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.

$ git clone git@github.com:amperser/proselint.git
$ cd proselint
$ python setup.py build
$ python setup.py install
$ cd C:\Python27\Scripts
$ Proselint.exe --version
0.5.1
$ proselint README.md
README.md:3:152: skunked_terms.misc 'Hopefully' is a bit of a skunked term — impossible to use without issue. Find some other way to say it.

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

No branches or pull requests