Paul,

I don't know if it will make a difference, but you could try deleting the
blank line preceding the self.interactive in the first section.  Your diff
is showing a that the blank line in the original does not match the blank
line in the new version indicating some form of white space.  I wouldn't
think that it would make a difference, but not being a python guru I
couldn't be sure.

By the way, what version of tmda are you running?  My patch was against
TMDA/1.0.2 "Bold Forbes".

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Mona
Sent: Friday, October 08, 2004 11:52 AM
To: 'David Grimberg'; [EMAIL PROTECTED]
Subject: RE: bug report: tmda-pending and /dev/tty

Ok, I have made the changes but I still receive the same error.
Latest diff


[EMAIL PROTECTED] TMDA]# diff -c Pending.py.orig Pending.py
*** Pending.py.orig     2004-10-08 08:28:35.000000000 -0700
--- Pending.py  2004-10-08 11:38:31.000000000 -0700
***************
*** 64,70 ****
          self.verbose = verbose
          self.younger = younger
          self.pretend = pretend
!
          self.stdout = sys.stdout


--- 64,71 ----
          self.verbose = verbose
          self.younger = younger
          self.pretend = pretend
!
!         self.interactive = 0
          self.stdout = sys.stdout


***************
*** 86,93 ****
                      self.msgs.extend(line.strip().split())
                  self.msgs.remove('-')
                  # re-open stdin on the tty
!                 sys.stdin.close()
!                 sys.stdin = open('/dev/tty', 'r')

          if not self.msgs and not wantedstdin:
              cwd = os.getcwd()
--- 87,95 ----
                      self.msgs.extend(line.strip().split())
                  self.msgs.remove('-')
                  # re-open stdin on the tty
!                 if self.interactive:
!                   sys.stdin.close()
!                   sys.stdin = open('/dev/tty', 'r')

          if not self.msgs and not wantedstdin:
              cwd = os.getcwd()
***************
*** 341,346 ****
--- 343,349 ----
                         younger,
                         pretend)

+         self.interactive = 1

      def initQueue(self):
          """Additionally initialize the interactive queue."""










 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of David Grimberg
Sent: Friday, October 08, 2004 9:54 AM
To: [EMAIL PROTECTED]
Subject: RE: bug report: tmda-pending and /dev/tty

Hi Paul,

I'm not very proficient with python, but one thing that I learned is that
indentation is very important.

It looks like your indentation may be off.

In the first section the self.interactive should be aligned with the other
self.xxx lines.
In the second section the if should be aligned with the # on the preceding
line and the next two lines should be indented from the if statement.
In the third section the self.interactive should be aligned with the "Q" in
"Queue.__init__(self" above it (which on my system is aligned with the first
"I" in "def initQueue" just below).

HTH,

Dave

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Mona
Sent: Friday, October 08, 2004 8:50 AM
To: 'David Grimberg'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: bug report: tmda-pending and /dev/tty

 
I think I did this right, but if I did, it did not resolve the problem.
Below is my diff of the original and modified file.

[EMAIL PROTECTED] TMDA]# diff -c Pending.py.orig Pending.py
*** Pending.py.orig     2004-10-08 08:28:35.000000000 -0700
--- Pending.py  2004-10-08 08:39:20.000000000 -0700
***************
*** 64,70 ****
          self.verbose = verbose
          self.younger = younger
          self.pretend = pretend
!
          self.stdout = sys.stdout


--- 64,71 ----
          self.verbose = verbose
          self.younger = younger
          self.pretend = pretend
!
!       self.interactive = 0
          self.stdout = sys.stdout


***************
*** 86,91 ****
--- 87,93 ----
                      self.msgs.extend(line.strip().split())
                  self.msgs.remove('-')
                  # re-open stdin on the tty
+               if self.interactive:
                  sys.stdin.close()
                  sys.stdin = open('/dev/tty', 'r')

***************
*** 341,346 ****
--- 343,349 ----
                         younger,
                         pretend)

+       self.interactive = 1

      def initQueue(self):
          """Additionally initialize the interactive queue."""







-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of David Grimberg
Sent: Friday, October 08, 2004 7:55 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: bug report: tmda-pending and /dev/tty

Jesse,

I hit that same error, and on investigating it discovered that when you use
the -b switch tmda-pending runs a subclassed version of the Queue class.  I
took advantage of this difference to and modified the Queue class and it's
subclass InteractiveQueue to have a new "interactive" property that gets
checked by the initQueue method.

You can try the editing your Pending.py file to contain the following new
and revised lines, however, I think you will need to do this by hand since
this is the second revision from the v1.0.2 baseline code, so the line
numbers are likely to be off.

[circle:source> diff -c Pending.v1.0.2.a.py Pending.v1.0.2.b.py
*** Pending.v1.0.2.a.py 2004-08-13 08:51:18.000000000 -0700
--- Pending.v1.0.2.b.py 2004-09-14 10:10:19.000000000 -0700
***************
*** 66,71 ****
--- 66,72 ----
          self.younger = younger
          self.pretend = pretend

+         self.interactive = 0
          self.stdout = sys.stdout


***************
*** 87,94 ****
                      self.msgs.extend(line.strip().split())
                  self.msgs.remove('-')
                  # re-open stdin on the tty
!                 sys.stdin.close()
!                 sys.stdin = open('/dev/tty', 'r')

          if not self.msgs and not wantedstdin:
              cwd = os.getcwd()
--- 88,96 ----
                      self.msgs.extend(line.strip().split())
                  self.msgs.remove('-')
                  # re-open stdin on the tty
!                 if self.interactive:
!                   sys.stdin.close()
!                   sys.stdin = open('/dev/tty', 'r')

          if not self.msgs and not wantedstdin:
              cwd = os.getcwd()
***************
*** 353,358 ****
--- 355,362 ----
                         younger,
                         pretend)

+         self.interactive = 1
+

      def initQueue(self):
          """Additionally initialize the interactive queue."""
[circle:source>

Hope this helps,

Dave Grimberg
Computer Aficionado
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Jesse Guardiani
Sent: Thursday, October 07, 2004 12:53 PM
To: [EMAIL PROTECTED]
Subject: bug report: tmda-pending and /dev/tty

Hello,

When I try to run this line from /etc/crontab under Gentoo Linux:

/usr/bin/tmda-pending -c \
/usr/local/vpopmail/domains/wingnet.net/craig/.tmdarc \ -b -T | egrep -i
"words|I|don't|want|to|see|go|here" \
| awk '{print $1}' | /usr/bin/tmda-pending -c \
/usr/local/vpopmail/domains/wingnet.net/craig/.tmdarc \ -b -d -  

I get this traceback:

Traceback (most recent call last):
  File "/usr/bin/tmda-pending", line 312, in ?
    main()
  File "/usr/bin/tmda-pending", line 303, in main
    pretend = pretend
  File "/usr/lib/python2.3/site-packages/TMDA/Pending.py", line 90, in
initQueue
    sys.stdin = open('/dev/tty', 'r')
IOError: [Errno 6] No such device or address: '/dev/tty'

This is a bug. We shouldn't try to open /dev/tty when operating in batch
mode! I'd love to patch this, but I can't figure out how to accurately
determine if we are interactive or not on line 90 of Pending.py.

Any ideas?


--
Jesse Guardiani, Systems Administrator
WingNET Internet Services,
P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v)  423-559-5145 (f)
http://www.wingnet.net


_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users



_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users



_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to