Task #3260 (closed)
Bug: OmeroCli prints out "I/O operation on closed file"
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | major | Milestone: | OMERO-Beta4.2.1 |
Component: | OmeroPy | Version: | n.a. |
Keywords: | n.a. | Cc: | |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2010-11-11 (19) |
Description
jboss@nightshade ~/OMERO-CURRENT $ bin/omero group list Previously logged in to localhost as cxallan Server: [localhost] Username: [jboss]root Password: Created session a66538a2-bd7c-411c-a96d-8fd2c04897de (root@localhost). Idle timeout: 10.0 min. Current group: system id | name | perms | # of owners | # of members -----+--------------------+--------+-------------+-------------- 0 | system | rw---- | 1 | 1 1 | user | rw---- | 2 | 105 2 | default | rw---- | 0 | 63 3 | Swedlow Lab | rwr--- | 2 | 8 4 | Swedlow Lab OMERO | rwr--- | 0 | 5 5 | Nathke lab | rw---- | 0 | 7 6 | Usable Image | rw---- | 0 | 7 7 | Gartner Lab | rw---- | 0 | 2 8 | Perkins lab | rw---- | 0 | 2 9 | Tanaka Lab | rw---- | 0 | 2 10 | Blow lab | rw---- | 0 | 2 11 | Lamond lab | rw---- | 0 | 8 12 | Hardie lab | rw---- | 0 | 2 13 | guest | rw---- | 0 | 1 700 | Storey lab | rw---- | 0 | 2 701 | Hay lab | rw---- | 0 | 2 750 | Melpi Lab | rw---- | 0 | 1 751 | DEMO | rw---- | 0 | 2 801 | fourtwo | rw---- | 0 | 1 852 | NSW Lab | rwrw-- | 1 | 8 902 | Former Swedlow Lab | rw---- | 0 | 4 (21 rows) Traceback (most recent call last): File "/usr/lib/python2.4/logging/__init__.py", line 737, in emit self.stream.write(fs % msg) ValueError: I/O operation on closed file
Change History (5)
comment:1 Changed 13 years ago by jmoore
comment:2 Changed 13 years ago by jmoore
Hacking a "print record" here:
def emit(self, record): """ Emit a record. If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline [N.B. this may be removed depending on feedback]. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. """ try: msg = self.format(record) fs = "%s\n" if not hasattr(types, "UnicodeType"): #if no unicode support... self.stream.write(fs % msg) else: try: self.stream.write(fs % msg) except UnicodeError: self.stream.write(fs % msg.encode("UTF-8")) self.flush() except (KeyboardInterrupt, SystemExit): raise except: print record self.handleError(record)
I found that the message being printed was:
<LogRecord: omero.util.Resources, 20, /home/jboss/OMERO.server-4.2.1-DEV-r8558-trunk-b1236/lib/python/omero/util/__init__.py, 533, "Halted">
comment:3 Changed 13 years ago by jmoore
- Owner set to jmoore
- Status changed from new to assigned
comment:4 Changed 13 years ago by jmoore
- Remaining Time set to 0
- Resolution set to fixed
- Status changed from assigned to closed
comment:5 Changed 13 years ago by jmoore <josh@…>
(In [20d1ce9cb37b929e33bb410d47871e9493a36e8e/ome.git] on branch dev_4_1_custom) Added AtExitEvent to prevent logging on atexit (Fix #3260)
git-svn-id: file:///home/svn/omero/trunk@8579 05709c45-44f0-0310-885b-81a1db45b4a6
NB: Had to remove references in omero/cli.py and processor.py
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
Possible related: http://bugs.python.org/issue6333