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. Advertisements

  2. Looks like a real bug to me. In fact it is already reported:
    http://bugs.python.org/issue4604
     
    Gabriel Genellina, Dec 9, 2008
    #2
    1. Advertisements

  3. resi147

    resi147 Guest


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

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.