WeBWorK Main Forum

The file does not appear to be a text file

The file does not appear to be a text file

by Ever Barbero -
Number of replies: 3

The error "The file does not appear to be a text file" appears when I copy paste perl code from windows into course.config using the Webwork editor, opened out of File Manager. 

My windows editor is nppp/np++ and I have it configured for UTF-8 with line endings \n (as needed by linux). UTF-8\n is what Linux uses, right?  

Once I save and close the file with Webwork editor, I can never open it again with Webwork editor. 

When I try to edit the file directly in a linux terminal, /opt/webwork/courses/course_name/course.config I have to change the permissions, edit, change them back. 

-rw-r--r-- is 644. 

sudo chmod 777 course.conf

edit the file 

sudo chmod 644 course.conf

What a pain! but OK, I got what I wanted. Still, I cannot ever open the file again with the webwork editor out of File Manager. Why ???

View file does not work either, same message. 

 If I download the file to windows, it is fine, the changes I made in Linux are incorporated, the line terminator is \n, everything looks good. 

PS. Using Webwork 12 in Ubuntu 16.04



In reply to Ever Barbero

Re: The file does not appear to be a text file

by tim Payer -

Hi Ever,

I know that you wrote that you had configured your course.config file for UTF-8, But still as a precaution can you take out the copy-write symbol of the circumscribed "c" in the opening lines of your course.conf file? This was the culprit that caused the same error message of "This does not appear to be a text file" in our testing of the grade pass-back system. And it does not matter that these opening lines are commented out. What was happening was the copy-write symbol was generating numerous tilde A characters every time we edited and saved the course.conf file for testing (V2.13). At first the file will still work with a few of these characters, but there is a certain threshold when webwork ceases to recognize it as text. Leave the written word of "copywrite" in place but take out the symbol. 


Try that,  Best, Tim

In reply to tim Payer

Re: The file does not appear to be a text file

by Ever Barbero -
Oh, wow, I have to delete something that is already there by default from the webwork installation!!! yes, it works!!!
--> at the webwork editor, before saving course.conf, be sure to delete the extraneous symbols at and around (c) ... meaning copyright.  
Add/subtract whatever you want. Save. It works. 
Please mark as SOLVED. Thank you !!!

In reply to Ever Barbero

Re: The file does not appear to be a text file

by Glenn Rice -

Note that the copyright symbol will not be there in a newly created course in WeBWork 2.15.  I am guessing that you are using a course that was created before upgrading to WeBWork 2.15.  To be proper you should not delete the copyright symbol, but rather replace it with "©" (without the quotes).  Although deleting it is fine.