Opened 14 years ago

Closed 10 years ago

#179 closed defect (fixed)

"KeyError: '\n'" from foolscap.test.test_logging.Filter.test_basic on Windows

Reported by: davidsarah Owned by: davidsarah
Priority: major Milestone: 0.8.0
Component: unknown Version: 0.6.1
Keywords: windows Cc:

Description

The following error occurs, in addition to the one in #178, when running the test suite on Windows (XP SP3 32-bit on VirtualBox?, in case that matters):

[ERROR]
Traceback (most recent call last):
  File "C:\cygwin\home\David-Sarah\tahoe\trunk\support\Lib\site-packages\foolscap-0.6.1-py2.7.egg\fo
olscap\test\test_logging.py", line 1876, in _check
    self.compare_events(events, self._read_logfile(fn2))
  File "C:\cygwin\home\David-Sarah\tahoe\trunk\support\Lib\site-packages\foolscap-0.6.1-py2.7.egg\fo
olscap\test\test_logging.py", line 219, in _read_logfile
    events.append(pickle.load(f))
  File "C:\python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "C:\python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
exceptions.KeyError: '\n'

foolscap.test.test_logging.Filter.test_basic

Change History (10)

comment:1 Changed 14 years ago by davidsarah

I'm guessing, but this could possibly be a corrupt pickle file written in text, rather than binary mode.

comment:2 Changed 14 years ago by davidsarah

If I replace all of the "w" file open modes in foolscap with "wb", I get the following error in the same test instead:

[ERROR]
Traceback (most recent call last):
  File "C:\cygwin\home\David-Sarah\tahoe\trunk\support\Lib\site-packages\foolscap-0.6.1-py2.7.egg\fo
olscap\test\test_logging.py", line 1887, in _check
    (out,err) = cli.run_flogtool(argv[1:], run_by_human=False)
  File "C:\cygwin\home\David-Sarah\tahoe\trunk\support\Lib\site-packages\foolscap-0.6.1-py2.7.egg\fo
olscap\logging\cli.py", line 103, in run_flogtool
    dispatch(command, so)
  File "C:\cygwin\home\David-Sarah\tahoe\trunk\support\Lib\site-packages\foolscap-0.6.1-py2.7.egg\fo
olscap\logging\cli.py", line 67, in dispatch
    f.run(options)
  File "C:\cygwin\home\David-Sarah\tahoe\trunk\support\Lib\site-packages\foolscap-0.6.1-py2.7.egg\fo
olscap\logging\filter.py", line 103, in run
    os.rename(newfilename, options.newfile)
exceptions.WindowsError: [Error 183] Cannot create a file when that file already exists

foolscap.test.test_logging.Filter.test_basic

Possibly the KeyError was masking this one.

comment:3 in reply to:  2 Changed 14 years ago by davidsarah

Replying to davidsarah:

If I replace all of the "w" file open modes in foolscap with "wb", I get the following error in the same test instead: [...]

Filed as #180.

comment:4 Changed 14 years ago by Brian Warner

Whoops, yeah, I used to be pretty careless about binary-mode, and we don't have a windows buildslave to catch these things. Give me a patch and I'll land it. Thanks!

comment:5 Changed 14 years ago by davidsarah

Owner: set to davidsarah
Status: newassigned

comment:6 Changed 13 years ago by davidsarah

Keywords: windows added
Milestone: undecidedeventually

Looks like I completely forgot about this.

comment:7 Changed 12 years ago by Brian Warner

Milestone: eventually0.6.4

Hopefully this should be fixed by [20e9078], I spotted one missing mode=b.

comment:8 Changed 12 years ago by davidsarah

Oh, I should check whether this is fixed.

comment:9 Changed 10 years ago by Brian Warner

Milestone: 0.6.40.8.0

ping?

comment:10 Changed 10 years ago by Brian Warner

Resolution: fixed
Status: assignedclosed

I was able to rustle up a windows VM to run this on, and I think all the obvious windows failures have been fixed. There are still some timing-sensitive failures (in Negotiate), but I think those aren't serious. I'm going to call this closed.

Note: See TracTickets for help on using tickets.