[issue5659] logging.FileHandler encoding parameter does not work as expected

2009-04-01 Thread Kuno

New submission from Kuno :

When attempting to use the encoding="" parameter of logging.FileHandler
I always get a UnicodeError.  This looks like a bug to me (otherwise I
am seriously misunderstanding what the parameter is supposed to do). The
attached file contains the code to reproduce this error.

Traceback (most recent call last):
  File "/usr/local/stow/Python-2.6.1/lib/python2.6/logging/__init__.py",
line 765, in emit
self.stream.write(fs % msg.encode("UTF-8"))
  File "/usr/local/stow/Python-2.6.1/lib/python2.6/codecs.py", line 686,
in write
return self.writer.write(data)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xec in position 0:
ordinal not in range(128)

For completeness:  I am running a self-compiled Python 2.6.1 on the
current Debian GNU/Linux testing release.

--
components: Library (Lib)
files: l.py
messages: 85106
nosy: warp
severity: normal
status: open
title: logging.FileHandler encoding parameter does not work as expected
versions: Python 2.6
Added file: http://bugs.python.org/file13562/l.py

___
Python tracker 
<http://bugs.python.org/issue5659>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5659] logging.FileHandler encoding parameter does not work as expected

2009-04-02 Thread Kuno

Kuno  added the comment:

Ah!  Good to know that it has been fixed already.  Thank you.

--

___
Python tracker 
<http://bugs.python.org/issue5659>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9714] urllib2 digest authentication doesn't work when connecting to a Catalyst server.

2010-08-30 Thread Kuno Woudt

New submission from Kuno Woudt :

In the WWW-Authenticate header Catalyst::Authentication::Credential::HTTP sends 
the following value for qop:

qop="auth,auth-int"

This is identical to the example given in section 3.5 of the RFC 
(http://tools.ietf.org/html/rfc2617#section-3.5 ), so I assume this is correct.

urllib2 does not expect multiple values for qop, and only works when qop="auth".

I've managed to work around it with:

class DigestAuthHandler (urllib2.HTTPDigestAuthHandler):
def get_authorization (self, req, chal):
qop = chal.get ('qop', None)
if qop and ',' in qop and 'auth' in qop.split (','):
chal['qop'] = 'auth'

return urllib2.HTTPDigestAuthHandler.get_authorization (self, req, chal)

--
components: Library (Lib)
messages: 115207
nosy: warpr
priority: normal
severity: normal
status: open
title: urllib2 digest authentication doesn't work when connecting to a Catalyst 
server.
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 
<http://bugs.python.org/issue9714>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Kuno Meyer

New submission from Kuno Meyer:

[Python 3.5.2 on Windows]

>py -c "import sys; print(sys.stdout.isatty(), file=sys.stderr)" > NUL
True

NUL is the Windows equivalent of /dev/nul, so the result should probably be 
False.

Under Cygwin, the result is as expected:

$ python3 -c "import sys; print(sys.stdout.isatty(), file=sys.stderr)" > 
/dev/nul
False

--
components: Windows
messages: 280494
nosy: kmeyer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: sys.stdout.isatty() returns True even if redirected to NUL
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue28654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Kuno Meyer

Kuno Meyer added the comment:

http://stackoverflow.com/questions/3648711/detect-nul-file-descriptor-isatty-is-bogus,
 although a bit convoluted, might also help. It mentions GetConsoleMode() for 
stdin and GetConsoleScreenBufferInfo() for stdout.

--

___
Python tracker 
<http://bugs.python.org/issue28654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Kuno Meyer

Kuno Meyer added the comment:

2) Yes, it should be `> /dev/null` instead of `> /dev/nul` (my bad). The output 
remains the same.

--

___
Python tracker 
<http://bugs.python.org/issue28654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com