close has no effect on Mac OSX Python 3.0

Discussion in 'Python' started by resi147, Dec 8, 2008.

  1. resi147

    resi147 Guest

    I'm wondering if it's really a bug since it's so trivial:

    fp = open('/etc/services')
    ct = fp.read(1048)
    print(ct[-80:], end='')
    fp.close()
    ct = fp.read(17)
    print(ct)

    the second read should fail, but happily continues reading the file.
    Really a bug?
    As said in the subject, I use MacOSX 10.5.5 with Python 3.0,
    officially released
    these days.

    Karl
    resi147, Dec 8, 2008
    #1
    1. Advertising

  2. En Mon, 08 Dec 2008 20:09:23 -0200, resi147 <> escribió:

    > I'm wondering if it's really a bug since it's so trivial:
    >
    > fp = open('/etc/services')
    > ct = fp.read(1048)
    > print(ct[-80:], end='')
    > fp.close()
    > ct = fp.read(17)
    > print(ct)
    >
    > the second read should fail, but happily continues reading the file.
    > Really a bug?


    Looks like a real bug to me. In fact it is already reported:
    http://bugs.python.org/issue4604

    --
    Gabriel Genellina
    Gabriel Genellina, Dec 9, 2008
    #2
    1. Advertising

  3. resi147

    resi147 Guest

    On 9 Dez., 07:51, "Gabriel Genellina" <> wrote:
    > En Mon, 08 Dec 2008 20:09:23 -0200, resi147 <> escribió:
    >
    > > I'm wondering if it's really a bug since it's so trivial:

    >
    > > fp = open('/etc/services')
    > > ct = fp.read(1048)
    > > print(ct[-80:], end='')
    > > fp.close()
    > > ct = fp.read(17)
    > > print(ct)

    >
    > > the second read should fail, but happily continues reading the file.
    > > Really a bug?

    >
    > Looks like a real bug to me. In fact it is already reported:http://bugs.python.org/issue4604
    >
    > --
    > Gabriel Genellina



    Thanks to Skip Montanaro, he did it (for me, thanks :)

    Karl.
    resi147, Dec 9, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher Mahan
    Replies:
    1
    Views:
    450
    Simon Burton
    Nov 16, 2003
  2. edadk

    Problem with Python on MAC OSX

    edadk, Jun 29, 2004, in forum: Python
    Replies:
    4
    Views:
    474
    Ronald Oussoren
    Jun 30, 2004
  3. Sven Hilmahr
    Replies:
    0
    Views:
    333
    Sven Hilmahr
    Sep 23, 2004
  4. MichaelW
    Replies:
    1
    Views:
    564
    Kevin Walzer
    Nov 23, 2005
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    847
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page