[issue42012] typing support in wsgiref

2022-04-05 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +30392
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32335

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



[issue46609] Generator-based coroutines in Python 3.10 docs

2022-02-02 Thread Sebastian Rittau


New submission from Sebastian Rittau :

Currently, the Python 3.10.2 documentation at 
https://docs.python.org/3/library/asyncio-task.html?highlight=coroutine#asyncio.coroutine
 says:

"Note: Support for generator-based coroutines is deprecated and is scheduled 
for removal in Python 3.10."

Python 3.10 still has support for those (although it emits a warning), so the 
note should be updated.

--
assignee: docs@python
components: Documentation
messages: 412352
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: Generator-based coroutines in Python 3.10 docs
versions: Python 3.10

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



[issue46494] Mention typing_extensions in the typing documentation

2022-01-24 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Sounds like a good idea. I would put it into the introduction. I hear it will 
easily be missed in other sections.

Wouldn't a link to PyPI make more sense than a GitHub link?

--

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



[issue46414] Add typing.reveal_type

2022-01-17 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
nosy: +srittau

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-22 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
nosy: +srittau

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



[issue41260] datetime, date and time: strftime method takes different keyword argument: fmt (pure) or format (C)

2021-11-16 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Ref https://github.com/python/typeshed/pull/6317 for a discussion about this in 
typeshed.

--
nosy: +srittau

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



[issue21436] Consider leaving importlib.abc.Loader.load_module()

2021-11-04 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

I would ask you to reconsider this. 
https://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path/67692#67692
 is a highly active question on StackOverflow, and my answer basically provided 
me all the karma I got there. For users that don't have intimate insight in how 
importlib works, the code posted by Brett is completely non-obvious and I 
believe that a convenience method would be very useful.

--

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



[issue28375] cgi.py spam in Apache server logs

2021-10-22 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

All my projects now use werkzeug instead of the cgi module, so I can't confirm 
whether this problem still exists. I'm fine with closing this as unreproducible 
if no one else can reproduce it.

--
status: pending -> open

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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-09-21 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

One thing I would strongly suggest for consistent terminology: Make "iterator" 
mean an object that has both "__next()__" and "__iter()__". This is consistent 
with how an iterator has been described in the glossary for a long time, but 
also consistent with (abc.collections|typing).Iterator.

Either invent a different term for objects having "__next__()" (but not 
necessarily "__iter__()"), or use a description like "an iterator or any other 
object that has a __next__() method".

--
nosy: +srittau

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



[issue44957] typing docs: Mention PEP 604 syntax more prominently

2021-08-19 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +26297
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27833

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



[issue44957] typing docs: Mention PEP 604 syntax more prominently

2021-08-19 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The new PEP 604 syntax for type unions should be mentioned more prominently in 
the typing docs, starting with Python 3.10. I'm preparing a PR for discussion.

--
assignee: docs@python
components: Documentation
messages: 399919
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: typing docs: Mention PEP 604 syntax more prominently
versions: Python 3.10, Python 3.11

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



[issue44809] Changelog missing removal of StrEnum etc.

2021-08-02 Thread Sebastian Rittau


New submission from Sebastian Rittau :

It seems that at some point StrEnum and a few other members were added to 
Python 3.10. I think they were present in 3.10 beta 2, but it seems they were 
removed by beta 4. While the Changelog at 
https://docs.python.org/3.10/whatsnew/changelog.html mentions that they were 
added, there is no note about their removal again.

--
assignee: docs@python
components: Documentation
messages: 398760
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: Changelog missing removal of StrEnum etc.
versions: Python 3.10

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-23 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
pull_requests: +25857
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/27312

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

typing.io is not referenced in either the tests or the implementation for 
pydoc. What happens is basically: typing.io is a class, so its derived from 
object. When formatting the docstring for object, the formatter queries the 
__module__ attribute of all sub-classes of object, including typing.io, so that 
it can include the sub-classes in its output:

--

Help on class object in module builtins:

class object
 |  The base class of the class hierarchy.
 |  
 |  When called, it accepts no arguments and returns a new featureless
 |  instance that has no instance attributes and cannot be given any.
 |  
 |  Built-in subclasses:
 |  anext_awaitable
 |  async_generator
 |  async_generator_asend
 |  async_generator_athrow
 |  ... and 88 other subclasses
 |  
[...]

--

Before the PR this failed, as accessing any typing.io.__module__ printed the 
warning.

--

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

pr-27039 suppresses warnings when accessing `typing.{re,io}.__module__`, which 
should fix this warning.

--

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
pull_requests: +25599
pull_request: https://github.com/python/cpython/pull/27039

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

We could easily do what Ken did in PR-26811, and add 
"warnings.filterwarnings("default", category=DeprecationWarning)" to the test, 
but I would like to understand what is going on first. It seems the warnings 
are generated by test_builtin_with_more_than_four_children, which doesn't 
operate on typing directly. Here is a repro, without tests:

srittau@blitz:~/Projekte/cpython (typing-io *)$ ./python -Wall
Python 3.11.0a0 (heads/main:17f94e2888, Jul  5 2021, 19:19:04) [GCC 8.3.0] on 
linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydoc
>>> import typing
>>> doc = pydoc.TextDoc()
>>> x = doc.docclass(object)
/home/srittau/Projekte/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.io 
is deprecated, import directly from typing instead. typing.io will be removed 
in Python 3.12.
  if not cls.__name__.startswith("_") and cls.__module__ == "builtins"),
/home/srittau/Projekte/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.re 
is deprecated, import directly from typing instead. typing.re will be removed 
in Python 3.12.
  if not cls.__name__.startswith("_") and cls.__module__ == "builtins"),
>>> 

Same warning when calling "help(object)". This is not great. I assume that it 
is somehow related to pydoc.docclass() iterating over the the items of typing, 
but only if typing was imported. Please not that "io" and "re" are not part of 
typing.__all__.

I will investigate more.

--

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-06-22 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Ken: We still need to remove these modules in Python 3.12+. Should we open a 
separate issue, reopen this one, or just handle it after the Python 3.11 branch 
has been created?

--

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-06-21 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Thank you for fixing this, Ken, the PR looks good to me.

Overall it looks as if the the Azure pipeline should be fixed, though. It's not 
ideal that the tests pass while running the PR, but not in other situations. 
Also, the warnings suppression is not really obvious.

--

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-06-14 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

And I opened a second PR (for Python 3.11 only) to issue a deprecation warning 
when typing.io or typing.re gets imported.

--

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-06-14 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
pull_requests: +25307
pull_request: https://github.com/python/cpython/pull/26719

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



[issue38460] 3.8 Release Notes: document asyncio exception changes

2021-06-14 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Closing per the comments by Andrew and Raymond and the fact that 3.8 has been 
released for quite some while now.

--
stage:  -> resolved
status: open -> closed

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



[issue38460] 3.8 Release Notes: document asyncio exception changes

2021-06-14 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
resolution:  -> not a bug

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



[issue44261] SocketType documentation misleading

