-
Notifications
You must be signed in to change notification settings - Fork 45
Unexpected end of file sh: error importing function definition after update to v1.12.1 #165
Comments
@steelbrain is this possibly a problem with |
This is a user misconfiguration, the user has syntax errors in their rc files |
Closing due to the above comment. |
@steelbrain Could you be more precise please? I have the same error as reported and did not touch the rc files manually. Which rc file are you talking about, and how can I verify that? |
@cnicodeme Sure, I was referring to the shell rc files, for example if you use bash it would be |
@steelbrain Thank you for your reply. I'm using Bash so I tried source ~/.bashrc and it did not yield anything. I suspect the bash rc file is correct then. Do you want me to past the detailled log error from Atom? |
Yes please, detailed error logs would be helpful |
@steelbrain Here it is :
I'm sorry the output is in French, I hope it won't stop you. If there is something else you need, feel free to ask :) |
@cnicodeme while the error is still irrelevant to this package and is a user misconfiguration issue, a quick google search lead to me this solution comment. |
Thank you @steelbrain. The issue was not solved via your linked solution, but the link right after (AtomLinter/linter-puppet-lint#68). I did a search before ending here (my search was the reason I come up here ;)), and I decided to ask because I didn't find the right solution for me. In retrospect, I may have searched with the wrong keyword ;) For all others that have the same issue here, and are using Fedora, the solution is simple :
Thank you for your help @steelbrain :) |
I'm on Fedora but don't have |
I got this message too, but only on one version Fedora 24 and not the other. I removed scl-utils but it had no effect. But I realized I had flake8 installed in a user-specific bin directory (linking to a virtualenv), and the machine where it worked was using a newer version., and the failing machine had an older version (3.0.x). Once I upgraded to 3.2.1 the problem went away on the machine where it had previously failed. |
I can confirm that upgrading flake8 works here. Thanks @faassen ! |
The original environment contains
but
|
Excellent find @Unrud Could you please post this info on consistent-env repo? |
Just as @cnicodeme suggested, I am on Fedora 26 and did:
Rebooted and errors gone. I had not touched my .bashrc file...brand new install of Fedora! |
Hey guys i'm having same issue but with drupal any clue what could it be?
|
@cnicodeme - your solution works for me on Fedora 28. Thanks :-) |
Glad I could help ;) |
`getEnvFromShell` function calls `env` command through shell to get all defined environment variable. However `env` also returns the shell function defined with their whole code written on multiple lines. Such shell function definitions were not properly handled by `getEnvFromShell` which led to the following kind of error messages (seen for instance when running a terminal package in Atom): bash: module: line 1: syntax error: unexpected end of file bash: error importing function definition for `BASH_FUNC_module' With this change `getEnvFromShell` now skips shell function definition to guarantee only environment variables are recorded and a sane `result` array is returned. Fixes atom#20389 Fixes atom#17369 Fixes atom#13451 Fixes blueimp/atom-open-terminal-here#27 Fixes blueimp/atom-open-terminal-here#18 Fixes bus-stop/Termination#101 Fixes bus-stop/terminus#24 Fixes platformio/platformio-atom-ide-terminal#120 Fixes platformio/platformio-atom-ide-terminal#293 Fixes AtomLinter/linter-pylint#243 Fixes AtomLinter/linter-flake8#643 Fixes AtomLinter/linter-flake8#165 Fixes AtomLinter/linter-flake8#422 Fixes AtomLinter/linter-puppet-lint#68 Fixes autocomplete-python/autocomplete-python#347
`getEnvFromShell` function calls `env` command through shell to get all defined environment variable. However `env` also returns the shell function defined with their whole code written on multiple lines. Such shell function definitions were not properly handled by `getEnvFromShell` which led to the following kind of error messages (seen for instance when running a terminal package in Atom): bash: module: line 1: syntax error: unexpected end of file bash: error importing function definition for `BASH_FUNC_module' With this change `getEnvFromShell` now skips shell function definition to guarantee only environment variables are recorded and a sane `result` array is returned. Fixes atom#20389 Fixes atom#17369 Fixes atom#13451 Fixes blueimp/atom-open-terminal-here#27 Fixes blueimp/atom-open-terminal-here#18 Fixes bus-stop/Termination#101 Fixes bus-stop/terminus#24 Fixes platformio/platformio-atom-ide-terminal#120 Fixes platformio/platformio-atom-ide-terminal#293 Fixes AtomLinter/linter-pylint#243 Fixes AtomLinter/linter-flake8#643 Fixes AtomLinter/linter-flake8#165 Fixes AtomLinter/linter-flake8#422 Fixes AtomLinter/linter-puppet-lint#68 Fixes autocomplete-python/autocomplete-python#347
The text was updated successfully, but these errors were encountered: