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

Traceback on shared objects #122

Closed
pylint-bot opened this issue Dec 18, 2013 · 5 comments
Closed

Traceback on shared objects #122

pylint-bot opened this issue Dec 18, 2013 · 5 comments
Labels
Astroid Related to astroid Bug 🪲

Comments

@pylint-bot
Copy link

Originally reported by: Anonymous


When I run pylint2 on a Cython module compiled in-place, it tracebacks trying to parse the compiled shared object as a Python file:

#!python

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 645, in get_astroid
    return MANAGER.ast_from_file(filepath, modname, source=True)
  File "/usr/lib/python2.7/site-packages/astroid/manager.py", line 104, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/usr/lib/python2.7/site-packages/astroid/builder.py", line 127, in file_build
    node = self.string_build(data, modname, path)
  File "/usr/lib/python2.7/site-packages/astroid/builder.py", line 133, in string_build
    module = self._data_build(data, modname, path)
  File "/usr/lib/python2.7/site-packages/astroid/builder.py", line 146, in _data_build
    node = parse(data + '\n')
  File "/usr/lib/python2.7/site-packages/astroid/builder.py", line 39, in parse
    return compile(string, "<string>", 'exec', PyCF_ONLY_AST)
TypeError: compile() expected string without null bytes
************* Module pytouhou.formats.anm0
F:  1, 0: <type 'exceptions.TypeError'>: compile() expected string without null bytes (astroid-error)

It happens both using the dotted notation for the module pylint2 pytouhou.formats.anm0 and the file path notation pylint2 pytouhou/formats/anm0.so, while trying to load the pyx or pxd correctly stops with a syntax-error.


@pylint-bot
Copy link
Author

Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):


curious about that one but doesn't have environment to test it easily. Could you provide minimal source code to reproduce this?

@pylint-bot
Copy link
Author

Original comment by BitBucket: mcrusoe:


We also experience this with the khmer project.

#!bash

virtualenv test 
source test/bin/activate #these are optional
pip install -U pylint
git clone https://github.com/ged-lab/khmer.git
cd khmer
make all
pylint khmer

[...]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pylint/lint.py", line 586, in get_astng
    return MANAGER.astng_from_file(filepath, modname, source=True)
  File "/usr/lib/python2.7/dist-packages/logilab/astng/manager.py", line 107, in astng_from_file
    return ASTNGBuilder(self).file_build(filepath, modname)
  File "/usr/lib/python2.7/dist-packages/logilab/astng/builder.py", line 129, in file_build
    node = self.string_build(data, modname, path)
  File "/usr/lib/python2.7/dist-packages/logilab/astng/builder.py", line 135, in string_build
    module = self._data_build(data, modname, path)
  File "/usr/lib/python2.7/dist-packages/logilab/astng/builder.py", line 151, in _data_build
    node = parse(data + '\n')
  File "/usr/lib/python2.7/dist-packages/logilab/astng/builder.py", line 41, in parse
    return compile(string, "<string>", 'exec', PyCF_ONLY_AST)
TypeError: compile() expected string without null bytes
************* Module khmer._khmermodule
F:  1,0: <type 'exceptions.TypeError'>: compile() expected string without null bytes
[...]

@pylint-bot
Copy link
Author

Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):


Issue #185 was marked as a duplicate of this issue.

@pylint-bot
Copy link
Author

Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):


Do not attempt to analyze non python file, eg .so file. Closes #122

@pylint-bot
Copy link
Author

Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):


Removing version: 1.0 (automated comment)

@pylint-bot pylint-bot added Bug 🪲 Astroid Related to astroid labels Dec 9, 2015
msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
* refactor: move generated client instantiation out of base class

* feat: integrate microgen async client to client

* feat: make collections call backed by async

* fix: failing asyncmock assertion

* refactor: remove unused install

* fix: lint

* refactor: shared functionality in client to base class

* refactor: move AsyncMock to test helpers

* fix: return type in client docs

* feat: integrate microgen async client to collection

* fix: lint

* feat: integrate microgen async client to document

* feat: integrate microgen async client to batch

* fix: use AsyncMock for batch async tests:

* fix: collection and document testing batch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Astroid Related to astroid Bug 🪲
Projects
None yet
Development

No branches or pull requests

1 participant