[issue46595] [doc] Undocumented behavior of importlib.metadata.version

2022-01-31 Thread cowlinator


New submission from cowlinator :

If `importlib.metadata.version` can't find the distribution version, it seems 
to return the result of a local `git describe`.  I don't know if this is 
git-specific, or which other SCMs this might try to interact with.

The result of `importlib.metadata.version` varies depending on whether the 
local directory happens to be a git repo.

This is unexpected and undocumented. Based on the documentation, I expected 
that when it couldn't find the distribution version, it would ALWAYS raise and 
exception or return nothing.

In order to properly document this, you'll have to figure out all of the SCMs 
that it might interact with.

--
assignee: docs@python
components: Documentation
messages: 412227
nosy: cowlinator, docs@python
priority: normal
severity: normal
status: open
title: [doc] Undocumented behavior of importlib.metadata.version
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

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



[issue46595] [doc] Undocumented behavior of importlib.metadata.version

2022-01-31 Thread cowlinator


cowlinator  added the comment:

I'd also like to know which `git describe` args it's using

--

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



[issue46595] [doc] Undocumented behavior of importlib.metadata.version

2022-01-31 Thread cowlinator


cowlinator  added the comment:

nevermind, i was just being stupid. the git describe wound up in a local egg or 
build metadata which i guess is where importlib.metadata.version pulls from

--

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



[issue46595] [doc] Undocumented behavior of importlib.metadata.version

2022-01-31 Thread cowlinator


Change by cowlinator :


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

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



[issue22374] Replace contextmanager example and improve explanation

2018-01-29 Thread cowlinator

cowlinator  added the comment:

I would like to second the improved explanation of contextlib.contextmanager, 
and additionally point out another problem:  
A very important piece of information is missing from the documentation:  how 
to return data from the contextmanager-wrapped function.  

I had to go look up the source code, which had a wonderful explanation in the 
comments: https://gist.github.com/enuomi/1385336#file-contextlib-py-L56 

In particular, note that 

@contextmanager
def some_generator():
  yield 

can be used to return  to the caller, via

with some_generator() as :
  print(return_data)

This information is wholly and completely missing from the 
contextlib.contextmanager documentation.

--
nosy: +cowlinator
versions: +Python 2.7, Python 3.4, Python 3.7

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread cowlinator

New submission from cowlinator :

The documentation for the csv.DictReader constructor (and presumably 
csv.DictWriter also) has the wrong name written for the first argument.  This 
prevents the argument from being called by name.

>>> file = open("file.txt", 'a')
>>> csv.DictReader(csvfile=file)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() takes at least 2 arguments (1 given)
>>> csv.DictReader(f=file)

>>> # how could i have known it was named 'f'?

Please change the documentation.

--
messages: 311759
nosy: cowlinator
priority: normal
severity: normal
status: open
title: Wrong argument name for csv.DictReader in documentation
versions: Python 2.7, Python 3.5

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-08 Thread cowlinator

cowlinator  added the comment:

Hi, thanks for the quick action on this!

The documentation is still wrong for 3.5 .  I had selected 3.5 for the affected 
versions, but I guess it got removed?

--
versions: +Python 3.5

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



[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread cowlinator


New submission from cowlinator :

I can consistently reproduce a bug in 2.7.15 on Windows which causes an 
unexpected IOError.

Steps to reproduce:

Enter the following code in a plain-vanilla windows command line console:

>>> import sys
>>> while True:
... sys.stdout.write('.')

Then, pause the output, either by clicking and holding the scrollbar for 10 
seconds, or by highlighting text with the mouse for 10 seconds and then 
pressing 'enter' to un-highlight.
Upon resuming, the following error is seen:

Traceback (most recent call last):
  File "", line 2, in 
IOError: [Errno 0] Error

--
components: IO, Windows
messages: 325676
nosy: cowlinator, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console
type: behavior
versions: Python 2.7

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



[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread cowlinator


cowlinator  added the comment:

I think you are probably right.  
I'm using Windows 10 Version 1709 (OS Build 16299.611)

--

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