regsub Problem

Detlef Lannert nospam-5a165f24 at lannert.rz.uni-duesseldorf.de
Tue Jul 28 20:42:56 EDT 1998


"Thorsten Fenk" wrote:
Status: RO

> 
> query="/usr/local/bin/glimpse -y -l -O -H /usr3/doc/ "
> such=regsub.gsub("/usr3/doc", "http://ripley.westfalen.de/doc",
       os.popen(query + begr, "r"))
> 

Hast Du schon mal versucht, ...os.popen(...).read() zu schreiben?
(Allerdings geht der Kommando-Returncode verloren, wenn man kein
explizites close() veranstaltet.)

> Heraus kommt jedoch die Fehlermeldung
> 
>   File "/usr/local/httpd/cgi-bin/such.py", line 18, in ?
>     such=regsub.gsub("/usr3/doc", "http://ripley.westfalen.de/doc", os.popen(query + begr, "r"))
>   File "/usr/local/lib/python1.5/regsub.py", line 37, in gsub
>     while prog.search(str, start) >= 0:
> TypeError: read-only buffer, file
> 
> Was hat das zu bedeuten ?

Es wird ein String erwartet, Du lieferst ein Dateiobjekt.

  Detlef

--
The reply address for this message will become invalid after 1998-08-11.
Please write to "lannert" at the domain "uni-duesseldorf.de" if you want
to send me mail after that date.

______________________________________________________________
   python-de          the German Python mailing list
send messages to:   <mailto:python-de at solar.skyport.net>
list manager: <mailto:owner-python-de at solar.skyport.net>
______________________________________________________________




More information about the Python-de mailing list