Message from discussion
web.py' net.py
Received: by 10.216.132.150 with SMTP id o22mr880188wei.0.1329183796228;
Mon, 13 Feb 2012 17:43:16 -0800 (PST)
X-BeenThere: webpy@googlegroups.com
Received: by 10.216.141.29 with SMTP id f29ls1487566wej.1.gmail; Mon, 13 Feb
2012 17:43:11 -0800 (PST)
Received: by 10.216.139.86 with SMTP id b64mr880257wej.5.1329183791900;
Mon, 13 Feb 2012 17:43:11 -0800 (PST)
Received: by 10.216.69.74 with SMTP id m52mswed;
Mon, 13 Feb 2012 13:41:11 -0800 (PST)
Received: by 10.205.129.137 with SMTP id hi9mr1627022bkc.8.1329169271244;
Mon, 13 Feb 2012 13:41:11 -0800 (PST)
Received: by 10.205.129.137 with SMTP id hi9mr1627021bkc.8.1329169271230;
Mon, 13 Feb 2012 13:41:11 -0800 (PST)
Return-Path: <perdmann...@googlemail.com>
Received: from mail-bk0-f48.google.com (mail-bk0-f48.google.com [209.85.214.48])
by gmr-mx.google.com with ESMTPS id 20si24886738bko.3.2012.02.13.13.41.11
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 13 Feb 2012 13:41:11 -0800 (PST)
Received-SPF: pass (google.com: domain of perdmann...@googlemail.com designates 209.85.214.48 as permitted sender) client-ip=209.85.214.48;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of perdmann...@googlemail.com designates 209.85.214.48 as permitted sender) smtp.mail=perdmann...@googlemail.com; dkim=pass (test mode) header...@googlemail.com
Received: by bkcjm1 with SMTP id jm1so5914859bkc.21
for <webpy@googlegroups.com>; Mon, 13 Feb 2012 13:41:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlemail.com; s=gamma;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
bh=Km/4hEdu1oriBNhMnIvFB+mvPkmeI6pVVV4qVvaN110=;
b=RV/d9mu/MlP93f2n20OUmuZXbGUQ4R7jvF0R/lgpnBpzIl5dmDLQtAZk9FDL35aHEw
2nR4t5hTTtRFR9hs2zoBIfhFMJiht5wcUXq9IIYXJJN3QgHKWyoLm0DKQlbTIk7bl+p2
pTiBxLQ5EK53+iYRCsv0crW6YA36ux3wN1dO8=
Received: by 10.204.154.136 with SMTP id o8mr8143780bkw.112.1329169271044;
Mon, 13 Feb 2012 13:41:11 -0800 (PST)
Return-Path: <perdmann...@googlemail.com>
Received: from [192.168.69.21] (i5E86A48B.versanet.de. [94.134.164.139])
by mx.google.com with ESMTPS id jd17sm49966631bkb.4.2012.02.13.13.41.08
(version=SSLv3 cipher=OTHER);
Mon, 13 Feb 2012 13:41:09 -0800 (PST)
Message-ID: <4F398373.9010...@googlemail.com>
Date: Mon, 13 Feb 2012 22:41:07 +0100
From: Patrick <perdmann...@googlemail.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16
MIME-Version: 1.0
To: webpy@googlegroups.com
Subject: Re: [webpy] web.py' net.py
References: <4F33B04C.4030...@perdmann.de> <CAHmMJ+NtiCE+1JpfCWJFguR-62-ME3nBtG9uzcnnG8R1hPR...@mail.gmail.com>
In-Reply-To: <CAHmMJ+NtiCE+1JpfCWJFguR-62-ME3nBtG9uzcnnG8R1hPR...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
f is image data, see here:
x = web.input(bilder={})
b.set_image(x.bilder.file)
----
f = x.bilder.file
----
And the failure happens in
/web/net.py
Am 09.02.2012 16:23, schrieb Primoz Anzur:
> What is 'f'? Is it image data or the filename?
>
> On Thu, Feb 9, 2012 at 12:38 PM, Patrick Erdmann <patr...@perdmann.de
> <mailto:patr...@perdmann.de>> wrote:
>
> Hi,
>
> when i try to upload images i get following Error:
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position
> 0: invalid start byte
>
> . Everything works fine until i call Image.open(f), from PIL import
> Image.
>
> x = web.input(bilder={})
> b = Bilder()
> b.set_image(x.bilder.file)
> b.save()
>
> ...
> class Bilder(Document):
> ...
> def set_image(self, f):
> _i = Image.open(f, 'wb')
> ...
>
>
> --
> Mit freundlichen Gr��en
>
> Patrick Erdmann
>
> XMPP/Mail: patr...@perdmann.de <mailto:patr...@perdmann.de>
>
> --
> You received this message because you are subscribed to the Google
> Groups "web.py" group.
> To post to this group, send email to webpy@googlegroups.com
> <mailto:webpy@googlegroups.com>.
> To unsubscribe from this group, send email to
> webpy+unsubscribe@__googlegroups.com
> <mailto:webpy%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/__group/webpy?hl=en
> <http://groups.google.com/group/webpy?hl=en>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "web.py" group.
> To post to this group, send email to webpy@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.