OSError [Errno 26] ?!?!

  • Thread starter Îίκος
  • Start date
Î

Îίκος

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

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

[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] Original
exception was:, referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] Traceback (most
recent call last):, referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 222, in <module>,
referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] pypage =
subprocess.check_output( cgi_path + page ), referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] File
"/usr/local/lib/python3.3/subprocess.py", line 573, in check_output,
referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] with
Popen(*popenargs, stdout=PIPE, **kwargs) as process:, referer:
http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] File
"/usr/local/lib/python3.3/subprocess.py", line 820, in __init__,
referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148]
restore_signals, start_new_session), referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] File
"/usr/local/lib/python3.3/subprocess.py", line 1438, in _execute_child,
referer: http://superhost.gr/
[Tue Jul 02 06:33:06 2013] [error] [client 46.12.97.148] raise
child_exception_type(errno_num, err_msg), referer: http://superhost.gr/
[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\\u03ae\\u03c3\\u03b7, referer: http://superhost.gr/
 
C

Cameron Simpson

| 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.
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,
 
Î

Îίκος

Στις 2/7/2013 8:15 πμ, ο/η Cameron Simpson έγÏαψε:
| 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.
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,

Thank you, the error have been caused due to the fact that the uploading
procedure of my edited 'pelatologio.py' hadn't been completed yet, while
i was requesting the execution of the script via browser.

I didn't had to do anything it solved by itself, after upload was
successful and file got unlocked for access.

Thanks Cameron, and indeed the error message as you printed the Unicode
characters was saying in Greek that file was in use.
 
C

Cameron Simpson

| Thank you, the error have been caused due to the fact that the
| uploading procedure of my edited 'pelatologio.py' hadn't been
| completed yet, while i was requesting the execution of the script
| via browser.
|
| I didn't had to do anything it solved by itself, after upload was
| successful and file got unlocked for access.

If you're uploading using sftp (or, worse, ftp), might I suggest
using rsync instead? Amongst other features, it uploads to a temporary
file and then renames the temporary file to the real file. There is
no window where the "live" file is being written to. The live file
is the old one, and then later it is the new one.

Cheers,
--
Cameron Simpson <[email protected]>

No team manager will tell you this; but they all want to see you
come walking back into the pits sometimes, carrying the steering wheel.
- Mario Andretti
 
Î

Îίκος

Στις 2/7/2013 10:21 πμ, ο/η Cameron Simpson έγÏαψε:
| Thank you, the error have been caused due to the fact that the
| uploading procedure of my edited 'pelatologio.py' hadn't been
| completed yet, while i was requesting the execution of the script
| via browser.
|
| I didn't had to do anything it solved by itself, after upload was
| successful and file got unlocked for access.

If you're uploading using sftp (or, worse, ftp), might I suggest
using rsync instead? Amongst other features, it uploads to a temporary
file and then renames the temporary file to the real file. There is
no window where the "live" file is being written to. The live file
is the old one, and then later it is the new one.


Actually i'm uploading via Notepad++'s NPPFtp plugin, which i'm afraid
is pure ftp and not even sftp.

If i try to upload via FileZilla instead(which i can use as sftp on port
22), then it messes the cgi scripts encoding by uploading it as
iso-8859-7 which then i need to ssh to the remote host and change it
back to utf-8.

Also sometimes it takes a lot of time even with Notepad++ to even upload
a 50 KB script.

Please tell me how to use the rsync method especially it would be best
if i cna use it via text editor, Notepad++ or even better with Sublime Text.

Thank you Cameron.
 
C

Chris “Kwpolska†Warrick

Στις 2/7/2013 10:21 πμ, ο/η Cameron Simpson έγÏαψε:



Actually i'm uploading via Notepad++'s NPPFtp plugin, which i'm afraid is
pure ftp and not even sftp.

The only thing SFTP and FTP have in common is that they are Internet
protocols. Inside, they are much, much different. And you should
NEVER use FTP. (also, why Notepad++? I’d suggest getting a better
editor first.)
If i try to upload via FileZilla instead(which i can use as sftp on port
22), then it messes the cgi scripts encoding by uploading it as iso-8859-7
which then i need to ssh to the remote host and change it back to utf-8.

You need to reconfigure FileZilla then. Site Manager (first icon on
the toolbar) → your site → Charset → Force UTF-8.
Also sometimes it takes a lot of time even with Notepad++ to even upload a
50 KB script.

Please tell me how to use the rsync method especially it would be best ifi
cna use it via text editor, Notepad++ or even better with Sublime Text.

Under Windows? I suggest installing Cygwin or switching over to
Linux, for your sanity. If you don’t want either, look for a Windows
port of rsync. The next step is to read the included man page.
 
D

Dave Angel

The only thing SFTP and FTP have in common is that they are Internet
protocols. Inside, they are much, much different. And you should
NEVER use FTP. (also, why Notepad++? I’d suggest getting a better
editor first.)


You need to reconfigure FileZilla then. Site Manager (first icon on
the toolbar) → your site → Charset → Force UTF-8.

Much better: upload all files as binary, so they are byte for byte
identical on both systems. Sometimes that might require some local
preparing, but that beats strange problems with encodings, line endings,
etc.

Perhaps it's obvious, but that also means a local staging area whose
directory tree is identical to the target system.

Once you have done my suggestions above, a single rsynch command will
upload any files that have changed, without you specifying which ones
they are. So you don't need the "integrated file transfer feature" of
various editors & guis. You just run one batch file which you set up,
and when it finishes, the systems will match.
Under Windows? I suggest installing Cygwin or switching over to
Linux, for your sanity. If you don’t want either, look for a Windows
port of rsync. The next step is to read the included man page.

rsynch has lots of option switches, but once set up, it's trivial to use.
 
Î

Îίκος

Στις 2/7/2013 3:00 μμ, ο/η Dave Angel έγÏαψε:
ou need to reconfigure FileZilla then. Site Manager (first icon on
Much better: upload all files as binary, so they are byte for byte
identical on both systems. Sometimes that might require some local
preparing, but that beats strange problems with encodings, line endings,
etc.

I currently have it on Auto-Detect.
I think its smart enough what is a binary file and what is an ASCII
script, not sure though.
Once you have done my suggestions above, a single rsynch command will
upload any files that have changed, without you specifying which ones
they are. So you don't need the "integrated file transfer feature" of
various editors & guis. You just run one batch file which you set up,
and when it finishes, the systems will match.


How and from where should i use rsync?

I currently ditched FileZilla and start using CrossFTP Pro.
I searched inside it but i have seen no rsync command/method just
"Synchronized Browsing"
rsynch has lots of option switches, but once set up, it's trivial to use.

Is rsync a command on the remote server or can be found as a standalone
tool too?

Please suggest an editor that has built in rsync ability so to
immediately upload my cgi-scripts when i hit save in the text editor.

How do you guys upload your files/scripts to remote hosts ?
 
C

Chris “Kwpolska†Warrick

How and from where should i use rsync?
From your computer, in the command line.
I currently ditched FileZilla and start using CrossFTP Pro.
I searched inside it but i have seen no rsync command/method just
"Synchronized Browsing"

Look for a rsync client, not a FTP/SFTP client.
Is rsync a command on the remote server or can be found as a standalone tool
too?
Both.

Please suggest an editor that has built in rsync ability so to immediately
upload my cgi-scripts when i hit save in the text editor.

CGI? Is this 2000? Nobody uses that wording these days.

I’ve yet to see a Windowsy editor with rsync support. But you should
choose the editor that works the best for you, not the editor which
has rsync support.
How do you guys upload your files/scripts to remote hosts ?

I, for one, use sftp or edit directly on the server with vim, my
editor of choice.
 
R

Robert Kern

CGI? Is this 2000? Nobody uses that wording these days.

He is indeed using actual, bona fide CGI scripts. It's not just an antiquated
wording for "web app".

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 
J

Joshua Landau

Erm,

It probably isn't the best time to start this post but I was wondering...

Does this list have a code of conduct or a netiqeutte (sp?)
statement/requirement?

If not, should it?

Is the membership of this list presently in the right frame of mind to
create one or update any existing one?

The reason I ask is that it seems to me that if we (the current membership
of the list) could agree to a set of preferred/required behaviours we would
at least have a framework by which to measure unwelcome posts. And, more
importantly, to guide newcomers in understanding that we are enthusiasts who
choose to discuss Python and *voluntarily* help solve problems with Python
for the less experienced members.

I don't know if we do and I'll support such measures (pending that
they're done intelligently) but unfortunately there seem to be at
least two problems with your plan.

- There seems to be no authority for upholding such rules
- Newbies never read around

That said, the idea itself is well grounded. I'd suggest stealing the
rules Python already has somewhere.
 
S

Skip Montanaro

Does this list have a code of conduct or a netiqeutte (sp?) statement/requirement?
If not, should it?

No, and probably not. As Joshua Landau indicated, nobody reads the
user manual anyway. In addition, this mailing list is not currently
moderated in an approve-each-message sort of way (and I doubt anyone
wants to take on that task). The gateway with comp.lang.python makes
things somewhat worse I would think. I've forgotten how Usenet works
for moderation (far too many dead neurons ago), but I doubt it would
be all that effective. ISTR moderation is done using a simple header
which can be faked.

If someone annoys you to no end, I think your best recourse is to
ignore their posts or ignore threads which seem to generate more heat
than light.

In the old Usenet days, periodic (monthly?) posting of FAQs was common
in many newsgroups. Ignoring fake newsgroups like the stuff that
Google Groups and Gmane create, this mailing list is my only exposure
to Usenet. I have no idea if periodic FAQ posting is common practice
anymore. It might be worthwhile to create one if it's kept fairly
brief and to the point.

Skip
 
N

Ned Deily

Does this list have a code of conduct or a netiqeutte (sp?)
statement/requirement?

comp.lang.python

comp.lang.python is a high-volume Usenet open (not moderated) newsgroup
for general discussions and questions about Python. You can also access
it as a mailing list through python-list.

Pretty much anything Python-related is fair game for discussion, and the
group is even fairly tolerant of off-topic digressions; there have been
entertaining discussions of topics such as floating point, good software
design, and other programming languages such as Lisp and Forth.

Most discussion on comp.lang.python is about developing with Python, not
about development of the Python interpreter itself. Some of the core
developers still read the list, but most of them don't. Occasionally
comp.lang.python suggestions have resulted in an enhancement proposal
being written, leading to a new Python feature. If you find a bug in
Python, don't send it to comp.lang.python; file a bug report in the
issue tracker.

Items posted on the Usenet group appear on the mailing list, and vice
versa (bidirectional gateway). Due to the mysteries of Usenet, the order
in which items show up may vary.

Rudeness and personal attacks, even in reaction to blatant flamebait,
are strongly frowned upon. People may strongly disagree on an issue, but
usually discussion remains civil. In case of an actual flamebait
posting, you can ignore it, quietly plonk the offending poster in your
killfile or mail filters, or write a sharp but still-polite response,
but at all costs resist the urge to flame back. Generally
comp.lang.python is a high-signal, low-noise group. It's also a
high-traffic group, running at around 200 posts per day.

There are several different archives:
? Google Groups archive of comp.lang.python
? python.org archive of python-list
? gmane.org archive of python-list
 
D

Dennis Lee Bieber

Erm,

It probably isn't the best time to start this post but I was wondering...

Does this list have a code of conduct or a netiqeutte (sp?) statement/requirement?

If not, should it?
One problem you will run into is that this "list" happens to be:

1) a long established Usenet news group (comp.lang.python)
2) a long established mailing list (masked as a news group on Gmane)
3) something Google Groups makes available but trashes because GG thinks
everything is web page, so it turns stuff into HTML paragraphs on input
[based on EOL markers, which in proper NNTP would appear on each line],
then double spaces those "paragraphs" when sending back out to Usenet.

comp.lang.python and the mailing list are cross-linked -- traffic on
one is reproduced on the other.

So who would enforce any rules? I doubt it could be ported to a new (if
approval could even be obtained) comp.lang.python.mod(erated) so nothing
can be enforced on the comp.lang.python side; and what would you do with
Google Groups?

Shutdown the Usenet<>mailing list gateway and moderate the mailing
list? In the process alienating all the comp.lang.python and GG users (or
vice versa for the mailing list users).
 
R

Roy Smith

Ned Deily said:
If you find a bug in Python, don't send it to comp.lang.python; file
a bug report in the issue tracker.

I'm not sure I agree with that one, at least not fully. It's certainly
true that you shouldn't expect anybody to do anything about a bug unless
you open an issue.

On the other hand, I often find it useful to discuss things that I
believe are bugs on c.l.p first. Sometimes people will explain to me
that I'm just doing it wrong. Sometimes the discussion will end up
with, "Yeah, that's a bug". In either case, it serves as a good initial
filter for whether I should file a bug or not, and the discussion is
often educational.
 
N

Ned Deily

I'm not sure I agree with that one, at least not fully. It's certainly
true that you shouldn't expect anybody to do anything about a bug unless
you open an issue.

On the other hand, I often find it useful to discuss things that I
believe are bugs on c.l.p first. Sometimes people will explain to me
that I'm just doing it wrong. Sometimes the discussion will end up
with, "Yeah, that's a bug". In either case, it serves as a good initial
filter for whether I should file a bug or not, and the discussion is
often educational.

