[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler

New submission from Thomas Guettler :

In changeset fe6be0426e0d the format() method was changed. Unfortunately it 
does not catch all unicode decode errors. 

I think line 482 of logging/__init__.py should be modified:
to this (add 'replace'):

s = s + record.exc_text.decode(sys.getfilesystemencoding(), 'replace')

http://hg.python.org/cpython/file/f35514dfadf8/Lib/logging/__init__.py#l482


Here is the stacktrace we get:
{{{
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 838, in emit
msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 715, in format
return fmt.format(record)
  File "/home/modbau_esg_p/djangotools/utils/logutils.py", line 32, in format
msg=logging.Formatter.format(self, record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 482, in format
s = s + record.exc_text.decode(sys.getfilesystemencoding())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 662: 
ordinal not in range(128)
Logged from file base.py, line 209
}}}

--
components: Library (Lib)
messages: 146018
nosy: guettli
priority: normal
severity: normal
status: open
title: Logging: Unicode Error
versions: Python 2.7

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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler

Changes by Thomas Guettler :


Added file: http://bugs.python.org/file23486/unicodedecodeerror-in-logging.py

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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler

Thomas Guettler  added the comment:

I attached a testcase (unicodedecodeerror-in-logging.py). If the 
filesystemencoding is UTF-8 and the source code is encoded in latin1, then the 
logging fails. It happens because there is a German umlaut in the comment 
behind 1/0.

I added 'replace' to the decode() in __init__.py and the it works. The German 
umlaut gets displayed as inverted question mark. But this is better than no 
logging message.

--

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



[issue12489] email.errors.HeaderParseError if base64url is used

2011-07-04 Thread Thomas Guettler

New submission from Thomas Guettler :

from email.header import decode_header
decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==?=')

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.6/email/header.py", line 101, in decode_header
raise HeaderParseError
email.errors.HeaderParseError

thunderbird is able to decode the header:
"Anmeldung Netzanschluss Südring3p.jpg"

According to Peter Otten base64url encoding was used:

My question in the newsgroup:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/9cf9ccd4109481cc/9f76bd627676b5f1?show_docid=9f76bd627676b5f1

--
components: Library (Lib)
messages: 139776
nosy: guettli
priority: normal
severity: normal
status: open
title: email.errors.HeaderParseError if base64url is used
versions: Python 2.7

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



[issue12489] email.errors.HeaderParseError if base64url is used

2011-07-04 Thread Thomas Guettler

Thomas Guettler  added the comment:

This happens on Python3:
root@ubuntu1004devel64:~# python3
Python 3.1.2 (r312:79147, Sep 27 2010, 09:57:50) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.header import decode_header
>>> decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==?=')
Traceback (most recent call last):
  File "/usr/lib/python3.1/email/header.py", line 98, in decode_header
word = email.base64mime.decode(encoded_string)
  File "/usr/lib/python3.1/email/base64mime.py", line 112, in decode
return a2b_base64(string.encode('raw-unicode-escape'))
binascii.Error: Incorrect padding

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.1/email/header.py", line 100, in decode_header
raise HeaderParseError('Base64 decoding error')
email.errors.HeaderParseError: Base64 decoding error

--

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



[issue12489] email.errors.HeaderParseError if base64url is used

2011-07-05 Thread Thomas Guettler

Thomas Guettler  added the comment:

I received this email. Here is the creator:

X-Mailer: CommuniGate Pro MAPI Connector 1.52.53.10/1.53.10.1

--

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



[issue1982] Feature: extend strftime to accept milliseconds

2010-08-16 Thread Thomas Guettler

Thomas Guettler  added the comment:

Yes, I think this can be closed, too.

--
nosy: +guettli

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread Thomas Guettler

New submission from Thomas Guettler :

I get the following traceback. I created a patch against email/quoprimime.py 
from SVN branch python2.7

  File "/usr/lib64/python2.6/email/header.py", line 93, in decode_header
dec = email.quoprimime.header_decode(encoded)
  File "/usr/lib64/python2.6/email/quoprimime.py", line 336, in header_decode
return re.sub(r'=\w{2}', _unquote_match, s)
  File "/usr/lib64/python2.6/re.py", line 150, in sub
return _compile(pattern, 0).sub(repl, string, count)
  File "/usr/lib64/python2.6/email/quoprimime.py", line 324, in _unquote_match
return unquote(s)
  File "/usr/lib64/python2.6/email/quoprimime.py", line 106, in unquote
return chr(int(s[1:3], 16))
ValueError: invalid literal for int() with base 16: 'ih'

--
components: Library (Lib)
files: quoprimime.py.diff
keywords: patch
messages: 117784
nosy: guettli
priority: normal
severity: normal
status: open
title: email/quoprimime.py Exception (with patch)
versions: Python 2.7
Added file: http://bugs.python.org/file19080/quoprimime.py.diff

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



[issue10004] email/quoprimime.py Exception (with patch)

2010-10-01 Thread Thomas Guettler

Changes by Thomas Guettler :


Added file: http://bugs.python.org/file19081/broken-subject.msg

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



[issue10151] Docs: can globals() be updated?

2010-10-20 Thread Thomas Guettler

New submission from Thomas Guettler :

Hi,

the documentation of "globals()" is missing a note if you can update
the dictionary:

http://docs.python.org/library/functions.html?highlight=globals#globals

For "locals()" it is documented:
http://docs.python.org/library/functions.html?highlight=locals#locals

--
assignee: d...@python
components: Documentation
messages: 119192
nosy: d...@python, guettli
priority: normal
severity: normal
status: open
title: Docs: can globals() be updated?
versions: Python 2.7

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



[issue11465] Set documentation: Link to wikipedia

2011-03-11 Thread Thomas Guettler

New submission from Thomas Guettler :

A link from 
  http://docs.python.org/library/stdtypes.html#set.union
to
   http://en.wikipedia.org/wiki/Union_%28set_theory%29
would help young people to understand sets.

Of course it is the same for intersection(), difference(), and 
symmetric_difference().

The images of the wikipedia article explain it very good.

--
assignee: docs@python
components: Documentation
messages: 130555
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: Set documentation: Link to wikipedia
versions: Python 2.7

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



[issue2864] etree: Add XPath documentation

2008-05-15 Thread Thomas Guettler

New submission from Thomas Guettler <[EMAIL PROTECTED]>:

The current documentation of etree [1] does not explain the 
syntax of the supported xpaths.


[1] current documation:
http://docs.python.org/lib/elementtree-elementtree-objects.html

[2] ElementTree supported XPath:
http://effbot.org/zone/element-xpath.htm

It would be very nice to have some simple examples for myetree.find(xpath).

--
assignee: georg.brandl
components: Documentation
messages: 66863
nosy: georg.brandl, guettli
severity: normal
status: open
title: etree: Add XPath documentation
type: feature request

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2864>
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4063] sphinx: make all-pdf does not exist.

2008-10-07 Thread Thomas Guettler

New submission from Thomas Guettler <[EMAIL PROTECTED]>:

Hi,

after sphinx-quickstart and running "make latex" I get:
Build finished; the LaTeX files are in build/latex.
Run `make all-pdf' or `make all-ps' in that directory to run these through 

[EMAIL PROTECTED]:...> LANG=C make all-pdf
make: *** No rule to make target `all-pdf'.  Stop.

Sphinx Version 0.4.2

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 74431
nosy: georg.brandl, guettli
severity: normal
status: open
title: sphinx: make all-pdf does not exist.
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4063>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4063] sphinx: make all-pdf does not exist.

2008-10-08 Thread Thomas Guettler

Thomas Guettler <[EMAIL PROTECTED]> added the comment:

Dear georg,

I am sorry that I wasted your time. Yes, I ignored the part '..in that
directory'.

I couldn't find a way to close this ticket, also I am logging in. Do you
need special privileges for this?

Nevertheless, thank you for "Sphinx".

 Thomas

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4063>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4194] default subprocess.Popen buffer size

2010-01-19 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue5115] Extend subprocess.kill to be able to kill process groups

2010-01-20 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue1555570] email parser incorrectly breaks headers with a CRLF at 8192

2008-03-27 Thread Thomas Guettler

Thomas Guettler <[EMAIL PROTECTED]> added the comment:

I was hit by this bug in Django. The ticket URL:

http://code.djangoproject.com/ticket/6256

It would be nice if this could be fixed.

--
nosy: +guettli

_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue170>
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46960] Docs: Link from settrace to frame

2022-03-08 Thread Thomas Guettler


New submission from Thomas Guettler :

https://docs.python.org/3.10/library/sys.html#sys.settrace

> Trace functions should have three arguments: frame, event, and arg. frame is 
> the current stack frame.

It would be super cool, if "current stack frame" could be a hyperlink to the 
docs about "frame".

--
messages: 414761
nosy: guettli
priority: normal
severity: normal
status: open
title: Docs: Link from settrace to frame

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



[issue44684] Docs for mock.call

2021-07-20 Thread Thomas Guettler


New submission from Thomas Guettler :

The docs for `mock.call` could get improved:

https://docs.python.org/3/library/unittest.mock.html#call

Up to now it is not clear how to access individual members of the call.

Example: I want to check if the call used the kwarg "foo" with the value of 
"bar".

Usually you don't need this, since you check for the whole call (all args and 
all kwargs).

But sometimes you jus twant to check for a single arg/kwarg.

Then it would be nice to have more detailed docs for the class "call".

BTW: Why has this class a lower-case name? Looks a bit strange.

--
assignee: docs@python
components: Documentation
messages: 397874
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: Docs for mock.call
versions: Python 3.9

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



[issue41755] Docs: Please remove `from distutils.core import setup`

2020-09-10 Thread Thomas Guettler


New submission from Thomas Guettler :

Please remove this page or at least the code snippet 
containing `from distutils.core import setup`
on this page: https://docs.python.org/3/distutils/setupscript.html

There is the more up to date doc here: 
https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py

Quoting Zen o Py: There should be one-- and preferably only one --obvious way 
to do it.

Thank you very much!

--
messages: 376695
nosy: guettli
priority: normal
severity: normal
status: open
title: Docs: Please remove `from distutils.core import setup`

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



[issue30948] Docs for __subclasses__(): Add hint that Python imports are lazy

2017-07-17 Thread Thomas Guettler

New submission from Thomas Guettler:

AFAIK cls.__subclasses__() only returns the classes which the interpreter has 
already loaded.

This means there can be more subclasses in modules where not imported by the 
current interpreter up to now.

https://docs.python.org/3.7/library/stdtypes.html?highlight=subclasses#class.__subclasses__

I think it would be nice to add a hint to the docs that python imports are lazy.

What do you think?

--
messages: 298527
nosy: guettli
priority: normal
severity: normal
status: open
title: Docs for __subclasses__(): Add hint that Python imports are lazy

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



[issue29612] TarFile.extract() suffers from hard links inside tarball

2017-03-10 Thread Thomas Guettler

Thomas Guettler added the comment:

I have the same issue on Python 2.7.12 (Ubuntu 16.04)

I tried to execute tartest.py. But I could not find a way how to create the tar 
which is needed for tartest.py.

--
nosy: +guettli

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



[issue35275] Reading umask (thread-safe)

2018-11-19 Thread Thomas Guettler


New submission from Thomas Guettler :

Up to now there is no thread way to read the umask in Python

https://stackoverflow.com/questions/53227072/reading-umask-thread-safe

You can use this pattern:

current_umask = os.umask(0)  # line1
os.umask(current_umask)  # line2
return current_umask

A thread which executes between line1 and line2 will have a different umask.

I would be great, if the python standard library would provide correspondig 
thread safe method.

Related question at stackoverflow: 
https://stackoverflow.com/questions/53227072/reading-umask-thread-safe

--
messages: 330083
nosy: guettli
priority: normal
severity: normal
status: open
title: Reading umask (thread-safe)

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



[issue18336] codecs: Link to readline module (history) instead of fd.readline()

2013-07-01 Thread Thomas Guettler

New submission from Thomas Guettler:

The documentation of codecs.readline() has a link to the readline module.

That the same word with a total different meaning!

http://docs.python.org/2/library/codecs.html?highlight=readline#codecs.StreamReader.readline

The GNU readline module is about the history like bash or interactive python.

--
assignee: docs@python
components: Documentation
messages: 192111
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: codecs: Link to readline module (history) instead of fd.readline()
versions: Python 2.7

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



[issue18337] codecs: StremReader readline() breaks on undocumented characters

2013-07-01 Thread Thomas Guettler

New submission from Thomas Guettler:

The stream reader of codecs.open() breaks on undocumented characters:

http://docs.python.org/2/library/codecs.html?highlight=codecs%20readline#codecs.StreamReader.readline

import tempfile
temp=tempfile.mktemp()
fd=open(temp, 'wb')
fd.write('abc\ndef\x85ghi')
fd.close()

import codecs
fd=codecs.open(temp, 'rb', 'latin1')
while True:
line=fd.readline()
if not line:
break
print repr(line)

Result:
u'abc\n'
u'def\x85'
u'ghi'

Related: 
http://stackoverflow.com/questions/16227114/utf-8-files-read-in-python-will-line-break-at-character-x85

--
assignee: docs@python
components: Documentation
messages: 192112
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: codecs: StremReader readline() breaks on undocumented characters
versions: Python 2.7

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



[issue1596321] KeyError at exit after 'import threading' in other thread

2013-08-07 Thread Thomas Guettler

Thomas Guettler added the comment:

Only few people seem to use daemon threads. We do and see this problem often 
with Python 2.7.

How difficult is it to get this fixed for 2.7?

Is there a way to work around this problem?

--
nosy: +guettli

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



[issue1856] shutdown (exit) can hang or segfault with daemon threads running

2013-08-07 Thread Thomas Guettler

Thomas Guettler added the comment:

There are some examples to work around this for Python2: 
http://stackoverflow.com/questions/18098475/detect-interpreter-shut-down-in-daemon-thread

--
nosy: +guettli

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



[issue18675] Daemon Threads can seg fault

2013-08-07 Thread Thomas Guettler

New submission from Thomas Guettler:

This is a documentation bug: Since #1856  is not solved for Python2, it needs 
to be documented.

Daemon Threads on Python2 can seg fault.

Work arounds: 
http://stackoverflow.com/questions/18098475/detect-interpreter-shut-down-in-daemon-thread

--
assignee: docs@python
components: Documentation
messages: 194601
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: Daemon Threads can seg fault
versions: Python 2.6, Python 2.7

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



[issue21495] Sane default for logging config

2014-05-13 Thread Thomas Guettler

New submission from Thomas Guettler:

Imagine you write a small console script which is implemented like a library.

This tool has to do two things: the console script needs to configure the 
logging, and the library needs to use it.

The library usage of logging it easy well documented:

{{{
logger=logging.getLogger(__name__)
}}}

But the part in the console script has no sane default in the python world. 

I know how to set up the logging config with BasicConfig, DictConfig, ...

There needs to be something like DefaultConfig() which reads its config from 
well known places. 

This bug report is not about clever code solutions. It is about a sane and easy 
default agreement on how to load the logging configuration.

--
messages: 218453
nosy: guettli
priority: normal
severity: normal
status: open
title: Sane default for logging config

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



[issue21495] Sane default for logging config

2014-05-13 Thread Thomas Guettler

Thomas Guettler added the comment:

Thank you for reading and replying. 

Yes, I wrote no concret proposal up to now.

I have this solutions in mind:

logging.config.defaultConfig()

Related https://docs.python.org/2/library/logging.config.html


Loading a python module:


load a module "loggingconfig" this module gets imported like any other python 
module. It is like django loads its settings. It could be possible to check the 
environment variable LOGGINGCONFIG first. It could contain a string which 
defaults to "loggingconfig".

This module has a method "set_up()" which sets up the logging for this 
environment.


Loading from a file:
-

A file searched in this places:

- CWD/.loggingconfig.conf
- VIRTUAL_ENV/.loggingconfig.conf
- HOME/.loggingconfig.conf
- etc/loggingconfig.conf

The file gets loaded with fileConfig()


Module or file config loading
-

I think the module loading is better than the file based solution. That's why I 
think it should be done first. If there is no module found, the file loading 
should be tried.

If not config found


If not config was found, default gets set.

My proposal:
 - loglevel is set to INFO. (Debug gets suppressed)
 - format: '%(asctime)s %(name)s: %(levelname)-8s [%(process)d] %(message)s'
 - logging goes to stdout

---

What is the best way to get this into the python standard library? Should I 
create a PEP?

--

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



[issue21495] Sane default for logging config

2014-05-18 Thread Thomas Guettler

Thomas Guettler added the comment:

Just for the record.

Here are the discussions about this topic on the python-ideas mailing list:


https://mail.python.org/pipermail/python-ideas/2014-May/027839.html

https://mail.python.org/pipermail/python-ideas/2014-May/027858.html

--

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



[issue14102] argparse: add ability to create a man page

2014-06-11 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy:  -guettli

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



[issue14102] argparse: add ability to create a man page

2013-01-11 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue16933] argparse: remove magic from examples

2013-01-11 Thread Thomas Guettler

New submission from Thomas Guettler:

The current argparse documentation is not easy to read people new to python.

http://docs.python.org/dev/library/argparse.html#choices

{{{
current: parser.add_argument('foo', choices='abc')
}}}

Please make this more explicit:
{{{
better: parser.add_argument('foo', choices=['one', 'two', 'three'])
}}}

{{{
current: parser.parse_args('c'.split()) # looks like perl to me
}}}

{{{
better: parser.parse_args(['c'])
}}}

Next: Please use a more common type, not "complex" in the choices example. It 
confuses a lot of people.

--
messages: 179679
nosy: guettli
priority: normal
severity: normal
status: open
title: argparse: remove magic from examples

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



[issue19039] sphinx search, result sorting

2013-09-17 Thread Thomas Guettler

New submission from Thomas Guettler:

If you search for "printf" in the docs you get this result:

http://docs.python.org/3.3/search.html?q=printf&check_keywords=yes&area=default

Please have a look at the first results. I guess most people don't want to see 
docs about "PyOS_snprintf"

Most people want to see this: 
http://docs.python.org/3.3/library/stdtypes.html?highlight=printf#printf-style-string-formatting

The good page (stdtypes.html) is the fourth search result.
And this page is huge. Unfortunately the link from the search result does not 
link to the section, it links to the top of the page.

 Since "printf" is in the heading, sphinx should be able to create a link to 
the relevant section in this page (in this example 
#printf-style-string-formatting).


Thank you

--
assignee: docs@python
components: Documentation
messages: 197963
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: sphinx search, result sorting

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



[issue5673] Add timeout option to subprocess.Popen

2013-11-18 Thread Thomas Guettler

Thomas Guettler added the comment:

For Python 2.x there is a backport of the subprocess module of 3.x: 
https://pypi.python.org/pypi/subprocess32.

It has the timeout argument for call() and pipe.wait().

--

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



[issue18675] Daemon Threads can seg fault

2014-09-30 Thread Thomas Guettler

Thomas Guettler added the comment:

What kind of patch do you want? Documentation patch or fixing the bug in the 
interpreter?

I am not a native speaker, that's why I avoid documentation patches.

For me, the issue is solved. It is documented in stackoverflow and here.

Since Python2 will be gone sooner or later, I don't want to invest hours into 
fixing this at interpreter level.

Should I close the issue?

--

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



[issue20598] argparse docs: '7'.split() is confusing magic

2014-02-11 Thread Thomas Guettler

New submission from Thomas Guettler:

I think the docs of argparse still contain confusing magic:

parser.parse_args('7'.split())


You know what it does and I know it. But a lot of people new to Python, don't 
understand what this should be.

Please use:

parser.parse_args(['7'])


Close this ticket, if you don't care for people new to Python.

--
assignee: docs@python
components: Documentation
messages: 210950
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: argparse docs: '7'.split() is confusing magic
versions: Python 2.7

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



[issue3244] multipart/form-data encoding

2009-11-03 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue5673] Add timeout option to subprocess.Popen

2009-11-17 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2009-12-02 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue6051] smtplib docs should link to email module examples

2009-05-18 Thread Thomas Guettler

New submission from Thomas Guettler :

On "smtplib example":
http://docs.python.org/library/smtplib.html#smtp-example
should be a link to:
http://docs.python.org/library/email-examples.html

I think the smtplib example is bad, since the email gets created with a
string. That's not solid. Using the email module is better.

--
assignee: georg.brandl
components: Documentation
messages: 88020
nosy: georg.brandl, guettli
severity: normal
status: open
title: smtplib docs should link to email module examples
type: feature request

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



[issue1553375] Add traceback.print_full_exception()

2010-07-30 Thread Thomas Guettler

Changes by Thomas Guettler :


--
nosy: +guettli

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



[issue1553375] Add traceback.print_full_exception()

2010-07-30 Thread Thomas Guettler

Thomas Guettler  added the comment:

It would be very nice if logging.info('...', exc_info=True)
shows the calling/upper frames, too.

--

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



[issue9427] logging.error('...', exc_info=True) should display upper frames, too

2010-07-30 Thread Thomas Guettler

New submission from Thomas Guettler :

logging.error('...', exc_info=True) only displays the
frames downward. But I often need the upper frames, to debug a problem.

This example shows, that you don't see the "upper" frame in the stactrace. But 
that's information is important.


import logging

def foo():
try:
raise Exception()
except Exception, exc:
logging.error('Exception occured: %s' % exc, exc_info=True)

def upper():
foo()
upper()



===> python tmp/t.py
ERROR:root:Exception occured: 
Traceback (most recent call last):
  File "tmp/t.py", line 6, in foo
raise Exception()
Exception


--
components: Library (Lib)
messages: 112063
nosy: guettli
priority: normal
severity: normal
status: open
title: logging.error('...', exc_info=True) should display upper frames, too
versions: Python 2.6

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



[issue9427] logging.error('...', exc_info=True) should display upper frames, too

2010-07-30 Thread Thomas Guettler

Thomas Guettler  added the comment:

Related: #1553375

--

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



[issue1553375] Add traceback.print_full_exception()

2010-07-30 Thread Thomas Guettler

Thomas Guettler  added the comment:

Related #9427

--

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



[issue9427] logging.error('...', exc_info=True) should display upper frames, too

2010-07-30 Thread Thomas Guettler

Thomas Guettler  added the comment:

I tested it only on python 2.6. Can someone please look at more reset versions?

--

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



[issue9427] logging.error('...', exc_info=True) should display upper frames, too

2010-08-05 Thread Thomas Guettler

Thomas Guettler  added the comment:

Until exc_info=True prints the current stack, I use this pattern:

import traceback

logging.error(u's...\nStack: %s' % (
''.join(traceback.format_stack())), exc_info=True)

--

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-27 Thread Thomas Guettler

Thomas Guettler added the comment:

Who has enough knowledge of the tarfile module to create a good patch?

--
nosy: +guettli

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-28 Thread Thomas Guettler

Thomas Guettler added the comment:

I uploaded a broken tar for testing:

tguettler@aptguettler:~/tmp
===> LANG=C tar -xf tar_which_is_cut.tar
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

tguettler@aptguettler:~/tmp
===> python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tarfile
>>> tarfile.TarFile('tar_which_is_cut.tar', errorlevel=2).extractall()
>>> 
(Sad, no error)

--
Added file: http://bugs.python.org/file39531/tar_which_is_cut.tar

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-28 Thread Thomas Guettler

Thomas Guettler added the comment:

I thought about this again. 

It could be solved with the help of a ByteCountingStreamReader.

With ByteCountingStreamReader I mean a wrapper around a stream like 
codescs.StreamReader. But the ByteCountingStreamReader should not changes the 
content, but just count the bytes it passed.

The ByteCountingStreamReader would be wrapped around ExFileObject.

This class could be handy in other situations.

What do you think?

--

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-30 Thread Thomas Guettler

Thomas Guettler added the comment:

With Python 3.4.0 you get an OSError if you try to extractall() the uploaded 
tar_which_is_cut.tar. That's nice.

Seems like only 2.7 seems to be buggy.

===> python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tarfile
>>> tarfile.TarFile('tar_which_is_cut.tar').extractall()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.4/tarfile.py", line 1979, in extractall
self.extract(tarinfo, path, set_attrs=not tarinfo.isdir())
  File "/usr/lib/python3.4/tarfile.py", line 2018, in extract
set_attrs=set_attrs)
  File "/usr/lib/python3.4/tarfile.py", line 2087, in _extract_member
self.makefile(tarinfo, targetpath)
  File "/usr/lib/python3.4/tarfile.py", line 2133, in makefile
copyfileobj(source, target, tarinfo.size)
  File "/usr/lib/python3.4/tarfile.py", line 247, in copyfileobj
raise OSError("end of file reached")
OSError: end of file reached

--

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



[issue24941] classproperty

2015-08-26 Thread Thomas Guettler

New submission from Thomas Guettler:

Quoting Guido van Rossum Aug 20 2015. Thread "Properties for classes possible?"

https://mail.python.org/pipermail/python-ideas/2015-August/035354.html

{{{
 think it's reasonable to propose @classproperty as a patch to CPython. It
needs to be C code. Not sure about the writable version. The lazy=True part
is not appropriate for th he stdlib (it's just a memoize pattern).
}}}

The solution I use at the moment:

{{{
# From http://stackoverflow.com/a/5192374/633961
class classproperty(object):
def __init__(self, f):
self.f = f
def __get__(self, obj, owner):
return self.f(owner)
}}}

According to Terry Jan Reedy the next step is to find
someone to translate this to C.

Sorry, my C knowledge is limited. Can anybody help?

--
messages: 249182
nosy: guettli
priority: normal
severity: normal
status: open
title: classproperty

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-09-07 Thread Thomas Guettler

New submission from Thomas Guettler:

At the top of the htmllib module:


> Deprecated since version 2.6: The htmllib module has been removed in
> Python 3.


Source: https://docs.python.org/2/library/htmllib.html#module-htmllib


Newcomers need more advice: Which library should be used?

I know there are many html parsing libraries.

But there should be a sane default for newcomers.

Is there already an agreement of a sane default html parsing library?

--
assignee: docs@python
components: Documentation
messages: 250088
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: htmllib deprecated: Which library to use? Missing sane default in docs

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-09-07 Thread Thomas Guettler

Thomas Guettler added the comment:

This issue is just about documentation. No code change is required for it.

How to update the docs, to point to html.parser?

--

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



[issue26817] Docs for StringIO should link to io.BytesIO

2016-04-21 Thread Thomas Guettler

New submission from Thomas Guettler:

I think a warning at the top of StringIO docs is needed.

And it should link to io.BytesIO.

Maybe even deprecate StringIO and cStringIO in Python2?

StringIO docs: https://docs.python.org/2/library/stringio.html

io.BytesIO docs: https://docs.python.org/2/library/io.html#io.BytesIO

I would like to see this at the top of StringIO:

{{{
Please use io.BytesIO and io.StringIO since this module is not supported in 
Python3
}}

--
assignee: docs@python
components: Documentation
messages: 263917
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: Docs for StringIO should link to io.BytesIO
versions: Python 2.7

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



[issue26869] unittest longMessage docs

2016-04-27 Thread Thomas Guettler

New submission from Thomas Guettler:

The first message of the longMessage docs is confusing:

https://docs.python.org/3/library/unittest.html#unittest.TestCase.longMessage

> If set to True then 

This reads between the lines, that the default is False.

But that was long ago in Python2. In Python3 the default is True (which I 
prefer to the old default).

I think the docs should be like.

And the term "normal message" is not defined. For new comers the "normal 
message" is what I get if you don't change the default, not the behaviour of 
the Python2 version :-)

I think "normal message" should be replaced with "short message" or "diff 
message" .. I am unsure.

What do you think?

--
assignee: docs@python
components: Documentation
messages: 264359
nosy: docs@python, guettli
priority: normal
severity: normal
status: open
title: unittest longMessage docs
versions: Python 3.6

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



[issue26869] unittest longMessage docs

2016-04-28 Thread Thomas Guettler

Thomas Guettler added the comment:

Thank you for understanding my concern.



> The standard failure message for each *assert method* contains useful  
> information about the objects involved.  For example the message from 
> assertEqual shows the repr of the two unequal objects.  It is usually 
> easier to augment rather than replace this message

I think above is not needed.


> The class setting can be overridden in individual test methods by 
> assigning an instance attribute, self.longMessage, to True or False 
> before calling the assert methods.

I would add "the default value of the class gets reset before each test call". 
That is more explicit (I hope my text is what happens behind the scene)

Again, thank you, that you care.

Regards,
  Thomas Güttler

--

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



[issue23625] load_module() docs: zipped eggs are not loaded.

2015-03-11 Thread Thomas Guettler

Thomas Guettler added the comment:

Dear Bret Cannon,

I don't ask for egg support in the imp module.
I don't want to change the implemenation of imp.find_module()

I just want to update the docs.

Most people run a python version which supports loading zipped eggs.

Please reopened this, since I think you misunderstood me. If not, and you don't 
care about the docs. Leave it closed :-)

--
nosy: +guettli

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



[issue23625] load_module() docs: zipped eggs are not loaded.

2015-03-17 Thread Thomas Guettler

Thomas Guettler added the comment:

In this case I am wearing newbee user glasses.

And with this glasses on my nose, I don't care for implementation.

I am confused that imp module does not work like "import foo".

--

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



[issue23625] load_module() docs: zipped eggs are not loaded.

2015-03-17 Thread Thomas Guettler

Thomas Guettler added the comment:

The docs should be where new users look.

I don't speak about several hundret words 

Where do you think new users look for documentation if they want a method which 
does find a module?

--

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



[issue26869] unittest longMessage docs

2016-10-10 Thread Thomas Guettler

Thomas Guettler added the comment:

@Mariatta thank you very much. This update makes the docs easy to read and 
understand. Thank you :-)

--

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