2021-05-28 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The documentation of socket.SocketType 
(https://docs.python.org/3/library/socket.html?highlight=sockettype#socket.SocketType)
 is misleading. It states:

This is a Python type object that represents the socket object type. It is 
the same as type(socket(...)).

This is untrue. socket.SocketType is in reality re-exported from _socket, where 
it is an alias for class _socket.socket, a super type of class socket.socket. I 
think that either the documentation should be fixed, or SocketType should be 
moved to socket and made an alias of socket.socket.

--
assignee: docs@python
components: Documentation
messages: 394665
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: SocketType documentation misleading

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-05-13 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

I opened a PR to remove their mention from the docs for now. I can look into 
how to add a deprecation warning to a module if no one else beats me to it.

--

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



[issue35089] Remove typing.io and typing.re from documentation

2021-05-13 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
pull_requests: +24758
pull_request: https://github.com/python/cpython/pull/26113

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-05-13 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +24757
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26113

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-05-03 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
nosy: +srittau

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



[issue42012] typing support in wsgiref

2020-10-12 Thread Sebastian Rittau


New submission from Sebastian Rittau :

In typeshed (the repository for stdlib type annotations), we have defined a 
bunch of types to support annotating WSGI interfaces. See 
https://github.com/python/typeshed/blob/master/stdlib/2and3/_typeshed/wsgi.pyi 
for the current version. Unfortunately these types are only available at type 
check time, which means that users need to do some gymnastics to use them in 
their own code.

I think it would be worthwhile to add these types directly to wsgiref or to a 
new module (e.g. wsgiref.types). On the one hand users could use them at 
runtime easily, on the other hand they serve as additional documentation WSGI 
types. In my experience, WSGI applications and middleware often slightly 
misimplement the standard, which can make interoperability difficult. Both type 
checking and concrete documentation could help alleviate this problem.

If the maintainers think this would be a good idea, I could provide a PR for 
both the types and the Python documentation.

--
components: Library (Lib)
messages: 378484
nosy: srittau
priority: normal
severity: normal
status: open
title: typing support in wsgiref
type: enhancement

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



[issue42001] Deprecate `typing.io` Wrapper Namespace

2020-10-10 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

For reference, this came up in 
https://github.com/python/typeshed/issues/4639#issuecomment-706596656. 
`typing.io` has never been in typeshed and we decided not to include it. It 
looks as if it never gained any traction, especially since the types are 
available from `typing` directly.

--
nosy: +srittau

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Code using this argument is in all likelihood already subtly broken, because it 
depends on non-existing functionality. I believe that a "hard" break would be 
better (for Python 3.9).

--

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Shantanu points out in https://github.com/python/typeshed/pull/3715 that the 
argument was made useless due to bpo-28009.

--

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Sebastian Rittau


New submission from Sebastian Rittau :

uuid.getnode() has an undocumented, keyword-only "getters" argument that gets 
discarded immediately. This is confusing when using code inspection tools and 
can give the wrong impression that you can somehow override the node getters 
when you can't. I recommend removing this argument.

--
components: Library (Lib)
messages: 361423
nosy: srittau
priority: normal
severity: normal
status: open
title: uuid.getnode() has unused argument
versions: Python 3.6, Python 3.7

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



[issue38846] async: Return context manager from open(_unix)_connection

2019-11-19 Thread Sebastian Rittau


New submission from Sebastian Rittau :

As a convenience it would be useful if async.open_connection() and 
open_unix_connection() would return a context manager that closes the writer on 
exit:

with await open_unix_connection(...) as (reader, writer):
...

This could be achieved by using a custom sub-class of tuple:

class _ConnectionContext(tuple):
def __enter__(self):
return self
def __exit__(self, *args):
self[1].close()

I can submit a PR if wanted.

--
components: asyncio
messages: 356962
nosy: asvetlov, srittau, yselivanov
priority: normal
severity: normal
status: open
title: async: Return context manager from open(_unix)_connection
versions: Python 3.8

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



[issue38460] 3.8 Release Notes: document asyncio exception changes

2019-10-22 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Also it seems there are various new arguments and methods in asyncio that are 
not in the release notes. (Via https://github.com/python/typeshed/issues/2313).

--

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



[issue38484] HTMLParser.handle_starttag should mention that value can be None

2019-10-15 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The documentation for HTMLParser.handle_starttag 
(https://docs.python.org/3/library/html.parser.html#html.parser.HTMLParser.handle_starttag)
 should mention that the value of an attribute can be `None` for argument-less 
attributes. I can submit a PR if wanted.

--
assignee: docs@python
components: Documentation
messages: 354719
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: HTMLParser.handle_starttag should mention that value can be None
versions: Python 3.8

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



[issue38467] Misspelled argument names for typing.get_origin and get_args

2019-10-13 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

https://github.com/python/cpython/pull/16753

--

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



[issue38467] Misspelled argument names for typing.get_origin and get_args

2019-10-13 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +16326
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16753

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



[issue38467] Misspelled argument names for typing.get_origin and get_args

2019-10-13 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The arguments for typing.get_origin() and typing.get_args() are named "typ" in 
the documentation 
(https://docs.python.org/3.8/library/typing.html#typing.get_origin), while they 
are named "tp" in the implementation. Important if used as keyword argument.

--
assignee: docs@python
components: Documentation
messages: 354590
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: Misspelled argument names for typing.get_origin and get_args
versions: Python 3.8

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



[issue38466] threading.excepthook doc talks about "object"

2019-10-13 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The documentation of threading.excepthook 
(https://docs.python.org/3.8/library/threading.html#threading.excepthook) talks 
about "object", when it only has a "thread" attribute:

"Storing object using a custom hook can resurrect it if it is set to an object 
which is being finalized. Avoid storing object after the custom hook completes 
to avoid resurrecting objects."

I believe this is a copy and paste error from sys.unraisablehook.

--
assignee: docs@python
components: Documentation
messages: 354588
nosy: docs@python, srittau, vstinner
priority: normal
severity: normal
status: open
title: threading.excepthook doc talks about "object"
versions: Python 3.8

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



[issue38464] documentation for NormalDist.quantiles(): missing argument

2019-10-13 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The documentation for NormalDist.quantiles() 
(https://docs.python.org/3.8/library/statistics.html#statistics.NormalDist) is 
missing the "n" argument from the definition.

--
assignee: docs@python
components: Documentation
messages: 354584
nosy: docs@python, rhettinger, srittau
priority: normal
severity: normal
status: open
title: documentation for NormalDist.quantiles(): missing argument
versions: Python 3.8

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



[issue38463] 3.8 Release Notes: Link to SSLContext.post_handshake_auth missing

2019-10-13 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The link to SSLContext.post_handshake_auth in the "ssl" section in the release 
notes is missing.

--
assignee: docs@python
components: Documentation
messages: 354582
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: 3.8 Release Notes: Link to SSLContext.post_handshake_auth missing
versions: Python 3.8

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



[issue38461] 3.8 Release Notes: "curses" misspelled as "ncurses"

2019-10-13 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The "curses" module is misspelled and sorted as "ncurses" in the release notes.

--
messages: 354579
nosy: srittau
priority: normal
severity: normal
status: open
title: 3.8 Release Notes: "curses" misspelled as "ncurses"

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



[issue38460] 3.8 Release Notes: document asyncio exception changes

2019-10-13 Thread Sebastian Rittau


New submission from Sebastian Rittau :

In Python 3.8 asyncio exceptions were consolidated into the new module 
"asyncio.exceptions". Previously they were spread out over several modules. 
While the documentation always mandated to import the exceptions from top-level 
"asyncio", code that incorrectly imported directly from the submodules will 
break.

--
assignee: docs@python
components: Documentation
messages: 354577
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: 3.8 Release Notes: document asyncio exception changes
versions: Python 3.8

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



[issue38450] 3.8 Release Notes: IDLE section dupe

2019-10-11 Thread Sebastian Rittau


New submission from Sebastian Rittau :

In the 3.8 release notes (https://docs.python.org/3.8/whatsnew/3.8.html), the 
section "IDLE and idlelib" is duplicated as "idlelib and IDLE". Also, the 
section "gc" and "gzip" between them are not sorted alphabetically like the 
rest of the list.

--
assignee: docs@python
components: Documentation
messages: 354464
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: 3.8 Release Notes: IDLE section dupe
versions: Python 3.8

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



[issue35581] Document @typing.type_check_only

2018-12-25 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch, patch
pull_requests: +10559, 10560
stage:  -> patch review

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



[issue35581] Document @typing.type_check_only

2018-12-25 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch, patch, patch
pull_requests: +10559, 10560, 10561
stage:  -> patch review

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



[issue35581] Document @typing.type_check_only

2018-12-25 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +10559
stage:  -> patch review

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



[issue35581] Document @typing.type_check_only

2018-12-25 Thread Sebastian Rittau


New submission from Sebastian Rittau :

Document @typing.type_check_only per 
https://github.com/python/typing/issues/597.

--
assignee: docs@python
components: Documentation
messages: 332508
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: Document @typing.type_check_only
versions: Python 3.7, Python 3.8

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



[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +9496
stage:  -> patch review

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



[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread Sebastian Rittau


New submission from Sebastian Rittau :

Per the discussion in https://github.com/python/typing/issues/589 and 
https://github.com/python/typeshed/issues/1652, IO, BinaryIO, TextIO, Pattern, 
and Match should be imported directly from typing, not from typing.io and 
typing.re. The documentation needs to be adjusted accordingly.

--
assignee: docs@python
components: Documentation
messages: 328683
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: Remove typing.io and typing.re from documentation

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



[issue35001] ImportFrom level cannot be optional

2018-10-16 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
nosy: +srittau

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



[issue34648] Confirm the types of parameters of traceback.format_list and traceback.StackSummary.from_list post-3.5

2018-09-12 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
nosy: +srittau

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



[issue34525] smtplib's authobject return value wrongly documented

2018-08-27 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +8438
stage:  -> patch review

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



[issue34525] smtplib's authobject return value wrongly documented

2018-08-27 Thread Sebastian Rittau


New submission from Sebastian Rittau :

smtplib's authobject() callback is supposed to return bytes, according to both 
the documentation at https://docs.python.org/3/library/smtplib.html as well as 
the docstring of SMTP.auth(). This does neither match the implementation of 
auth(), which immediately calls encode() on the return value, nor that of the 
auth_cram_md5() et al, which return str.

--
assignee: docs@python
components: Documentation
messages: 324209
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: smtplib's authobject return value wrongly documented
versions: Python 3.7

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



[issue34418] Arguments missing from documentation for HTTPErrorProcessor.http(s)_response()

2018-08-17 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +8267
stage:  -> patch review

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



[issue34418] Arguments missing from documentation for HTTPErrorProcessor.http(s)_response()

2018-08-17 Thread Sebastian Rittau


New submission from Sebastian Rittau :

The documentation at 
https://docs.python.org/3/library/urllib.request.html#urllib.request.HTTPErrorProcessor
 does not list the two arguments "request" and "response" that 
HTTPErrorProcessor.http_response() and https_response() actually require. (I 
checked the implementation in Python 3.5 and 3.7.)

--
assignee: docs@python
components: Documentation
messages: 323638
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: Arguments missing from documentation for 
HTTPErrorProcessor.http(s)_response()
versions: Python 3.5, Python 3.7

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



[issue31844] HTMLParser: undocumented not implemented method

2018-07-30 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Good call. Maybe it's actually time to retire _markupbase and merge ParserBase 
into HTMLParser.

--

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



[issue33616] typing.NoReturn is undocumented

2018-05-23 Thread Sebastian Rittau

New submission from Sebastian Rittau <srit...@rittau.biz>:

This exists at least in Python 3.6.5's typing module. 
https://github.com/python/typing/issues/165 has background on why it was added.

--
assignee: docs@python
components: Documentation
messages: 317395
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: typing.NoReturn is undocumented
versions: Python 3.6, Python 3.7, Python 3.8

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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Sebastian Rittau

Change by Sebastian Rittau <srit...@rittau.biz>:


--
keywords: +patch
pull_requests: +4723
stage:  -> patch review

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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-11 Thread Sebastian Rittau

New submission from Sebastian Rittau <srit...@rittau.biz>:

See https://github.com/python/typing/issues/518 for context.

The typing documentation for 3.6.4rc1 states:

> typing.io ... defines the generic type IO[AnyStr] and aliases TextIO and 
> BinaryIO for respectively IO[str] and IO[bytes].

In the current implementation TextIO and BinaryIO are not aliases, but instead 
derived from IO. This means that values of type IO[...], and especially IO[Any] 
can not be assigned where TextIO or BinaryIO is expected.

--
assignee: docs@python
components: Documentation
messages: 308083
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: typing.TextIO and BinaryIO are not aliases of IO[...]
versions: Python 3.6

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2017-11-14 Thread Sebastian Rittau

Change by Sebastian Rittau <srit...@rittau.biz>:


--
nosy: +srittau

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



[issue32029] cgi: TypeError when no argument string is found

2017-11-14 Thread Sebastian Rittau

Change by Sebastian Rittau <srit...@rittau.biz>:


--
components: +Library (Lib)
title: cgi: TypeError -> cgi: TypeError when no argument string is found

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



[issue32029] cgi: TypeError

2017-11-14 Thread Sebastian Rittau

New submission from Sebastian Rittau <srit...@rittau.biz>:

Consider the following code:

import cgi
from io import BytesIO

cgi.FieldStorage(BytesIO(b"{}"), environ={
"REQUEST_METHOD": "POST",
"CONTENT_TYPE": "application/json",
"CONTENT_LENGTH": "14",
})

This will throw the following exception:

Traceback (most recent call last):
  File "foo.py", line 7, in 
"CONTENT_LENGTH": "14",
  File "/usr/lib/python3.6/cgi.py", line 561, in __init__
self.read_single()
  File "/usr/lib/python3.6/cgi.py", line 740, in read_single
self.read_binary()
  File "/usr/lib/python3.6/cgi.py", line 762, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes

Of course, the input does not contain any argument string to be parsed by 
FieldStorage. Nevertheless, a TypeError in a totally unrelated part of the code 
seems like a bug. In my opinion, FieldStorage should just remain empty in this 
case, or - at best - throw a ValueError with a sensible error message.

--
messages: 306244
nosy: srittau
priority: normal
severity: normal
status: open
title: cgi: TypeError
versions: Python 3.6

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



[issue31700] one-argument version for Generator.typing

2017-11-02 Thread Sebastian Rittau

Sebastian Rittau <srit...@rittau.biz> added the comment:

Sorry for not responding, but I didn't know what I could have added that I 
didn't already say in the opening post. Of course, you can use workaround like 
using the three-argument version or creating aliases. Using Iterator is of 
course not a real solution for the general case.

I still believe that Generator should be usable with just one argument or 
typing should provide such an alias.

--

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



[issue31844] HTMLParser: undocumented not implemented method

2017-10-23 Thread Sebastian Rittau

Sebastian Rittau <srit...@rittau.biz> added the comment:

The quoted code above should have used ParserBase:

class ParserBase:

...

def error(self, message):
raise NotImplementedError(
"subclasses of ParserBase must override error()")

--

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



[issue31844] HTMLParser: undocumented not implemented method

2017-10-23 Thread Sebastian Rittau

New submission from Sebastian Rittau <srit...@rittau.biz>:

HTMLParser derives from _markupbase.ParserBase, which has the following method:

class HTMLParser:

...

def error(self, message):
raise NotImplementedError(
"subclasses of ParserBase must override error()")

HTMLParser does not implement this method and the documentation for HTMLParser 
(https://docs.python.org/3.6/library/html.parser.html) does not mention that 
its sub-classes need to override it.

I am not sure whether this is a documentation omission, whether HTMLParser 
should provide an (empty?) implementation, or whether ParserBase should not 
raise a NotImplementedError (to make linters happy).

--
messages: 304782
nosy: srittau
priority: normal
severity: normal
status: open
title: HTMLParser: undocumented not implemented method
versions: Python 3.6

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



[issue26123] http.client status code constants incompatible with Python 3.4

2017-10-23 Thread Sebastian Rittau

Sebastian Rittau <srit...@rittau.biz> added the comment:

I take the liberty of closing this "wont fix". Changing the behaviour would 
most likely do more harm than good. If one of the maintainers disagrees, please 
reopen. :)

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

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



[issue31700] one-argument version for Generator.typing

2017-10-05 Thread Sebastian Rittau

New submission from Sebastian Rittau <srit...@rittau.biz>:

Currently typing.Generator requires three arguments: Generator[YieldType, 
SendType, ReturnType].

At least for me, passing values to a generator is a very rare case. I suggest 
to allow only one argument to be passed to Generator: Generator[YieldType], 
where the other arguments default to None. This makes the common case more 
readable and is less error-prone. (I always forget the second and third 
argument, since that use case is so uncommon for me.)

--
messages: 303748
nosy: srittau
priority: normal
severity: normal
status: open
title: one-argument version for Generator.typing
versions: Python 3.7

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



[issue28375] cgi.py spam in Apache server logs

2016-10-06 Thread Sebastian Rittau

New submission from Sebastian Rittau:

I am using cgi.py in WSGI applications, using Apache and mod_wsgi. 
Unfortunately cgi.py keeps spamming the error log with messages like the 
following:

Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.5/cgi.py", line 566, in __del__
NameError: name 'AttributeError' is not defined

This is mostly likely due to the warning about __del__ in 
<https://docs.python.org/3/reference/datamodel.html>, i.e. AttributeError will 
already have been cleaned at the time FieldStorage is collected. One workaround 
that seems to work for me is to cache AttributeError in the constructor of 
FieldStorage in self and use that attribute during __del__.

--
messages: 278186
nosy: srittau
priority: normal
severity: normal
status: open
title: cgi.py spam in Apache server logs
versions: Python 3.5

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



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Sebastian Rittau

New submission from Sebastian Rittau:

The HTTP status code constants in Python 3.5 http.client are not compatible 
with the constants in Python 3.4, since the str() behaviour is different. This 
breaks code: 

srittau@moby:~$ python3.5
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import http.client
>>> str(http.client.OK)
'HTTPStatus.OK'

vs:

rittau@moby:~$ python3.4
Python 3.4.4 (default, Jan  5 2016, 15:35:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import http.client
>>> str(http.client.OK)
'200'

--
components: Library (Lib)
messages: 258291
nosy: srittau
priority: normal
severity: normal
status: open
title: http.client status code constants incompatible with Python 3.4
versions: Python 3.5

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



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Sebastian Rittau

Sebastian Rittau added the comment:

It is no doubt that is easy to work around. Once I found the problem it took 
about five minutes to fix it and roll a new release. And of course for Python 
3.5+ code it is better to use the enum http.HTTPStatus directly (I actually 
like that enum a lot). But this breaks existing code that should not break. It 
might be too late to change now, though.

As a side note, I would also have preferred str(HTTPStatus.OK) to return "OK" 
or "200" - the latter would mirror default format behaviour - instead of 
"HTTPStatus.OK", but this may be too late as well.

--

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



[issue20504] cgi.FieldStorage, multipart, missing Content-Length

2015-10-08 Thread Sebastian Rittau

Sebastian Rittau added the comment:

Is there any progress on this? The fix seems trivial.

--

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



[issue21436] bring back importlib.load_source() et al.

2014-05-05 Thread Sebastian Rittau

New submission from Sebastian Rittau:

It was very easy to load plugin files in Python 2:

import imp
my_module = imp.load_source(what.ever, foo.py)

Unfortunately, this became much more obscure in Python 3.3:

import importlib.machinery
loader = importlib.machinery.SourceFileLoader(what.ever, foo.py)
my_module = loader.load_module(what.ever)

In Python 3.4 even this has been deprecated. There should be a way (preferable 
an easy-to-use one) to load a Python module by filename or by stream.

--
components: Library (Lib)
messages: 217919
nosy: srittau
priority: normal
severity: normal
status: open
title: bring back importlib.load_source() et al.
type: enhancement
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21436
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20504] cgi.FieldStorage, multipart, missing Content-Length

2014-02-26 Thread Sebastian Rittau

Changes by Sebastian Rittau srit...@jroger.in-berlin.de:


--
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20504
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20504] cgi.FieldStorage, multipart, missing Content-Length

2014-02-03 Thread Sebastian Rittau

New submission from Sebastian Rittau:

Consider the attached test case. This test will run fine with Python 2.7, but 
will fail with Python 3.3. If cgi.FieldStorage() tries to parse a multipart 
request without a Content-Length header in the main section, segments will have 
a length of 0.

During the parse process, two instances of FieldStorage are involved. The outer 
one reads the whole request and creates and delegates reading of the fragment 
to inner instances.

The main problem is that FieldStorage.read_lines_to_outerboundary() of the 
inner FieldStorage will read nothing, since self.limit is lower than zero.

def read_lines_to_outerboundary(self):
...
while 1:
if _read = self.limit:
break
...

This happens, since limit is passed when creating the inner instance in 
FieldStorage.read_multi():

def read_multi(self, environ, keep_blank_values, strict_parsing):
...
part = klass(self.fp, headers, ib, environ, keep_blank_values,
 strict_parsing,self.limit-self.bytes_read,
 self.encoding, self.errors)
...

Now, if the total request did not have a Content-Length header, self.limit will 
be -1.

The naive fix works for the test case, at least, but I don't know if there are 
other repercussions:

--- /usr/lib/python3.3/cgi.py   2014-02-03 22:31:16.649431125 +0100
+++ cgi.py  2014-02-03 22:32:14.849704379 +0100
@@ -788,7 +788,7 @@
 last_line_lfend = True
 _read = 0
 while 1:
-if _read = self.limit:
+if self.limit = 0 and _read = self.limit:
 break
 line = self.fp.readline(116) # bytes
 self.bytes_read += len(line)

--
components: Library (Lib)
files: cgi-bug.py
messages: 210166
nosy: srittau
priority: normal
severity: normal
status: open
title: cgi.FieldStorage, multipart, missing Content-Length
versions: Python 3.3
Added file: http://bugs.python.org/file33891/cgi-bug.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20504
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2736] datetime needs an epoch method

2010-05-22 Thread Sebastian Rittau

Changes by Sebastian Rittau srit...@jroger.in-berlin.de:


--
nosy:  -srittau

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2736
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Sebastian Rittau

Sebastian Rittau srit...@jroger.in-berlin.de added the comment:

A timedelta.toseconds method (or equivalent) makes no sense. The number
of seconds in a day is not fixed (due to leap seconds) and relying on
such a method would introduce subtle bugs. The only way to find out the
number of seconds in a range of dates is if you have a concrete date range.

--
nosy: +srittau

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1673409
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2155] optparse.OptionGroup with_statement context handling

2008-12-15 Thread Sebastian Rittau

Sebastian Rittau srit...@jroger.in-berlin.de added the comment:

This API is too magical to my liking and doesn't really reflect what
context manager's are supposed to do, i.e. handling resources. Also, I
don't see much advantage over:

group = OptionGroup(parser, Group name)
group.add_option(...)
parser.add_option_group(group)

Finally, the __exit__ handler adds the option group to the parser in any
case, whether there was an exception raised inside the block or not.

--
nosy: +srittau

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2155
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1673409] datetime module missing some important methods

2008-12-15 Thread Sebastian Rittau

Sebastian Rittau srit...@jroger.in-berlin.de added the comment:

Leap second handling is usually configurable. Default on Debian Linux
(but similar on RHEL and SuSE):

 int(date(1994,1,1).strftime(%s)) - int(date(1993,1,1).strftime(%s))
31536000

After doing cp /usr/share/zoneinfo/right/Europe/Berlin /etc/localtime:

 int(date(1994,1,1).strftime(%s)) - int(date(1993,1,1).strftime(%s))
31536001

Also, NTP servers usually get this right. I don't think, Python should
promote a wrong date handling by default, even if it's convenient.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1673409
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4577] distutils: -3 warnings (apply)

2008-12-07 Thread Sebastian Rittau

New submission from Sebastian Rittau [EMAIL PROTECTED]:

The attached patch removes all instances of the deprecated apply
function from distutils and thereby fixes warnings when run with -3.

--
components: Distutils
files: distutils.diff
keywords: patch
messages: 77233
nosy: srittau
severity: normal
status: open
title: distutils: -3 warnings (apply)
versions: Python 2.6
Added file: http://bugs.python.org/file12263/distutils.diff

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



[issue4577] distutils: -3 warnings (apply)

2008-12-07 Thread Sebastian Rittau

Sebastian Rittau [EMAIL PROTECTED] added the comment:

Oops, missed a closing parenthesis.

Added file: http://bugs.python.org/file12264/distutils.diff

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



[issue4577] distutils: -3 warnings (apply)

2008-12-07 Thread Sebastian Rittau

Changes by Sebastian Rittau [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file12263/distutils.diff

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



[issue4578] compiler: -3 warnings

2008-12-07 Thread Sebastian Rittau

New submission from Sebastian Rittau [EMAIL PROTECTED]:

The attached patch replaces all instances of x.has_key(k) method calls
by k in x. It also replaces one call to parser.ast2tuple by
parser.st2tuple. This removes deprecation warnings when running in -3 mode.

--
components: Library (Lib)
files: compiler.diff
keywords: patch
messages: 77238
nosy: srittau
severity: normal
status: open
title: compiler: -3 warnings
versions: Python 2.6
Added file: http://bugs.python.org/file12266/compiler.diff

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



[issue4578] compiler: -3 warnings

2008-12-07 Thread Sebastian Rittau

Sebastian Rittau [EMAIL PROTECTED] added the comment:

I'd like to see this fixed, just to decrease the amount of warning spam
I get when testing my own packages. It seems that one of my dependecies
that I have no control over is pulling this in. Adding a warning when
this module is important seems like a good idea, though.

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