For the record, those are not my words, rather a quote from the
"charter" for this forum on http://www.python.org/community/lists/. I
think the point of the quoted words is not to discourage discussion here
but rather a reminder about the role of the issue tracker. As you say,
don't expect anybody to do anything about it without an issue on the
tracker.
 
C

Cameron Simpson

| In article <[email protected]>,
|
| > If you find a bug in Python, don't send it to comp.lang.python; file
| > a bug report in the issue tracker.
|
| I'm not sure I agree with that one, at least not fully. It's certainly
| true that you shouldn't expect anybody to do anything about a bug unless
| you open an issue.
|
| On the other hand, I often find it useful to discuss things that I
| believe are bugs on c.l.p first. Sometimes people will explain to me
| that I'm just doing it wrong. Sometimes the discussion will end up
| with, "Yeah, that's a bug". In either case, it serves as a good initial
| filter for whether I should file a bug or not, and the discussion is
| often educational.

+1

I've certinly been educated that way.
 
S

Steven D'Aprano

He is indeed using actual, bona fide CGI scripts. It's not just an
antiquated wording for "web app".


CGI didn't stop working just because more powerful, or better,
alternatives now exist.
 
S

Steven D'Aprano

Erm,

It probably isn't the best time to start this post but I was
wondering...

Does this list have a code of conduct or a netiqeutte (sp?)
statement/requirement?

