OSError [Errno 26] ?!?!

Cameron Simpson cs at zip.com.au
Tue Jul 2 07:15:32 CEST 2013


On 02Jul2013 06:37, Νίκος <nikos at superhost.gr> wrote:
| After making a slightly chnage inside my pelatologio.py script
| substituting '*****' instead of '-----' for no apparent reason i
| receive the following error:
| 
| [Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] OSError:
| [Errno 26] \\u0391\\u03c1\\u03c7\\u03b5\\u03af\\u03bf
| \\u03ba\\u03b5\\u03b9\\u03bc\\u03ad\\u03bd\\u03bf\\u03c5
| \\u03c3\\u03b5 \\u03c7\\u03c1

Errno 26 depends on your operating system. See "man 2 intro" for details.
But on my Mac and on a handle Linux system number 26 is:

   26 ETXTBSY Text file busy.  The new process was a pure procedure (shared
         text) file which was open for writing by another process, or
         while the pure procedure file was being executed an open call
         requested write access.

See the os.strerror function for printing the message from an errno number:

  http://docs.python.org/3/library/os.html#os.strerror

I'd say you're trying to write to a file you shouldn't be writing to.
Maybe an executable?

Try to get your script to print out the filename of whatever it was trying to
overwrite before the open() call.

Regarding the characters, I'd say they've been double escaped. Let's undo that:

  [/Users/cameron]fleet*> py3
  Python 3.3.2 (default, May 21 2013, 11:50:47)
  [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> print('\\u0391\\u03c1\\u03c7\\u03b5\\u03af\\u03bf \\u03ba\\u03b5\\u03b9\\u03bc\\u03ad\\u03bd\\u03bf\\u03c5 \\u03c3\\u03b5 \\u03c7\\u03c1')
  \u0391\u03c1\u03c7\u03b5\u03af\u03bf \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03b5 \u03c7\u03c1
  >>> print('\u0391\u03c1\u03c7\u03b5\u03af\u03bf \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03b5 \u03c7\u03c1')
  Αρχείο κειμένου σε χρ
  >>>

I can't read that, but I'd hope you can.

| What is this OSError and these unicode characters besided it?
| Here is the complete traceback.

A traceback without code isn't terribly useful.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>



More information about the Python-list mailing list