Skip to content

tries to open emacs locks #367

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
pylint-bot opened this issue Nov 3, 2014 · 9 comments · Fixed by #5554
Closed

tries to open emacs locks #367

pylint-bot opened this issue Nov 3, 2014 · 9 comments · Fixed by #5554

Comments

@pylint-bot
Copy link

Originally reported by: BitBucket: sandrotosi, GitHub: @sandrotosi?


Hello,
this is bug http://www.logilab.org/19517 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563000 which is still happening:

When a file is modified but not saved in emacs, some sort of
dangling-symlink lockfile is created:

 .#HexBoard.py -> username@hostname.domain.tld.9285:1262073654

This confuses pylint:

************* Module Omaha.Boards..#HexBoard
F0002:  1: <class 'logilab.astng._exceptions.ASTNGBuildingException'>: Unable to load module Omaha.Boards..#HexBoard (No module named #HexBoard)


I suppose it would be enough to just ignore dotfiles, I guess they
would make invalid python module names anyway.  Similarly, the #
character is most probaby forbidden here as well - all in all, pylint
should probably ignore such files as impossible to properly use from
python, and possibly issue a warning about their presence.
> > Is this still happening with the latest version of pylint in sid?

The problem still happens today:

************* Module Omaha.Games.abstract..#PlayerPools
F:  1, 0: error while code parsing: Unable to load file '/work/yann/games/omaha2/Omaha/Games/abstract/.#PlayerPools.py' ([Errno 2] No such file or directory: '/work/yann/games/omaha2/Omaha/Games/abstract/.#PlayerPools.py') (parse-error)

@PCManticore
Copy link
Contributor

Closing this. I am not sure how to even reproduce this. I installed emacs, did some fiddling around, noticed some lock files being generated, although they were skipped as well, since their format was something of #name#, being skipped anyway by pylint since it does not end in .py. Some reproduction case would be useful, if it does not involve emacs or additional external resources.

@The-Compiler
Copy link
Contributor

FWIW I'm getting this from time to time as well and find it quite annoying - unfortunately no idea how to reproduce it.

@PCManticore
Copy link
Contributor

If you can find a way, don't hesitate to reopen it.

@The-Compiler
Copy link
Contributor

This just happened again while having a file open in emacs while running pylint over it.

Looks like emacs has some kind of broken symlink for whatever reason:

$ ls -l tests/unit/misc/.#test_sessions.py
lrwxrwxrwx 1 florian florian 30 Sep  6 16:48 tests/unit/misc/.#test_sessions.py -> 'florian@ginny.12302:1472984742'

And pylint chokes on it:

************* Module tests/unit/misc/.#test_sessions.py
F:  1, 0: No module named tests/unit/misc/.#test_sessions.py (fatal)

I can reproduce it by doing (on Linux) ln -s /doesnotexist foo.py and pylint foo.py, though when I try with a directory with that foo.py and an __init__.py in it I get something different:

************* Module pl.foo
F:  1, 0: error while code parsing: Unable to load file 'pl/foo.py' ([Errno 2] No such file or directory: 'pl/foo.py') (parse-error)

I guess pylint should either ignore broken symlinks entirely, or maybe at least ignore broken symlinks named .#foo.py?

@The-Compiler The-Compiler reopened this Sep 6, 2016
@rogalski
Copy link
Contributor

It looks like it may be worked around by modifying expand_modules to ignore broken symlinks.

On the other hand, it's quite unclear to me why should we introduce any workarounds for bugs in other software.

@DanielNoord
Copy link
Collaborator

@sandrotosi Sorry for you pinging you again

There are no active maintainers/contributors that use emacs (as far as I know) so this is becoming a very stale issue at this point. Do you know if the suggestion of handling broking sym links would fix this issue? If so, I can try and make a PR for it.

@sandrotosi
Copy link
Contributor

I'm afraid i have no more information than the one provided when opening this ticket (there may be relevant updates at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563000): i dont use emacs and i was just forwarding this bug from a Debian user

@chaoflow
Copy link

@DanielNoord those symlinks are emacs lock files, basically guaranteed to be dangling and always prefixed with .#, see https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Locks.html for more information.

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Dec 19, 2021

This can be fixed in past pylint version by defining ignore-patterns=^\.# in the configuration. This will become the default in pylint 2.13.

[MASTER]
ignore-patterns=^\.#

Pierre-Sassoulas added a commit that referenced this issue Dec 20, 2021
* Fix 'path' shadowing variable from outer scope

* Ignore file that starts like emacs's file lock

Closes #367

Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
~~Based on branch for PR pylint-dev#500 -- I will rebase after that PR merges.~~

Closes pylint-dev#367.
    
Supersedes PR pylint-dev#497.
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants