[issue38961] Flaky detection of compiler vendor

2019-12-03 Thread John-Mark


New submission from John-Mark :

The `configure` script for building what appears to be any version of python 
(I've manually checked 2.7, 3.6.6, and master) uses simple substring-in-path 
checks to determine the compiler vendor. This is problematic because it is very 
easy for it to produce very confusing false-positives.

This appeared for me when compiling with a custom version of `clang` located at 
`/home/riccardo/some/path`, which caused this line

https://github.com/python/cpython/blob/894331838b256412c95d54051ec46a1cb96f52e7/configure#L7546

to mistakenly assume an ICC configuration (because `icc` is a substring of 
`riccardo`). A quick check through the script reveals that compiler vendor 
detection in the script doesn't appear to be unified and are mostly similarly 
flaky.

Other projects compile a small program that checks for defines, or parses the 
output of `$CC --version` or similar.

--
components: Build
messages: 357755
nosy: jmaargh
priority: normal
severity: normal
status: open
title: Flaky detection of compiler vendor
type: compile error
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue8350] os.mkdir doc comment is incorrect

2010-05-08 Thread John Mark Schofield

John Mark Schofield  added the comment:

Please don't close this as "invalid."

Most (all?) of the functions in the os module have positional-only arguments, 
which are documented in exactly the same manner as arguments which can be 
supplied using a keyword.

As someone reading the documentation, how am I supposed to know which arguments 
can be supplied with keywords and which can't?

This ticket and the link to 
http://docs.python.org/dev/reference/expressions.html#calls are helpful in 
explaining this now, but I would NEVER have thought to look there to find out 
why os.fdopen isn't working the way it's documented. Requiring me to experiment 
to determine which function works which way seems to miss the point of having 
documentation in the first place.

I take no position on whether this should be fixed with a documentation change 
or a code change, but it should be fixed. If the consensus is that a 
documentation change would be quicker to implement, I'm happy to submit a doc 
patch.

--
nosy: +schof

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



[issue8350] os.mkdir doc comment is incorrect

2010-05-08 Thread John Mark Schofield

John Mark Schofield  added the comment:

I'd also suggest changing the title to "Documentation for many functions in os 
module is incomplete." I didn't because I don't know if that would be 
considered rude. (I'm new to the Python community.)

--

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



[issue1777134] minidom pretty xml output improvement

2008-02-12 Thread John-Mark Gurney

John-Mark Gurney added the comment:

I think this is a good patch.  It gives more useful pretty XML output. 
I would suggest that possibly this routine be moved to xml.dom or
xml.dom.utils instead of being part of minidom since it should not be
minidom specific.

There is one bug in the patch in that:
node.writexml(writer, (%s%s) % (indent,addindent)

the parens around the %s%s should be quotes instead.

--
nosy: +jmg

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



[issue42414] unable to document fields of dataclass

2021-07-20 Thread John-Mark Gurney


John-Mark Gurney  added the comment:

Though this suggestion does work, I am not a fan of this solution.

The issue is that it separates the doc from the definition.  This works well if 
you have only a field fields in the class, But if you get 10-20+ fields, it 
moves away the docs and makes it easier for people to forget to add 
documentation to the field when they add additional fields, where w/ my 
suggestion, it's less likely that it will be forgotten.

Note: I would look at making a patch, but as I don't plan on signing the 
contributor's agreement, any patch I make will not be usable.

--

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



[issue42414] unable to document fields of dataclass

2021-07-20 Thread John-Mark Gurney


John-Mark Gurney  added the comment:

So, just looked at the patch, but it's missing the documentation part of it.

Also, yes, you can add the doc as another line, but now that's two lines (yes, 
you can add semicolons to make it one line, but that might surprise some 
people).

I do request that any examples USE this approach (multiline) and not the  
example that was provided here which will lead the issues.

Note: These are only suggestions, and as with all free software, you're free to 
take them or leave them.

--

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



[issue45733] importlib.abc.Traversable.name does not match

2021-11-05 Thread John-Mark Gurney


New submission from John-Mark Gurney :

The documentation for Traversable.name says it is a method, not a property:
https://docs.python.org/3/library/importlib.html#importlib.abc.Traversable.name

The issue is that with Python 3.9.7 (default, Nov  1 2021, 11:26:33), using a 
standard posix module (on MacOSX), it returns a string and not a method.  I 
have not tested on newer versions, but expect similar issues.  I have tagged 
the newer versions to get exposure, feel free to untag the versions that are 
confirmed to be unaffected by this bug.

```
$ python3.9
Python 3.9.7 (default, Nov  1 2021, 11:26:33) 
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod

>>> ^D
```

This is with a module dir named `mod`, w/ an empty `res.txt` file, and the 
following in `__init__.py`:
```
from importlib import resources

r = resources.files(__name__) / 'res.txt'

print(repr(type(r.name)))
```

--
messages: 405837
nosy: jmg
priority: normal
severity: normal
status: open
title: importlib.abc.Traversable.name does not match
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

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



[issue39386] getting invalid data from async iterator

2020-01-18 Thread John-Mark Gurney


New submission from John-Mark Gurney :

If I create a coro from an async iterator, then wait_for it w/ a timeout, but 
shielded, so it won't get canceled, and then await upon it, it returns invalid 
data.

See the attached test case.

The reason I do the following is to make sure that an async iterator that I 
have written doesn't return data early, and needs to wait till later.  If I 
didn't shield it, then the async iterator would get cancelled, and I don't want 
this.

I'd expect either correct results to be returned, or an exception to be raised, 
but in this case, and the docs for wait_for ( 
https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for ), I'd 
expect the correct results to be returned.


In the attached case, this is the results that I get:
$python3.7 asyncitertc.py 
3.7.5 (default, Oct 18 2019, 23:59:39) 
[Clang 7.0.2 (clang-700.1.81)]
timed out
yielding 1
results: None
getting 2: 2

I do not have python 3.8 to test with.

--
files: asyncitertc.py
messages: 360254
nosy: jmg
priority: normal
severity: normal
status: open
title: getting invalid data from async iterator
Added file: https://bugs.python.org/file48852/asyncitertc.py

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



[issue12734] Request for property support in Python re lib

2021-01-26 Thread John Mark Vandenberg


Change by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue42414] unable to document fields of dataclass

2020-11-19 Thread John-Mark Gurney


New submission from John-Mark Gurney :

per: https://bugs.python.org/issue38401

There is not a way to document fields of a dataclass.

I propose that instead of making a language change, that an additional 
parameter to the field be added in similar vein to property.

This currently works:
```
class Foo:
 def getx(self):
  return 5
 x = property(getx, doc='document the x property')
```

So, I propose this:
```
@dataclass
class Bar:
 x : int = field(doc='document what x is')
```

This should be easy to support as I believe that the above would not require 
any changes to the core language.

--
messages: 381455
nosy: jmg
priority: normal
severity: normal
status: open
title: unable to document fields of dataclass

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



[issue42414] unable to document fields of dataclass

2020-11-20 Thread John-Mark Gurney


John-Mark Gurney  added the comment:

As I said, I expect it to work similar to how property works:
```
>>> class Foo:
...  def getx(self):
...   return 5
...  x = property(getx, doc='document the x property')
... 
>>> help(Foo)
Help on class Foo in module __main__:

class Foo(builtins.object)
 |  Methods defined here:
 |  
 |  getx(self)
 |  
 |  --
 |  Readonly properties defined here:
 |  
 |  x
 |  document the x property
 |  
 |  --
 |  Data descriptors defined here:
 |  
 |  __dict__
 |  dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |  list of weak references to the object (if defined)
```

The pure python implementation of property is at: 
https://docs.python.org/3/howto/descriptor.html#properties

which uses the descriptor protocal as documented in: 
https://docs.python.org/3/howto/descriptor.html

Which uses an object w/ __get__/__set__/__delete__ to emulate attribute access, 
and that object can have the __doc__ property set on it to provide 
documentation.

--

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



[issue21810] SIGSEGV in PyObject_Malloc when ARENAS_USE_MMAP

2014-06-19 Thread John-Mark Bell

New submission from John-Mark Bell:

In low-memory scenarios, the Python 2.7 interpreter may crash as a result of 
failing to correctly check the return value from mmap in new_arena().

This changeset appears to be the point at which this issue was introduced: 
http://hg.python.org/cpython/rev/4e43e5b3f7fc

Looking at the head of the 2.7 branch in Mercurial, we see the issue is still 
present: http://hg.python.org/cpython/file/cf70f030a744/Objects/obmalloc.c#l595

On failure, mmap will return MAP_FAILED ((void *) -1), whereas malloc will 
return NULL (0). Thus, the check for allocation failure on line 601 will 
erroneously decide that the allocation succeeded in the mmap case.

The interpreter will subsequently crash once the invalid address is accessed. 
I've attached a potential fix for this issue.

--
components: Interpreter Core
files: obmalloc.diff
keywords: patch
messages: 221013
nosy: John-Mark.Bell
priority: normal
severity: normal
status: open
title: SIGSEGV in PyObject_Malloc when ARENAS_USE_MMAP
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file35694/obmalloc.diff

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



[issue7481] Failing to start a thread leaves "zombie" thread in "initial" state

2009-12-11 Thread John Mark Schofield

New submission from John Mark Schofield :

SUMMARY: When you attempt to start a thread, and you're unable to (you
get thread.error) it leaves a thread stuck in an "initial" state that
never exits. (threading.enumerate() shows the threads and lists their
status as "initial.")

REPRODUCTION STEPS: See attached file.

EXPECTED RESULT: Failing to start a thread should not leave the thread
in an un-executable state. I would expect the thread start to either
succeed or result in the thread being closed and GC'd.

VERIFIED ON:
Python 2.5.2 on OS X 10.5.8
Python 2.5.2 on Ubuntu 8.04
Python 2.5.4 on Windows XP Professional (Version 2002) SP3
Python 2.6.1 on OS X 10.6.2

--
files: repro_case.py
messages: 96271
nosy: schof
severity: normal
status: open
title: Failing to start a thread leaves "zombie" thread in "initial" state
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file15527/repro_case.py

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



[issue27187] Relax __all__ location requirement in PEP 8

2016-06-02 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue27187] Relax __all__ location requirement in PEP 8

2016-06-07 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

The revised text says __dunder__ should appear before any imports, however 
__future__ imports must appear first for obvious reasons.  Does this need to be 
mentioned in the pep?

--

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2016-07-12 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue27364] Deprecate invalid unicode escape sequences

2016-08-23 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue24667] OrderedDict.popitem() raises KeyError

2015-07-19 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue19003] email.generator.BytesGenerator corrupts data by changing line endings

2015-09-18 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

Introduced in the initial version of statistics was """" starting a docstring

https://hg.python.org/cpython/annotate/685e044bed5e/Lib/statistics.py#l380

Somewhere the fourth quote is dropped, as it doesnt appear in the docs:

https://docs.python.org/3/library/statistics.html#statistics.median_grouped

--
assignee: docs@python
components: Documentation, Library (Lib)
files: cpython-statistics.patch
keywords: patch
messages: 253568
nosy: John.Mark.Vandenberg, docs@python
priority: normal
severity: normal
status: open
title: Four quotes used to begin docstring
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40871/cpython-statistics.patch

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

The additional quotation mark is shown in help()

>>> help(statistics.median_grouped)
Help on function median_grouped in module statistics:

median_grouped(data, interval=1)
"Return the 50th percentile (median) of grouped continuous data.

--

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Thank you for clarifying that.
Does that mean that this issue should not be assigned to docs@python and should 
not have a Component of 'Documentation'?

--

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



[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Not surprising also occurs on Python 3.2, 3.3, & 3.6.
I'm not sure whether fixes like this are suitable to be merged into 3.2/3.3.(is 
there a document describing this?)

--
nosy: +John.Mark.Vandenberg
versions: +Python 3.2, Python 3.3, Python 3.6

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



[issue25502] unnecessary re-imports

2015-10-28 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

The following four modules re-import another module unnecessarily as it is 
already imported in the global scope.

Lib/getpass.py : msvcrt
Lib/pickletools.py : sys
Lib/smtplib.py : sys
PC/testpy.py : os

In each case, the import being removed in the attached patch existed in the 
source code before the import which now occurs first.  i.e. an import was added 
and the same import elsewhere in the module was not removed.

--
components: Library (Lib)
files: re-imports.diff
keywords: patch
messages: 253651
nosy: John.Mark.Vandenberg
priority: normal
severity: normal
status: open
title: unnecessary re-imports
versions: Python 3.6
Added file: http://bugs.python.org/file40882/re-imports.diff

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



[issue25486] Resurrect inspect.getargspec() in 3.6

2015-10-28 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue25503] inspect.getdoc does find inherited property __doc__

2015-10-28 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

inspect.getdoc's helper _finddoc raises an AttributeError on encountering a 
property, which is silently discarded.

>>> class Foo(object):
... @property
... def foo(self):
... """foobar."""
... return 'foo'
... 
>>> class Bar(Foo):
... @property
... def foo(self):
... return 'bar'
... 
>>> import inspect
>>> inspect.getdoc(Foo.foo)
'foobar.'
>>> inspect.getdoc(Bar.foo)
>>>

How I came upon this was doing static code analysis, and the f.fget on line 522 
here looks very wrong.

http://bugs.python.org/review/15582/diff/14140/Lib/inspect.py

This code dedicated to supporting `property` does not work because of that, but 
also because a property is also a data descriptor so the 'property' branch is 
never executed.

>>> inspect.isdatadescriptor(property())
True

--
components: Library (Lib)
files: getdoc-property.diff
keywords: patch
messages: 253653
nosy: John.Mark.Vandenberg
priority: normal
severity: normal
status: open
title: inspect.getdoc does find inherited property __doc__
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40885/getdoc-property.diff

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



[issue25503] inspect.getdoc does find inherited property __doc__

2015-10-28 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +serhiy.storchaka

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



[issue25502] unnecessary re-imports

2015-10-28 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


Added file: http://bugs.python.org/file40886/re-imports.diff

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



[issue25504] undefined name 'modules' in Tools/freeze/checkextensions_win32.py

2015-10-28 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

All versions of Tools/freeze/checkextensions_win32.py have had an error due to 
accessing 'modules.sourceFiles' instead of 'module.sourceFiles'.

https://hg.python.org/cpython/diff/8e9d5e5103f5/Tools/freeze/checkextensions_win32.py#l1.96

Presumably there is something which makes this block of code rather 
infrequently used.

--
components: Demos and Tools
files: checkextensions_win32.diff
keywords: patch
messages: 253656
nosy: John.Mark.Vandenberg, mhammond
priority: normal
severity: normal
status: open
title: undefined name 'modules' in Tools/freeze/checkextensions_win32.py
type: crash
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40887/checkextensions_win32.diff

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



[issue25505] undefined name 'window' in Tools/scripts/fixdiv.py

2015-10-28 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

Tools/scripts/fixdiv.py 's `FileContext.truncate` has used `window` since it 
was created, when it is supposed to use self.window.

https://hg.python.org/cpython/annotate/60f290a7eae8/Tools/scripts/fixdiv.py#l195

`truncate` is unused, so an alternative fix is to remove it, as it has never 
worked, and nobody has complained.

--
components: Demos and Tools
files: fixdiv.diff
keywords: patch
messages: 253661
nosy: John.Mark.Vandenberg
priority: normal
severity: normal
status: open
title: undefined name 'window' in Tools/scripts/fixdiv.py
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40888/fixdiv.diff

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



[issue25505] undefined name 'window' in Tools/scripts/fixdiv.py

2015-10-28 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


Added file: http://bugs.python.org/file40889/fixdiv-remove-truncate.diff

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



[issue25506] test_pprint reuses test_user_dict

2015-10-29 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

test_pprint defined test_user_dict twice, once for UserDict, and the second for 
UserList.

--
components: Library (Lib), Tests
files: test_pprint-fix.diff
keywords: patch
messages: 253663
nosy: John.Mark.Vandenberg, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_pprint reuses test_user_dict
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40891/test_pprint-fix.diff

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



[issue25506] test_pprint reuses test_user_dict

2015-10-29 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Sorry; the first patch includes unrelated fixes.

--
Added file: http://bugs.python.org/file40892/test_pprint-fix.diff

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



[issue25505] undefined name 'window' in Tools/scripts/fixdiv.py

2015-10-29 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +serhiy.storchaka

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



[issue25515] Always use os.urandom for generating uuid4s

2015-10-29 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue1650090] doctest doesn't find nested functions

2015-11-03 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue12790] doctest.testmod does not run tests in functools.partial functions

2015-11-03 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue2275] urllib/httplib header capitalization

2015-11-03 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue24925] Allow doctest to find line number of __test__ strings if formatted as a triple quoted string.

2015-11-03 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +John.Mark.Vandenberg

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



[issue25179] PEP 498 f-strings need to be documented

2015-11-07 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Might be useful to add a note to PEP 257 that f-strings are not valid as 
docstrings .

Or should f-strings be valid docstrings and raise an error if any variables 
present in the f-string do not exist in the outer scope?

--
nosy: +John.Mark.Vandenberg

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



[issue25545] email parsing docs: clarify that only ASCII strings are supported

2015-11-07 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Could it issue a UnicodeWarning?

--
nosy: +John.Mark.Vandenberg

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



[issue1650090] doctest doesn't find nested functions

2015-11-07 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
versions: +Python 3.4, Python 3.5, Python 3.6 -Python 3.1, Python 3.2
Added file: http://bugs.python.org/file40977/doctest_nested_functions-py3.6.diff

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



[issue1650090] doctest doesn't find nested functions

2015-11-07 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


Added file: http://bugs.python.org/file40978/doctest_nested_functions-py3.6.diff

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



[issue25699] Easier way to specify reduced globals for doctest

2015-11-22 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

Currently doctest.testmod `globals` defaults to including everything in the 
module scope, and tools like pyflakes assume that doctests run with globals as 
a copy of __dict__ .

It is relatively simple to exclude everything using doctest.testmod(globs={}).

However to use a limited scope, such as only including attributes in __all__, 
we need to use `doctest.testmod(globs=[(name, globals()[name]) for name in 
__all__])`

However those solutions require that each module includes a `if __name__ == 
"__main__":` block that invokes doctest.testmod, and then other doctest related 
tools (pyflakes, nose, etc) need to *parse* the invocation to determine the 
desired globals contents.

It would be easier to control the globals using a module attribute that works 
like __all__, so that all doctest tools could easily determine the desired 
contents of globals.

e.g. the following could provide a sane reduced globals for doctests

__test_all__ = __all__ = ['foo']

As people sometimes add docstrings/doctest for functions not exported in 
__all__ for external use, in addition to the list of symbols in __test_all__, 
the doctest globals should include the function/class which the 
docstring/doctest is attached to.

See https://bugs.launchpad.net/pyflakes/+bug/1178807 for background to this 
enhancement request.

--
components: Tests
messages: 255111
nosy: John.Mark.Vandenberg
priority: normal
severity: normal
status: open
title: Easier way to specify reduced globals for doctest
type: enhancement
versions: Python 3.6

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-12-09 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

It seems like there is already sufficient detection of invalid stack levels in 
warnings.warn, and one of the code paths does `module = ""` and later 
another does `filename = module`, so `filename` can be intentionally junk data, 
which will be passed to `linecache`.

I expect this could be satisfactorily resolved by warn() setting filename = 
'', and `formatwarning` not invoking linecache when the 
filename is '', '', etc., or at least ignoring the 
exception from linecache when the filename is .

Looking forward, why not let Python 3.6 warn() behave 'better' when the 
stacklevel is invalid.

e.g. it could raise ValueError (ouch, but 'correct'), or it could reset the 
stacklevel to 1 (a sensible fallback) and issue an auxillary SyntaxWarning to 
inform everyone that the stacklevel requested was incorrect.

--
nosy: +John.Mark.Vandenberg

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



[issue25216] Warnings stacklevel frames to skip

2015-12-10 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue2636] Adding a new regex module (compatible with re)

2015-12-10 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue25216] Warnings stacklevel frames to skip

2015-12-10 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

This looks a lot like the patch on http://bugs.python.org/issue850482

--

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



[issue850482] Enhance frame handing in warnings.warn()

2015-12-10 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

See similar http://bugs.python.org/issue25216

--
nosy: +jayvdb

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



[issue25034] string.Formatter accepts empty fields but displays wrong when nested

2015-12-16 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue23556] Scope for raise without argument is different in Python 2 and 3

2015-12-23 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

In pyflakes we've looked at some of the strange scenarios where a raise without 
argument is 'legal'.  A patch to report errors for some of these was rejected 
because they are legal. See https://github.com/pyflakes/pyflakes/pull/57  The 
worst example of 'legal' is an exception in one module can be re-raised by 
another module.

--
nosy: +jayvdb

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



[issue25381] Doc: Use of old description of raise in Python3

2015-12-23 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2016-02-08 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue26632] __all__ decorator

2016-05-10 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue22247] More incomplete module.__all__ lists

2016-05-10 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue25758] ensurepip/venv broken on Windows if path includes unicode

2016-08-31 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue22888] ensurepip and distutils' build_scripts fails on Windows when path to Python contains accented characters

2016-08-31 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

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



[issue27924] ensurepip raises TypeError after pip uninstall

2016-08-31 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

After uninstalling pip on Fedora 24, ensurepip get_records_to_pack returns 
None, causing rewheel.rewheel_from_record to raise TypeError: 'NoneType' object 
is not iterable.

While this is probably not a scenario that CPython supports directly, it would 
be nice if it handled it a bit better.

Presumably this is using the system python-pip 8.1.0, while there is another 
pip present, and it is uninstalling both pip 7.1.2 and 8.1.0 at the same time.

$ sudo pip uninstall pip
Uninstalling pip-7.1.2:
  /usr/bin/pip
  /usr/bin/pip2
  /usr/bin/pip2.7
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/DESCRIPTION.rst
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/METADATA
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/RECORD
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/WHEEL
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/entry_points.txt
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/metadata.json
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/pbr.json
  /usr/lib/python2.7/site-packages/pip-7.1.2.dist-info/top_level.txt
  /usr/lib/python2.7/site-packages/pip/__init__.py
  /usr/lib/python2.7/site-packages/pip/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/__main__.py
  /usr/lib/python2.7/site-packages/pip/__main__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/_markerlib/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/_markerlib/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/_markerlib/markers.py
  /usr/lib/python2.7/site-packages/pip/_vendor/_markerlib/markers.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/cache.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/cache.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
  
/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyc
  
/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py
  
/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/compat.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/compat.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/wrapper.py
  /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/wrapper.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/win32.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/winterm.py
  /usr/lib/python2.7/site-packages/pip/_vendor/colorama/winterm.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/__init__.py
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/__init__.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.py
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyc
  /usr/lib/python2.7/site-packages/pip/_vendor/distlib

[issue27924] ensurepip raises TypeError after pip uninstall

2016-08-31 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Well, it wasnt my intention to remove the vendor package.  There were two 
versions, and I assume it would remove the older package which wasnt supplied 
by the vendor, but it removed both.

Anyways, I see that most of the code path is in 
https://github.com/fedora-python/rewheel/blob/master/python2-ensurepip-rewheel.patch#L36

I guess there isnt much the cpython module can do here.

--
resolution:  -> third party
status: open -> closed

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



[issue25699] Easier way to specify reduced globals for doctest

2016-10-02 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

pyflakes does assume doctest run with a copy of the module scope.


However when there is an __all__, the module scope as seen by other modules 
'should' be only items in __all__.  If a doctest is included in documentation, 
it 'should' only use names that are in __all__.

In addition, pyflakes has an outstanding feature request 
(https://bugs.launchpad.net/pyflakes/+bug/1178807/comments/8) that doctest run 
as if they are an independent module, and need to import everything that they 
use, so that each doctest is self-contained.

pyflakes can build support for both of those needs within the package.  No 
worries.  If you cant see a broader need for these, please close.

--

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