473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

open('.', 'rb') on python 2.3

Hi,

Simple code fails in python 2.3:

[root@maja rdiff-backup]# python
Python 2.3 (#1, Jul 31 2003, 10:41:08)
[GCC 3.3 (PLD Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import os
fp = open('.', 'rb') Traceback (most recent call last):
File "<stdin>", line 1, in ?
IOError: [Errno 21] Is a directory
but works in 2.2
[arekm@perfo arekm]$ python
Python 2.2.2 (#1, Dec 28 2002, 23:32:35)
[GCC 2.95.4 20010319 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information. import os
fp = open('.', 'rb')


Is that bug, bugfix, change in python 2.3? (patch of course welcome)

System is Linux 2.4.21, glibc 2.3.2, filesystem ext3, xfs.

--
Arkadiusz Mi¶kiewicz CS at FoE, Wroclaw University of Technology
arekmatssedotpl AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux

Jul 18 '05 #1
1 6285
Well, open is just an alias for file, so my novice butt is guessing
bugfix.

And once you've opened it; it doesn't seem there's much you can do with it
anyway. (this is in 2.2)
x = file('.', 'rb')
x.readline()

Traceback (most recent call last):
File "<pyshell#11>", line 1, in ?
x.readline()
IOError: [Errno 21] Is a directory
Keith
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Carlos Ribeiro | last post by:
Hello all, I'm posting this to the list with the intention to form a group of people interested in this type of solution. I'm not going to spam the list with it, unless for occasional and...
3
by: mep | last post by:
Hi, all I view my python 2.3.4 from python.org by VC6's dependency walker tool. What suprise me is that python.exe and python32.dll are built into *DEBUG* version. Is it intend to do so?Is a...
3
by: Sean | last post by:
Was wondering if there was any difference between these two functions. I have read some text that said file() wasn't introduced until 2.2 and that it was synonymous with open(). Does this mean...
0
by: Ian A. York | last post by:
MacOS 10.3.8, Python 2.3. I installed both Tkinter and appscript yesterday. Now when I open python (or pythonw) in the Terminal I get the following: Python 2.3 (#1, Sep 13 2003, 00:49:11) on...
5
by: slava | last post by:
hello, i am writing a python script that will be run by a non root user the script needs to open a file in write mode that is owned by root file = open('/etc/apt/sources.list', 'r+') ...
10
by: Elric02 | last post by:
I'm currently trying to get access to the Python source code, however whenever I try to extract the files using the latest version of WinZip (version 10) I get the following error "error reading...
12
by: adamurbas | last post by:
ya so im pretty much a newb to this whole python thing... its pretty cool but i just started today and im already having trouble. i started to use a tutorial that i found somewhere and i followed...
5
by: alexteo21 | last post by:
I have created a script using python that will batch process data files every hour The script is running on Solaris. Python version 2.3.3 t=open(filename,'rb') data=t.read() #processing...
6
by: Larry Hale | last post by:
Greetings, Pythonistas! My employer has a Squid Proxy between my Python programs and The Internet. I've searched high-and-low, and can only find examples online of how to do basic...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.