If not, should it?

I *knew* this would be raised. You are right to do so, of course, but I
really, really, REALLY wasn't looking forward to it.

No, this list does not have a Code of Conduct, apart from the informal
conventions of netiquette (most of which can be summed up with "don't be
a dick") that most public forums populated by adults[1] operate under.

In practical terms, it *cannot* have a Code of Conduct enforced, because
it is an unmoderated list. Anyone can join. Anyone can post. It exists as
both email and news.

Do we need one? No, I don't think so. I'm philosophically opposed to
formalising the idea of "polite behaviour" in a Code of Conduct for
various reasons, but even putting that aside I have been here for at
least 7 years, and I've seen Xah Lee come and go (and come, and go...)
and Ranting Rick in full-on troll mode, and spammers, and endless heated
discussions about fine semantics of some aspect of Python's object model.
People come and go, but the community goes on, and we have weathered all
of those and we will weather this damned argument over whether or not it
is appropriate to flame help-vampires or not.





[1] I refer to state of maturity, not chronological age. Some people are
adult at ten, others can live to ninety and never be worthy of the term.
 
S

Steven D'Aprano

I'm not sure I agree with that one, at least not fully. It's certainly
true that you shouldn't expect anybody to do anything about a bug unless
you open an issue.

On the other hand, I often find it useful to discuss things that I
believe are bugs on c.l.p first. Sometimes people will explain to me
that I'm just doing it wrong. Sometimes the discussion will end up
with, "Yeah, that's a bug". In either case, it serves as a good initial
filter for whether I should file a bug or not, and the discussion is
often educational.

Agreed strongly!

It frustrates and amuses me when I see newbies, who sometimes don't know
enough Python to tell the difference between (1, 2, 3) and [1, 2, 3],
jump straight to the conclusion that anything that doesn't work the way
they expect must be a bug in Python.

If you are a beginner to a programming language, assume that anything
that doesn't work the way you expect is a bug in YOUR code, or YOUR
understanding, not in the language. 99.9999% of the time you will be
correct. If you assume the opposite, you will nearly always just come
across looking hopelessly naive at best, and at worst like an entitled,
arrogant idiot.

A popular language like Python has been around for about 20 years. It is
in daily use by tens of thousands of people around the world. What are
the chances that you, in your first week of using Python, just happened
to stumble across a bug that *nobody else in the world* has noticed?

So anyway, if you're going to make a fool of yourself by loudly
proclaiming that your broken code is a bug in the language, at least do
it here rather than waste the time of the people actually working on
Python :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top