I have a problem with the logging module.
It reports a Broken Pipe error after outputing to the log file
occasionally (5%). This does not appear to happen on Mac OSX using
current finked python (2.3.3) but does appear to occur on Python 2.3.4
running on a very old Redhat Linux xxxxx 2.2.14-5.0 #1 Tue Mar 7
21:07:39 EST 2000 i686. The actual logged error follows my signature.
Note that "files used:-" has been sent to the file.
From a previous suggestion I had the following lines in my logger setup.
import logging
import signal
import types
logger = logging.getLogg er('pathprofile ')
hdlr = logging.FileHan dler('/var/log/pathprofile/pathprofile.log ')
formatter = logging.Formatt er('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatt er(formatter)
logger.addHandl er(hdlr)
logger.setLevel (logging.INFO)
signal.signal(s ignal.SIGPIPE, signal.SIG_DFL) # for assynchronous
logging
Thanks for any enlightenment.
Nigel King
2004-09-27 08:15:24,864 INFO files used:-
2004-09-27 08:15:24,865 ERROR [Errno 32] Broken pipe
Traceback (most recent call last):
File "/home/pathprofile/public_html/PathProfile/ProcessEmail.py ",
line 42, in ?
emod.processEma il(conf)
File
"/home/pathprofile/public_html/PathProfile/modules/emailmodules.py ",
line 253, in processEmail
PathProfile.Eva luateProfile(fl d, conf)
File
"/home/pathprofile/public_html/PathProfile/modules/PathProfile.py" ,
line 66, in EvaluateProfile
remoteheight= fld['remoteheight'])
File
"/home/pathprofile/public_html/PathProfile/modules/HeightFile.py", line
680, in createPathFile
filesUsed()
File
"/home/pathprofile/public_html/PathProfile/modules/HeightFile.py", line
637, in filesUsed
log.logger.info ('files used:-')
File "/usr/local/lib/python2.3/logging/__init__.py", line 893, in info
apply(self._log , (INFO, msg, args), kwargs)
File "/usr/local/lib/python2.3/logging/__init__.py", line 994, in _log
self.handle(rec ord)
File "/usr/local/lib/python2.3/logging/__init__.py", line 1004, in
handle
self.callHandle rs(record)
File "/usr/local/lib/python2.3/logging/__init__.py", line 1037, in
callHandlers
hdlr.handle(rec ord)
File "/usr/local/lib/python2.3/logging/__init__.py", line 592, in
handle
self.emit(recor d)
File "/usr/local/lib/python2.3/logging/__init__.py", line 684, in emit
self.handleErro r(record)
File "/usr/local/lib/python2.3/logging/__init__.py", line 636, in
handleError
traceback.print _exception(ei[0], ei[1], ei[2], None, sys.stderr)
File "/usr/local/lib/python2.3/traceback.py", line 122, in
print_exception
_print(file, 'Traceback (most recent call last):')
File "/usr/local/lib/python2.3/traceback.py", line 13, in _print
file.write(str+ terminator)
IOError: [Errno 32] Broken pipe 2 8626
On 5 Oct 2004, at 17:15, Vinay Sajip wrote: Are you sure that all you need to do is to set default signal handling for SIGPIPE?
I am not sure at all. Since your email I have reviewed your
documentation and now see the raiseExceptions variable. I presume that
I simply use
logging.raiseEx ceptions = False
after
import logging
I used signal.SIGPIPE after googling for Broken Pipe. I think I will
remove that line.
Random tests I have devised have not revealed this error but Random
input from others has generated the problem, usually after a burst of
activity when previously there has been no activity for several days.
Coincidence?
Thank you very much for your help - and a very useful module.
Nigel King
> documentation and now see the raiseExceptions variable. I presume that I simply use logging.raiseEx ceptions = False after import logging
Yes.
Random tests I have devised have not revealed this error but Random input from others has generated the problem, usually after a burst of activity when previously there has been no activity for several days. Coincidence?
Perhaps not. It may be that the pipe breaks after a period of
inactivity, and subsequent activity shows up the break.
Best of luck,
Vinay This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Frank de Bot |
last post by:
Hi,
occasionaly I find in my apache logs that fastcgi had a broken pipe
error with php running as fastcgi. the logs are like this:
--
> (32)Broken pipe:
> FastCGI: comm with server /opt/guide/ppi.searchy.net/cgi-bin/php.fcgi"
> aborted: write failed
> FastCGI: incomplete
|
by: Chris Jankowski |
last post by:
I am trying to print an image file to a network printer and getting
the following error. This is a Windows based system, using a network
printer.
Any ideas.
Error Message: cannot print image (exceptions.IOError:
Broken pipe)
**************************************************************
Code:
|
by: Ruben |
last post by:
I am reading a large text file a chunk at a time using the
readlines(buffer_size) statement. I get an IOERROR ERRNO 32 Broken
Pipe command when I "pipe" the output to MYSQL database using the
following command:
python script.py | mysql
I am using RED HAT 9 Linux. The problem only happens if I use the pipe
to MYSQL. It breaks but it gets to process around 1000 MYSQL
statements.
|
by: nicogrubert |
last post by:
Hi there
I am trying to read the content of a really large text file (1GByte) and I get
the following exception if I try to call readlines() on the opened textfile:
IOError: Cannot allocate memory
This is my code:
INFILE="/home/myuser/myfile"
|
by: Pascal Ehlert |
last post by:
I don't know if this is the right newsgroup because the question is maybe a bit linux specific so if not slap me ;-)
I'm trying to send the output of a perl-script to a socket.
So I'm opening a pipe to the program (FILE fp = popen("foobar.pl", "r")) and read and write it directly to the socket.. This is my code:
------
while(!feof(fp))
{
bytes = fread(b,1,1024,fp);
fwrite(b,1,bytes,sock);
| |
by: Marco |
last post by:
Hello,every one, I meet a question:
in my old script, I usually use os.popen2() to get info from standard
unix(LinuX) program like ps,ifconfig...
Now, I write a OO-based programme, I still use os.popen2( check
whether mplayer still working via ps command ), but some things I got
the following message:
Traceback (most recent call last):
|
by: 7stud |
last post by:
Hi,
Can someone explain what a broken pipe is? The following produces a
broken pipe error:
----------
import subprocess as sub
p = sub.Popen(, stdin=sub.PIPE, stdout=sub.PIPE)
|
by: Gilles Ganault |
last post by:
Hello
I'm trying to use urllib to download web pages with the GET method,
but Python 2.5.1 on Windows turns the URL into something funny:
========
url = "amazon.fr/search/index.php?url=search"
|
by: Ravikumar S |
last post by:
Hi,
I am new to Perl trying to setup an environment for learning Perl. Here is what I have done.
1. I have installed Perl 5.12.2 Build 1202
2. I have installed Abyss Web server X1(free version)
3. Followed the instruction to associate Perl with the webserver from this link:
http://www.aprelium.com/abyssws/perl.html
4. I am trying to run the simple script (code attached below)but I am getting
CGI: URI: /test.pl Broken pipe. Please...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |