[Patches] [ python-Patches-416251 ] 2.1c1 mmapmodule: unused vrbl cleanup

noreply@sourceforge.net noreply@sourceforge.net
Thu, 10 May 2001 07:19:57 -0700


Patches item #416251, was updated on 2001-04-15 04:26
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416251&group_id=5470

Category: Modules
Group: None
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Mark Favas (mfavas)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: 2.1c1 mmapmodule: unused vrbl cleanup

Initial Comment:
Variable set but unused

*** mmapmodule.c.orig   Sun Apr 15 18:37:16 2001
--- mmapmodule.c        Sun Apr 15 18:38:43 2001
***************
*** 163,169 ****
  mmap_read_byte_method(mmap_object *self,
                      PyObject *args)
  {
-       char value;
        char *where;
        CHECK_VALID(NULL);
          if (!PyArg_ParseTuple(args, ":read_byte"))
--- 163,168 ----
***************
*** 170,176 ****
                return NULL;
        if (self->pos < self->size) {
                where = self->data + self->pos;
-               value = (char) *(where);
                self->pos += 1;
                return Py_BuildValue("c", (char)
*(where));
        } else {
--- 169,174 ----


----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-05-10 07:19

Message:
Logged In: YES 
user_id=3066

Trouble found -- this was a bogosity on my part (which is
better than the alternatives, I suppose).

The mmap test creates a temporary file named "foo" in the
"w+" mode; I happened to have created a named pipe named
"foo" in the same directory while working on another bug and
had failed to clean it up.  So of course most operations on
it as a normal file object were pretty bogus!  ;-)

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-05-09 13:25

Message:
Logged In: YES 
user_id=31435

Could you please look at the "before" and "after" code and 
try to guess why?

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-05-09 12:39

Message:
Logged In: YES 
user_id=3066

Reopening -- the fix introduced breakage on Linux (kernel
2.2.17):

cj42289-a(.../python/linux-beowolf); ./python
../Lib/test/regrtest.py -v test_mmap
test_mmap
test_mmap
test test_mmap crashed -- exceptions.IOError: [Errno 22]
Invalid argument
Traceback (most recent call last):
  File "../Lib/test/regrtest.py", line 246, in runtest
    __import__(test, globals(), locals(), [])
  File "../Lib/test/test_mmap.py", line 124, in ?
    test_both()
  File "../Lib/test/test_mmap.py", line 14, in test_both
    f.write('\0'* PAGESIZE)
IOError: [Errno 22] Invalid argument
1 test failed: test_mmap


----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-05-09 11:48

Message:
Logged In: YES 
user_id=31435

Checked in a similar change, to mmapmodule.c rev 2.29.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416251&group_id=5470