Re: redirect stderr to syslog?
On 8/15/2014 11:04 PM, Russell E. Owen wrote: We are using the syslog module for logging, and would like to redirect stderr to our log. Is there a practical way to do it? You can replace sys.stderr with any object with a .write(s) method. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: timezone argument %z and %Z
On Sat, Aug 16, 2014 at 12:48 AM, Ben Finney wrote: > > problem 1: > > There are 24 time zone in the world, does any time zone has the time > > zone name such as EST,CST ? > > Are there 24 time zone abbreviations in python ?what are other 22 > > except for EST ,CST ? > > There are *many* time zones in the world, much more than 24. Please read > up on time zones, you should already have plenty of pointers instead of > asking here all the time. You should also be aware that the abbreviations do not always uniquely identify a time zone. For example, "EST" is used in both North America (-0500) and Australia (+1000). It's usually better just to use time zone offsets to avoid this sort of ambiguity. -- https://mail.python.org/mailman/listinfo/python-list
Re: timezone argument %z and %Z
On Sat, Aug 16, 2014 at 6:21 PM, Ian Kelly wrote: > You should also be aware that the abbreviations do not always uniquely > identify a time zone. For example, "EST" is used in both North America > (-0500) and Australia (+1000). It's usually better just to use time zone > offsets to avoid this sort of ambiguity. And about fifty other time zones, too. Offsets are great if you want that simplicity, but the only reliable way to handle time zones with DST changes is a tzdata identifier like "Australia/Adelaide" or "America/New_York" (which correspond to the two meanings of EST that you mentioned). ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: string encoding regex problem
Philipp Kraus wrote:
> The code works till last week correctly, I don't change the pattern.
Websites' contents and structure change sometimes.
> My question is, can it be a problem with string encoding?
Your regex is all-ascii. So an encoding problem is very unlikely.
> found = re.search( " href=\"/projects/boost/files/latest/download\?source=files\"
> title=\"/boost/(.*)",
> data)
> Did I mask the question mark and quotes
> correctly?
Yes.
A quick check...
>>> data =
>>> urllib.urlopen("http://sourceforge.net/projects/boost/files/boost/";).read()
>>> re.compile("/projects/boost/files/latest/download\?source=files.*?>").findall(data)
['/projects/boost/files/latest/download?source=files"
title="/boost-docs/1.56.0/boost_1_56_pdf.7z: released on 2014-08-14 16:35:00
UTC">']
...reveals that the matching link has "/boost-docs/" in its title, so the
site contents probably did change.
--
https://mail.python.org/mailman/listinfo/python-list
Re: redirect stderr to syslog?
In article <[email protected]>, Steven D'Aprano wrote: > Russell E. Owen wrote: > > > I realize the logging module supports this and has a syslog writer, so > > that's a fallback. But we were hoping to use the syslog module for > > performance. > > Have you benchmarked your code and discovered that using the logging module > makes a noticeable difference to performance? That's the question I was going to ask. We're pushing many 10's of GB through the logging module every day. It doesn't even show up on our performance profiles. -- https://mail.python.org/mailman/listinfo/python-list
Topological Overlap
Hello I have a file with network node pairs and weights as time difference I am trying to find the topological overlap of that data I have been searching for any sample in python but i dont seem to find any. Any suggestion in start with are appreciated Thanks Lav -- https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
Dominique Ramaekers wrote:
> I've got a little script:
>
> #!/usr/bin/env python3
> print("Content-Type: text/html")
> print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
> print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
> print("")
> f = open("/var/www/cgi-data/index.html", "r")
> for line in f:
> print(line,end='')
>
> If I run the script in the terminal, it nicely prints the webpage
> 'index.html'.
>
> If access the script through a webbrowser, apache gives an error:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 1791: ordinal not in range(128)
>
> I've done a hole afternoon of reading on fora and blogs, I don't have a
> solution.
>
> Can anyone help me?
If the input and output encoding are the same you can avoid the byte-to-text
(and subsequent text-to-byte conversion) and serve the binary contents of
the index.html file directly:
#!/usr/bin/env python3
import sys
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
sys.stdout.flush()
with open("/var/www/cgi-data/index.html", "rb") as f:
for line in f:
sys.stdout.buffer.write(line)
The flush() is necessary to write pending data before accessing the lowlevel
stdout.buffer. Instead of the loop you can use any of these:
sys.stdout.buffer.write(f.read()) # not for huge files, but should be OK for
# typical html file sizes
sys.stdout.buffer.writelines(f)
shutil.copyfileobj(f, sys.stdout.buffer) # show off your knowledge
# of the stdlib ;)
Alternatively you could choose an encoding via the locale:
#!/usr/bin/env python3
import locale
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
with open("/var/www/cgi-data/index.html") as f:
for line in f:
print(line, end='')
Python should then use UTF-8 as the default for i/o and the resulting
scripts looks more familiar.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
On Fri, 15 Aug 2014 20:10:25 +0200, Dominique Ramaekers wrote:
> #!/usr/bin/env python3
> print("Content-Type: text/html")
> print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
> print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
> print("")
> f = open("/var/www/cgi-data/index.html", "r")
> for line in f:
> print(line,end='')
>
> If I run the script in the terminal, it nicely prints the webpage
> 'index.html'.
>
> If access the script through a webbrowser, apache gives an error:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 1791: ordinal not in range(128)
Is this a message appearing in the apache error log or in the browser? If
it is appearing in the browser, this is probably apache passing through a
python error message.
Is this the complete error message?
What happens when you try and access http://[server]/cgi-data/index.html
directly in a web browser? You may need to copy the file to a different
directory to do this depending on the apache configuration.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
Re: Topological Overlap
Homework? You need to give us a start, sample of the data and an actual question. I don't think many people will help you do your homework for you. On Sat, Aug 16, 2014 at 7:32 AM, lavanya addepalli wrote: > Hello > > I have a file with network node pairs and weights as time difference > I am trying to find the topological overlap of that data > > I have been searching for any sample in python but i dont seem to find > any. > > Any suggestion in start with are appreciated > > > Thanks > Lav > > -- > https://mail.python.org/mailman/listinfo/python-list > > -- George R. C. Silva SIGMA Consultoria http://www.consultoriasigma.com.br/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Topological Overlap
Hello It is not a homework really. Actually it is a huge project and topological overlap is one part in that inputfile: 0_node_1 0_node_2 w0 1_node_1 1_node_2 w1 2_node_1 2_node_2 w2 3_node_1 3_node_2 w3 4_node_1 4_node_2 w4 5_node_1 5_node_2 w5 2 nodes in pair and w is the weight. I have to find the topological overlap in the network including the weights On Sat, Aug 16, 2014 at 7:59 PM, George Silva wrote: > Homework? > > You need to give us a start, sample of the data and an actual question. I > don't think many people will help you do your homework for you. > > > On Sat, Aug 16, 2014 at 7:32 AM, lavanya addepalli > wrote: > >> Hello >> >> I have a file with network node pairs and weights as time difference >> I am trying to find the topological overlap of that data >> >> I have been searching for any sample in python but i dont seem to find >> any. >> >> Any suggestion in start with are appreciated >> >> >> Thanks >> Lav >> >> -- >> https://mail.python.org/mailman/listinfo/python-list >> >> > > > -- > George R. C. Silva > SIGMA Consultoria > > http://www.consultoriasigma.com.br/ > -- https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
I fond my problem, I will describe it more at the bottom of this message...
But first...
Thanks Alister for the tips:
1) This evening, I've researched WSGI. I found that WSGI is more
advanced than CGI and I also think WSGI is more the Python way. I'm an
amateur playing around with my imagination on a small virtual server
(online cloudserver.ramaekers-stassart.be). I'm trying to build
something rather specific. I also like to make things as basic as
possible. My first thought was not to use a framework. This because with
a framework I didn't really know what the code is doing. For a
framework, for me, would be a black-box. But after inspecting WSGI, I
got the idea not to make it myself more difficult than it has to be. I
will work with a framework and I think I'll put my chances on Falcon
(for it's speed, small size and it doesn't seem to difficult)... There
are a lot of frameworks, so if someone wants to point me to an other
framework, I'm open to suggestions...
2) Your tip, to use 'encode' did not solve the problem and created a new
one. My lines were incapsulted in quotes and I got a lot of \b's and
\n's... and I still got the same error.
3) I didn't got the message from JMF, so...
What seems to be the problem:
My Script was ok. I know this because in the terminal I got my expected
output. Python3 uses UTF-8 coding as a standard. The problem is, when
python 'prints' to the apache interface, it translates the string to
ascii. (Why, I never found an answer). Somewhere in the middle of my
index.html file, there are letters like ë and ü. If Python tries to
translate these, Python throws an error. If I delete these letters in
the file, the script works perfectly in a browser! In Python2.7 the
script can easily be tweaked so the translation to ascii isn't done, but
in Python3, its a real pain in the a... I've read about people who
managed to force Python3 to 'print' to apache in UTF-8, but none of
their solutions worked for me.
I think the programmers of Python doesn't want to focus on Python +
apache + CGI (I think it only happens with apache and not with an other
http-server). I don't think they do this intentional but I guess they
assume that if you use Python to make a web-application, you also use
mod_wsgi or mod_python (in apache)...
So I'll use wsgi, It's a little more work but it seems really neat...
grtz
Op 15-08-14 om 21:27 schreef alister:
On Fri, 15 Aug 2014 20:10:25 +0200, Dominique Ramaekers wrote:
Hi,
I've got a little script:
#!/usr/bin/env python3 print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
f = open("/var/www/cgi-data/index.html", "r")
for line in f:
print(line,end='')
If I run the script in the terminal, it nicely prints the webpage
'index.html'.
If access the script through a webbrowser, apache gives an error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
1791: ordinal not in range(128)
I've done a hole afternoon of reading on fora and blogs, I don't have a
solution.
Can anyone help me?
Greetings,
Dominique.
1) this is not the way to get python to generate a web page, if you dont
want to use an existing framework (for example if you are doing this ans
an educational exercise) i suggest to google SWGI
2) you need to encode your output strings into a format apache/html
protocols can support - UTF8 is probably best here.
change your pint function to
print(line.encode('utf'),end='')
3) Ignore any subsequent advice from JMF even when he is trying to help
he is invariable wrong.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
Hi John,
The error is in the line "print(line,end='')"... and it only happens
when the script is started from a webbrowser. In the terminal, the
script works fine.
See my previous mail for my findings after a lot of reading and trying...
grz
Op 15-08-14 om 21:32 schreef John Gordon:
In Dominique Ramaekers
writes:
#!/usr/bin/env python3
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
f = open("/var/www/cgi-data/index.html", "r")
for line in f:
print(line,end='')
If access the script through a webbrowser, apache gives an error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
1791: ordinal not in range(128)
The error traceback should display exactly where the error occurs within
the script. Which line is it?
--
https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
Hi Peter,
Your code seems interesting.
I've tried using sys.stdout (in a slightly different form) but it gave
the same error.
I also read about people who fixed the error by changing the servers
locale to en_US.UTF-8. The people who posted these fixes also said that
you can only use en_US.UTF-8 (and not ex. nl_BE.UTF8)... Anyway, It
didn't work for me. And I find this a dirty fix because, I don't want to
use US locale...
Please excuse me not to try out your specific solutions. I've already
started to implement WSGI over CGI. See my previous message...
grz
Op 16-08-14 om 13:17 schreef Peter Otten:
Dominique Ramaekers wrote:
I've got a little script:
#!/usr/bin/env python3
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
f = open("/var/www/cgi-data/index.html", "r")
for line in f:
print(line,end='')
If I run the script in the terminal, it nicely prints the webpage
'index.html'.
If access the script through a webbrowser, apache gives an error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
1791: ordinal not in range(128)
I've done a hole afternoon of reading on fora and blogs, I don't have a
solution.
Can anyone help me?
If the input and output encoding are the same you can avoid the byte-to-text
(and subsequent text-to-byte conversion) and serve the binary contents of
the index.html file directly:
#!/usr/bin/env python3
import sys
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
sys.stdout.flush()
with open("/var/www/cgi-data/index.html", "rb") as f:
for line in f:
sys.stdout.buffer.write(line)
The flush() is necessary to write pending data before accessing the lowlevel
stdout.buffer. Instead of the loop you can use any of these:
sys.stdout.buffer.write(f.read()) # not for huge files, but should be OK for
# typical html file sizes
sys.stdout.buffer.writelines(f)
shutil.copyfileobj(f, sys.stdout.buffer) # show off your knowledge
# of the stdlib ;)
Alternatively you could choose an encoding via the locale:
#!/usr/bin/env python3
import locale
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
with open("/var/www/cgi-data/index.html") as f:
for line in f:
print(line, end='')
Python should then use UTF-8 as the default for i/o and the resulting
scripts looks more familiar.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
Hi Denis,
This error is a python error displayed in the apache error log. The
complete message is:
[Sat Aug 16 23:12:42.158326 2014] [cgi:error] [pid 29327] [client
119.63.193.196:0] AH01215: Traceback (most recent call last):
[Sat Aug 16 23:12:42.158451 2014] [cgi:error] [pid 29327] [client
119.63.193.196:0] AH01215: File "/var/www/cgi-python/index.html",
line 12, in
[Sat Aug 16 23:12:42.158473 2014] [cgi:error] [pid 29327] [client
119.63.193.196:0] AH01215: for line in f:
[Sat Aug 16 23:12:42.158526 2014] [cgi:error] [pid 29327] [client
119.63.193.196:0] AH01215: File
"/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
[Sat Aug 16 23:12:42.158569 2014] [cgi:error] [pid 29327] [client
119.63.193.196:0] AH01215: return codecs.ascii_decode(input,
self.errors)[0]
[Sat Aug 16 23:12:42.158663 2014] [cgi:error] [pid 29327] [client
119.63.193.196:0] AH01215: UnicodeDecodeError: 'ascii' codec can't
decode byte 0xc3 in position 1791: ordinal not in range(128)
If I access the file index.html directly from the brower, It renders fine...
I've done a lot of testing. I put my findings in a previous message.
Thanks anyway.
grz
Op 16-08-14 om 18:40 schreef Denis McMahon:
On Fri, 15 Aug 2014 20:10:25 +0200, Dominique Ramaekers wrote:
#!/usr/bin/env python3
print("Content-Type: text/html")
print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1
print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past
print("")
f = open("/var/www/cgi-data/index.html", "r")
for line in f:
print(line,end='')
If I run the script in the terminal, it nicely prints the webpage
'index.html'.
If access the script through a webbrowser, apache gives an error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
1791: ordinal not in range(128)
Is this a message appearing in the apache error log or in the browser? If
it is appearing in the browser, this is probably apache passing through a
python error message.
Is this the complete error message?
What happens when you try and access http://[server]/cgi-data/index.html
directly in a web browser? You may need to copy the file to a different
directory to do this depending on the apache configuration.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
On Sun, 17 Aug 2014 00:36:14 +0200, Dominique Ramaekers wrote: > What seems to be the problem: > My Script was ok. I know this because in the terminal I got my expected > output. Python3 uses UTF-8 coding as a standard. The problem is, when > python 'prints' to the apache interface, it translates the string to > ascii. (Why, I never found an answer). Is the apache server running on a linux or a windows platform? The problem may not be python, it may be the underlying OS. I wonder if apache is spawning a process for python though, and if so whether it is in some way constraining the character set available to stdout of the spawned process. >From your other message, the error appears to be a python error on reading the input file. For some reason python seems to be trying to interpret the file it is reading as ascii. I wonder if specifying the binary data parameter and / or utf-8 encoding when opening the file might help. eg: f = open( "/var/www/cgi-data/index.html", "rb" ) f = open( "/var/www/cgi-data/index.html", "rb", encoding="utf-8" ) f = open( "/var/www/cgi-data/index.html", "r", encoding="utf-8" ) I've managed to drive down a bit further in the problem: print() goes to sys.stdout This is part of what the docs say about sys.stdout: """ The character encoding is platform-dependent. Under Windows, if the stream is interactive (that is, if its isatty() method returns True), the console codepage is used, otherwise the ANSI code page. Under other platforms, the locale encoding is used (see locale.getpreferredencoding ()). Under all platforms though, you can override this value by setting the PYTHONIOENCODING environment variable before starting Python. """ At this point, details of the OS become very significant. If your server is running on a windows platform you may need to figure out how to make apache set the PYTHONIOENCODING environment variable to "utf-8" (or whatever else is appropriate) before calling the python script. I believe that the following line in your httpd.conf may have the required effect. SetEnv PYTHONIOENCODING utf-8 Of course, if the file is not encoded as utf-8, but rather something else, then use that as the encoding in the above suggestions. If the server is not running windows, then I'm not sure where the problem might be. -- Denis McMahon, [email protected] -- https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
* My system is a linux-box. * I've tried using encoding="utf-8". It didn't fix things. * That print uses sys.stdout would explain, using sys.stdout isn't better. * My locale and the system-wide locale is UTF-8. Using SetEnv PYTHONIOENCODING utf-8 didn't fix things * The file is encoded UTF-8... I can not speak for anybody else but in my search I don't believe to have read about someone who had the problem on a Windows-system. They all used linux (different kinds of flavors) or OS-X... This is the first time I've encountered a situation where Windows is better in encoding issues :P +1 for Microsoft... I think that Apache (*nix versions) doesn't tell Python, she's accepting UTF-8. Or Python doesn't listen right... Maybe I should place a bug report in both projects? Op 17-08-14 om 04:50 schreef Denis McMahon: On Sun, 17 Aug 2014 00:36:14 +0200, Dominique Ramaekers wrote: What seems to be the problem: My Script was ok. I know this because in the terminal I got my expected output. Python3 uses UTF-8 coding as a standard. The problem is, when python 'prints' to the apache interface, it translates the string to ascii. (Why, I never found an answer). Is the apache server running on a linux or a windows platform? The problem may not be python, it may be the underlying OS. I wonder if apache is spawning a process for python though, and if so whether it is in some way constraining the character set available to stdout of the spawned process. From your other message, the error appears to be a python error on reading the input file. For some reason python seems to be trying to interpret the file it is reading as ascii. I wonder if specifying the binary data parameter and / or utf-8 encoding when opening the file might help. eg: f = open( "/var/www/cgi-data/index.html", "rb" ) f = open( "/var/www/cgi-data/index.html", "rb", encoding="utf-8" ) f = open( "/var/www/cgi-data/index.html", "r", encoding="utf-8" ) I've managed to drive down a bit further in the problem: print() goes to sys.stdout This is part of what the docs say about sys.stdout: """ The character encoding is platform-dependent. Under Windows, if the stream is interactive (that is, if its isatty() method returns True), the console codepage is used, otherwise the ANSI code page. Under other platforms, the locale encoding is used (see locale.getpreferredencoding ()). Under all platforms though, you can override this value by setting the PYTHONIOENCODING environment variable before starting Python. """ At this point, details of the OS become very significant. If your server is running on a windows platform you may need to figure out how to make apache set the PYTHONIOENCODING environment variable to "utf-8" (or whatever else is appropriate) before calling the python script. I believe that the following line in your httpd.conf may have the required effect. SetEnv PYTHONIOENCODING utf-8 Of course, if the file is not encoded as utf-8, but rather something else, then use that as the encoding in the above suggestions. If the server is not running windows, then I'm not sure where the problem might be. -- https://mail.python.org/mailman/listinfo/python-list
Re: Unicode in cgi-script with apache2
Dominique Ramaekers wrote: [...] > 2) Your tip, to use 'encode' did not solve the problem and created a new > one. My lines were incapsulted in quotes and I got a lot of \b's and > \n's... and I still got the same error. Just throwing random encode/decode calls into the mix are unlikely to fix the problem. First, you need to find an Apache expert who can tell you what encoding your Apache process is expecting. Hopefully it is UTF-8. Then you need to confirm that your Python process is also using UTF-8. Nearly all Unicode-related issues are due to mismatches between encodings in different parts of the system. If only everyone could use UTF-8 for all storage and transport layers, life would be so much simpler... but I digress. [...] > What seems to be the problem: > My Script was ok. I know this because in the terminal I got my expected > output. Did you test it at the terminal with input including ë and ü? > Python3 uses UTF-8 coding as a standard. The problem is, when > python 'prints' to the apache interface, it translates the string to > ascii. (Why, I never found an answer). Try putting the lines: import sys print(sys.getfilesystemencoding()) at the start of your program, and see what it prints at the terminal and what it prints under Apache. I predict that under Apache, it will say something like "C locale" or "US ASCII". If so, *that* is your problem. > Somewhere in the middle of my > index.html file, there are letters like ë and ü. If Python tries to > translate these, Python throws an error. If I delete these letters in > the file, the script works perfectly in a browser! In Python2.7 the > script can easily be tweaked so the translation to ascii isn't done, Not quite. Under Python 2.7, you will likely get moji-bake. For instance, if your index.html contains "ë ü π" stored in UTF-8, Python 2.7 will throw its hands in the air, say "I have no idea what ASCII characters they are, let's pretend it's some sort of Latin-1" and you'll get: ë ü Ï instead. Or perhaps not. With Python 2.7, what you get is not quite random, but it depends on the environment in some fairly obscure ways. Python 3 at least raises an exception when there is a mismatch, instead of trying to guess what you get. > but > in Python3, its a real pain in the a... I've read about people who > managed to force Python3 to 'print' to apache in UTF-8, but none of > their solutions worked for me. There is very little point in throwing random solutions at a problem if you don't understand the problem. First you need to find out why Python is trying to convert to ASCII. That's probably because of something Apache is doing. Do you have an Apache technician you can ask? -- Steven -- https://mail.python.org/mailman/listinfo/python-list
