Couldn't get a file descriptor referring to the console

34 views
Skip to first unread message

Steven Sam

unread,
Jul 14, 2020, 2:42:11 PM7/14/20
to Macaulay2
I'm now getting this error when I run any viewHelp command in M2: "Couldn't get a file descriptor referring to the console"

I'm using v1.16 in Ubuntu 18.04.4. This seems to be a new problem in recent days so it was working before. Any ideas how to fix it?

Doug Torrance

unread,
Jul 14, 2020, 3:00:46 PM7/14/20
to maca...@googlegroups.com
I'm having the same issue.  The error message appears to be coming from using "open" instead of "xdg-open" to open the URL.  A very hacky fix is to edit /usr/share/Macaulay2/Core.m2 as root to remove that call.  Here's a patch:
--- /home/profzoom/src/macaulay2/M2/M2/Macaulay2/m2/html.m2	2020-07-14 14:55:45.648272054 -0400
+++ /usr/share/Macaulay2/Core/html.m2	2020-07-14 14:54:44.349507879 -0400
@@ -43,8 +43,7 @@ runnable := fn -> (
 -- preferred web browser
 -- TODO: cache this value
 browser := () -> (
-    if runnable "open" then "open" -- Apple varieties
-    else if runnable "xdg-open" then "xdg-open" -- most Linux distributions
+    if runnable "xdg-open" then "xdg-open" -- most Linux distributions
     else if runnable getenv "WWWBROWSER" then getenv "WWWBROWSER" -- compatibility
     else if runnable "firefox" then "firefox" -- backup
     else error "neither open nor xdg-open is found and WWWBROWSER is not set")

On 7/14/20 2:42 PM, Steven Sam wrote:
I'm now getting this error when I run any viewHelp command in M2: "Couldn't get a file descriptor referring to the console"

I'm using v1.16 in Ubuntu 18.04.4. This seems to be a new problem in recent days so it was working before. Any ideas how to fix it?
--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/242b620a-7dbe-4c06-b052-3a91e49b18d9o%40googlegroups.com.


Steven Sam

unread,
Jul 14, 2020, 3:40:16 PM7/14/20
to Macaulay2
Great, that solved the problem. One difference is I don't have /usr/share/Macaulay2/Core.m2 but I found what you described in usr/share/Macaulay2/Core/html.m2

Also, in case this is relevant for anyone else: for some reason making your change caused viewHelp to open the html help files in a text editor rather than in firefox (running xdg-open on an html file directly opens in firefox) so I just commented that part out and only left the line about firefox.

On Tuesday, July 14, 2020 at 12:00:46 PM UTC-7, Doug Torrance wrote:
I'm having the same issue.  The error message appears to be coming from using "open" instead of "xdg-open" to open the URL.  A very hacky fix is to edit /usr/share/Macaulay2/Core.m2 as root to remove that call.  Here's a patch:
--- /home/profzoom/src/macaulay2/M2/M2/Macaulay2/m2/html.m2	2020-07-14 14:55:45.648272054 -0400
+++ /usr/share/Macaulay2/Core/html.m2	2020-07-14 14:54:44.349507879 -0400
@@ -43,8 +43,7 @@ runnable := fn -> (
 -- preferred web browser
 -- TODO: cache this value
 browser := () -> (
-    if runnable "open" then "open" -- Apple varieties
-    else if runnable "xdg-open" then "xdg-open" -- most Linux distributions
+    if runnable "xdg-open" then "xdg-open" -- most Linux distributions
     else if runnable getenv "WWWBROWSER" then getenv "WWWBROWSER" -- compatibility
     else if runnable "firefox" then "firefox" -- backup
     else error "neither open nor xdg-open is found and WWWBROWSER is not set")

On 7/14/20 2:42 PM, Steven Sam wrote:
I'm now getting this error when I run any viewHelp command in M2: "Couldn't get a file descriptor referring to the console"

I'm using v1.16 in Ubuntu 18.04.4. This seems to be a new problem in recent days so it was working before. Any ideas how to fix it?
--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maca...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages