Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Error with old-style print function #108

Closed
silentsokolov opened this issue Nov 9, 2015 · 5 comments
Closed

Error with old-style print function #108

silentsokolov opened this issue Nov 9, 2015 · 5 comments
Labels

Comments

@silentsokolov
Copy link

Error with old-style print function

print`space`

TypeError: Cannot read property 'length' of undefined

TypeError: Cannot read property 'length' of undefined
at extractRange (/Users/-/.atom/packages/linter-flake8/lib/main.coffee:99:67)
at /Users/-/.atom/packages/linter-flake8/lib/main.coffee:177:22

Python lib:
flake8==2.4.1
pep8==1.6.2

linter-flake8 version 1.9.1

@cbscribe
Copy link

cbscribe commented Nov 9, 2015

I'm also getting this error message in Atom 1.1.0 - on both OS X 10.11 and Ubuntu 14.04. In trying to reproduce, it seems to happen consistently if there is folded code above the edit point, and not until a space is typed.

TypeError: Cannot read property 'length' of undefined
    at extractRange (/Users/chris/.atom/packages/linter-flake8/lib/main.coffee:99:67)
    at /Users/chris/.atom/packages/linter-flake8/lib/main.coffee:177:22

Plugins:

advanced-open-file: 0.12.0
atom-runner: 2.4.6
autocomplete-python: 0.10.3
linter: 1.10.0
linter-flake8: 1.9.1
pigments: 0.18.1

Dependencies:

flake8: 2.5.0
pep8: 1.5.7

Tried disabling all other plugins (all but linter and linter-flake8) with same result.

@Arcanemagus
Copy link
Member

Looks like more issues with the workaround for flake8's terrible highlighting. The issue is that lineTextForScreenRow seems to be returning undefined for the line we are asking it for, I'll see if I have time to debug this further tonight.

@Arcanemagus
Copy link
Member

Fix published in v1.9.2, enjoy and please report any further issues.

@anargu
Copy link

anargu commented Dec 25, 2016

Hi all! maybe I'm too late to answer but I use Atom v1.12.x and I had this error. The way i resolved it was inserting the error code of this issue (E901) in ignoring error code in Atom/settings/packages search for linter-flake8. this workaround hide the issue when I insert a "print somevariable"

@Arcanemagus
Copy link
Member

@anargu The currently released versions are impossible to reproduce this in, as the entire code path that caused the issue has been removed. It's rather more likely you are using an out of date version of flake8. If you are still seeing this after updating to flake8>=3.2.1 please file a new issue with code that shows this, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants