[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-04 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Thanks for the PR @danishprakash . `-I` was added as part of 3.4 with commit 
ad73a9cf977 and not backported to 2.7 . Also 3.4 and 3.5 branches are in 
security fixes mode. So I am removing 2.7, 3.4 and 3.5 .

--
nosy: +xtreak
versions:  -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue34902] Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"

2018-10-04 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Azure pipelines PR seems to fail with the error "Unexpected vmImage 
'vs2017-win2017'" .

First build failure with this message : 
https://dev.azure.com/Python/cpython/_build/results?buildId=31800=results

Last successful build : 
https://dev.azure.com/Python/cpython/_build/results?buildId=31797=results


Thanks

--
components: Build, Windows
messages: 327102
nosy: paul.moore, steve.dower, tim.golden, xtreak, zach.ware
priority: normal
severity: normal
status: open
title: Azure pipelines PR build fails with "Unexpected vmImage 'vs2017-win2017'"
versions: Python 3.8

___
Python tracker 

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



[issue18291] codecs.open interprets FS, RS, GS as line ends

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is an open issue for changing str.splitlines(): issue22232. It would help 
to fix this issue. The only problem is that we don't have agreement about the 
new parameter name (and changing the behavior unconditionally is not an option).

--

___
Python tracker 

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



[issue18291] codecs.open interprets FS, RS, GS as line ends

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

New patch that changes str.splitlines to work like Python 2 str.splitlines and 
like Python 3 bytes.splitlines.  Surprisingly, only a few cases in the unit 
test suite fail.  I've fixed them in my patch.

--
Added file: https://bugs.python.org/file47852/str_splitlines.txt

___
Python tracker 

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



[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-04 Thread Danish Prakash


Danish Prakash  added the comment:

Linking this[1] here in case someone else stumbles upon this thread. I've 
created an issue and a PR for the documentation issue regarding the absence of 
-I flag from the sys.flags table which came into picture from the discussions 
in this thread.

[1]: https://bugs.python.org/issue34901

--

___
Python tracker 

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



[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-04 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-04 Thread Danish Prakash


Change by Danish Prakash :


--
assignee: docs@python
components: Documentation
nosy: danishprakash, docs@python
priority: normal
severity: normal
status: open
title: Missing isolated (-I) flag in sys.flags table
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue23706] pathlib.Path.write_text should include a newline argument

2018-10-04 Thread Thrlwiti


Change by Thrlwiti :


--
nosy: +THRlWiTi

___
Python tracker 

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



[issue18291] codecs.open interprets FS, RS, GS as line ends

2018-10-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue18291] codecs.open interprets FS, RS, GS as line ends

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Some further progress on this.  My patch slows down reading files with the 
codecs module very significantly.  So, I think it could never be merged as is.  
Maybe we would need to implement an alternative str.splitlines that behaves as 
we want, implemented in C.

Looking at the uses of str.splitlines in the stdlib, I can't help but think 
there are many places where this (IMHO bad) behaviour of splitting on all these 
extra controls characters have made it so that splitlines should not be used in 
most cases.  Or, we should change splitlines to work the same as the file 
readlines splitting.

For example, RobotFileParser uses str.splitlines().  I suspect it should only 
be splitting on \n characters.

--

___
Python tracker 

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



[issue34900] unittest subTests() fails when called from debug()

2018-10-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



pip hangs after successful operation

2018-10-04 Thread Ryan Johnson
Hello, I am seeking some quick help, and probably am reporting bugs along the 
way. I apologize that this is a long email. Please let me know what I should do 
in the future.

On Windows, pip hangs and does not install packages in the proper location (or 
perhaps, at all), even if pip claims it installed successfully. Upon hanging, I 
can use Ctrl+C to terminate individual processes that have succeeded, and the 
results show up in “pip list”, but this bug affects any packages that call pip 
within their install script, which makes this a critical bug, since the package 
install scripts will never complete.

Filed bug report here: https://github.com/pypa/pip/issues/5850

My environment:
➢ Python 3.7.0 x64
➢ pip 18.0
➢ Windows 10 Pro x64

Steps taken to resolve, so far:
➢ Repaired Installation.
➢ Removed and Reinstalled Installation.
➢ Rebooted computer as last resort.

This appears to be a bug similar to https://github.com/pypa/pip/issues/4588 

However, unlike in that bug report, pip hangs after all of these commands:
• pip list
• pip install
• pip install --upgrade pip

However, when called using “py -m pip”, these commands do not hang, and, upon 
inspection of the package list, via “pip list” and “py -m pip list” methods, 
there is a discrepancy. This is the culprit, but I don’t know how to fix the 
problem. Output:

• PS C:\Users\Ryan> py -V
Python 3.7.0

• PS C:\Users\Ryan> pip list
Package Version
--- ---
Click   7.0
mysqlclient 1.3.13
pip 18.0
pip-tools   3.0.0
setuptools  40.4.3
six 1.11.0

• PS C:\Users\Ryan> py -m pip list
Package    Version
-- ---
pip    18.0
setuptools 40.4.3

Notice the package lists are different. The outputs above are from the exact 
same pip executable:

• PS C:\Users\Ryan> pip -V
pip 18.0 from 
c:\users\ryan\appdata\local\programs\python\python37\lib\site-packages\pip 
(python 3.7)

• PS C:\Users\Ryan> py -m pip -V
pip 18.0 from 
C:\Users\Ryan\AppData\Local\Programs\Python\Python37\lib\site-packages\pip 
(python 3.7)

I have another machine running Python 3.7.0 x64 that does not experience this 
issue.

Both machines have the same set-up:
➢ Python 3.7.0 from x64 installer (local user install, not All Users install, 
with PATH option checked. pip runs directly in terminal.)
➢ Python 3.6.6 from Visual Studio 2017 installer (pip does not run unless 
called from py -m pip or py -3.6 m pip)
➢ Anaconda from installer (not used yet)
➢ MySQL Connector Python 8.0.12 from MySQL Installer (only installs for Python 
3.6.6, not compatible with Python 3.7.0)
➢ Cygwin
➢ MinGW/MSYS

I have exhausted all online help documentation, and none of the bug reports 
contain answers that explain why one computer fails while the other does not.

Further testing reveals more bugs:

This bug does not affect the older Python 3.6.6 pip on either machine:

• py -3.6 -m pip -V
pip 10.0.1 from < blah path to Python36_64 package dir >

• py -3.6 -m pip install matplotlib
MySQL-connector-python 8.0.12 requires protobuf>=3.0.0, which is not installed.

The installation [also] fails, but at least it doesn’t hang.
However it is not possible to install protobuf, as this also fails:

• py -3.6 -m pip install protobuf
Could not install packages due to an EnvironmentError: [Errno 13] Permission 
denied: C:\\ ….. \\six.py

And it cannot upgrade:

• py -3.6 -m pip install --upgrade pip
Could not install packages due to an EnvironmentError: [WinError 5] Access is 
denied: ‘c:\\program...\\...\\pip-10.0.1.dist-info\\entry_points.txt’
Consider using the `--user` option or check the permissions.

Used the suggestion, which looked more like a warning:

• Py -3.6 -m pip install --upgrade pip --user
Successfully installed

Permission denied is a bad excuse to fail, when a command line argument can 
change this. I do not like adding command line switches to something that 
should work without them (since I specifically call this user-specific resource 
in the command statement), because there is no telling what the application 
will do from a black-box engineering viewpoint. This error message / hint 
should be more elaborate, explaining what the switch does, as it is 
counterintuitive for anyone familiar with Linux to believe for one second that 
“--user” is supposed get around a “permission denied” problem by elevating 
permissions, after years of telling users they need to use “sudo” to run 
something as root. This is an advantage for the ignorant coder. If ignorance is 
an advantage, then that just means the error message is not explanative enough. 
Requiring users to glean the meaning of “—user” from the “—help” option wastes 
time and mental resources by adding another layer of complexity to the 
installation process. It is not obvious that there is a “–help” option for “pip 
install” (hence the waste of time).

Other bug encountered recently:

Also, there is a bug that I reported approximately a week ago with the 
mysqlclient package installer, in which an install 

[issue29143] Logger should ignore propagate property for disabled handlers.

2018-10-04 Thread Oleg Serov


Oleg Serov  added the comment:

I tried and failed to reproduce. If it changes, I'll update it.

--

___
Python tracker 

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



[issue18291] codecs.open interprets FS, RS, GS as line ends

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Attached is a rough patch that tries to fix this problem.  I changed the 
behavior in that unicode char 0x2028 is no longer treated as a line separator.  
It would be trival to change the regex to support that too, if we want to 
preserve backwards compatibility.  Personally, I think readlines() on a codecs 
reader should do that same line splitting as an 'io' file.

If we want to use the patch, the following must yet be done: write tests that 
check the splitting on FS, RS, and GS characters.  Write a news entry.  I 
didn't do any profiling to see what the performance effect of my change is so 
that should be checked too.

--
Added file: https://bugs.python.org/file47851/codecs_splitlines.txt

___
Python tracker 

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



[issue34900] unittest subTests() fails when called from debug()

2018-10-04 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34897] distutils test errors when CXX is not set

2018-10-04 Thread Michael Felt


Change by Michael Felt :


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

___
Python tracker 

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



[issue18291] codecs.open interprets FS, RS, GS as line ends

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I think one bug here is that codecs readers use str.splitlines() internally.  
The splitlines method treats a bunch of different characters as line 
separators, unlike io..readlines().  So, you end up with different 
behavior between doing iter(codecs.getreader(...)) and iter(io.open(...)).

We can argue if str.splitlines() is doing the correct thing, see the table here:
https://docs.python.org/3.8/library/stdtypes.html#str.splitlines

However, it seems clearer to me that readlines() on a codecs reader and on a 
file object should really be splitting lines on the same characters.

--
nosy: +nascheme
versions:  -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue30825] csv.Sniffer does not detect lineterminator

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

There is another issue related to this.  If you use codecs to get a reader, it 
uses str.splitlines() internally, which treats a bunch of different characters 
as line terminators.  See issue #18291 and:

https://docs.python.org/3.8/library/stdtypes.html#str.splitlines

I was thinking about different ways to fix this.  First, the csv module 
suggests you pass newline='' to the file object.  I suspect most people don't 
know to do that.  So, I thought maybe the csv module should inspect the file 
object that gets passed in and then warn if newline='' has not been used or if 
the file is a codecs reader object.

However, that seems fairly complicated.  Would it be better if we changed the 
'csv' module to do its own line splitting?  I think that would be better 
although I'm not sure about backwards compatibly.  Currently, the reader 
expects to call iter() on the input file.  Would it be okay if it used the 
'read' method of it in preference to using iter()?  It could still fallback to 
iter() if there was no read method.

--
nosy: +nascheme

___
Python tracker 

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



[issue34867] Add mode to disable small integer and interned string caches

2018-10-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

The intent is to use only enable this during testing / continuous integration.

--

___
Python tracker 

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



[issue34900] unittest subTests() fails when called from debug()

2018-10-04 Thread Bruno Oliveira


Change by Bruno Oliveira :


--
type:  -> crash

___
Python tracker 

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



[issue34900] unittest subTests() fails when called from debug()

2018-10-04 Thread Bruno Oliveira


New submission from Bruno Oliveira :

Consider this code:

import unittest


class TC(unittest.TestCase):

def test_subtest(self):
with self.subTest():
pass


tc = TC('test_subtest')
tc.run()

This works when executed, but if we change ``tc.run()`` to ``tc.debug()`` we 
get the following exception:

Traceback (most recent call last):
  File ".tmp\test-unittest-regression.py", line 13, in 
tc.debug()
  File 
"C:\Users\Bruno\AppData\Local\Programs\Python\Python36\lib\unittest\case.py", 
line 658, in debug
getattr(self, self._testMethodName)()
  File ".tmp\test-unittest-regression.py", line 7, in test_subtest
with self.subTest():
  File 
"C:\Users\Bruno\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 
81, in __enter__
return next(self.gen)
  File 
"C:\Users\Bruno\AppData\Local\Programs\Python\Python36\lib\unittest\case.py", 
line 512, in subTest
if not self._outcome.result_supports_subtests:
AttributeError: 'NoneType' object has no attribute 
'result_supports_subtests'

Looking at the code, ``subTest`` assumes that the ``TestCase`` instance has the 
``self._outcome`` atribute, which is set only by ``run()``.

--
components: Library (Lib)
messages: 327092
nosy: Bruno Oliveira
priority: normal
severity: normal
status: open
title: unittest subTests() fails when called from debug()
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-04 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue34899] Possible assertion failure due to int_from_bytes_impl()

2018-10-04 Thread Zackery Spytz


New submission from Zackery Spytz :

If _PyLong_FromByteArray() fails in int_from_bytes_impl(), 
PyObject_CallFunctionObjArgs() might be called with a live exception.

--
components: Interpreter Core
messages: 327091
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: Possible assertion failure due to int_from_bytes_impl()
type: crash
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue21880] IDLE: Ability to run 3rd party code checkers

2018-10-04 Thread Tal Einat


Tal Einat  added the comment:

It's unfortunate that this has gone dormant for so long. Is anyone interested 
in picking this up? I'd be happy to provide guidance and feedback.

--
nosy: +taleinat

___
Python tracker 

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



[issue34898] add mtime argument to gzip.compress

2018-10-04 Thread Guo Ci Teo


Change by Guo Ci Teo :


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

___
Python tracker 

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



[issue34898] add mtime argument to gzip.compress

2018-10-04 Thread Guo Ci Teo


New submission from Guo Ci Teo :

With the `mtime` argument, the output from `gzip.compress` can be reproducible.

--
components: Library (Lib)
messages: 327088
nosy: guoci
priority: normal
severity: normal
status: open
title: add mtime argument to gzip.compress
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue26005] Denial of Service in SimpleHTTPServer and BaseHTTPServer

2018-10-04 Thread Martin Panter


Martin Panter  added the comment:

Issue 34576 was recently opened about adding a security warning.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> [EASY doc] http.server, SimpleHTTPServer: warn users on security

___
Python tracker 

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



[issue34576] [EASY doc] http.server, SimpleHTTPServer: warn users on security

2018-10-04 Thread Martin Panter


Martin Panter  added the comment:

FYI Senthil made an earlier suggestion for wording at 


--
nosy: +martin.panter

___
Python tracker 

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



[issue34041] add *deterministic* parameter to sqlite3.Connection.create_function()

2018-10-04 Thread rian


rian  added the comment:

Any possible way we can backport these changes to Python 3.5+? 3.8 is a ways 
away.

--
nosy: +rian

___
Python tracker 

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



[issue34801] codecs.getreader() splits lines containing control characters

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue18291.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> codecs.open interprets FS, RS, GS as line ends

___
Python tracker 

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



[issue34801] codecs.getreader() splits lines containing control characters

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Perhaps the 'csv' module should do some sanity checking on the file passed to 
the reader.  The docs recommend that newline='' be used to open the file.  
Maybe 'csv' could check that and warn if its not the case.  I poked around but 
it seems like io files don't have a handy property to check for that.  Further, 
maybe 'csv' could check if the file is a codecs.StreamReader object.  In that 
case, there is no way to turn off the extra newline characters and so that's 
probably a bug.

--

___
Python tracker 

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



[issue34897] distutils test errors when CXX is not set

2018-10-04 Thread Michael Felt


New submission from Michael Felt :

while researching issue11191 I cam across 6 additional errors.

There is a test in Lib/test/support/__init__.py

def missing_compiler_executable(cmd_names=[]):
"""Check if the compiler components used to build the interpreter exist.

Check for the existence of the compiler executables whose names are listed
in 'cmd_names' or all the compiler executables when 'cmd_names' is empty
and return the first missing executable or None when none is found
missing.

"""
from distutils import ccompiler, sysconfig, spawn
compiler = ccompiler.new_compiler()
sysconfig.customize_compiler(compiler)
for name in compiler.executables:
if cmd_names and name not in cmd_names:
continue
cmd = getattr(compiler, name)
if cmd_names:
assert cmd is not None, \
"the '%s' executable is not configured" % name
elif cmd is None:
continue
if spawn.find_executable(cmd[0]) is None:
return cmd[0]

The "elif cmd is None:" is not successful because cmd maybe '' (null string)

Initially I thought to change to
"elif cmd is None or (not cmd):" but I hope I found a better resolution!

In: Lib/distutils/sysconfig.py the final bits of customize_compiler is:

compiler.set_executables(
preprocessor=cpp,
compiler=cc_cmd,
compiler_so=cc_cmd + ' ' + ccshared,
compiler_cxx=cxx,
linker_so=ldshared,
linker_exe=cc,
archiver=archiver)

the value for cxx come from os.environ, if set, otherwise it comes from 
get_sys_vars()

(cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) 
= \
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 
'ARFLAGS')

If, during the build, CXX was not set - this sets cxx to the null string ('').

So the fix is to assign cxx = None when len(cxx) == 0

if 'CXX' in os.environ:
cxx = os.environ['CXX']
if not len(cxx):
cxx = None

While this only seems to happen for cxx - maybe this should be extended to all 
the variables in (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, 
ar_flags)?

So, ultimately - I choose to go with changing : compiler.set_executables()

diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index b71d1d39bc..2e08c4abd2 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -148,7 +148,7 @@ class CCompiler:
 if key not in self.executables:
 raise ValueError("unknown executable '%s' for class %s" %
   (key, self.__class__.__name__))
-self.set_executable(key, kwargs[key])
+self.set_executable(key, kwargs[key] if len(kwargs[key]) else None)

 def set_executable(self, key, value):
 if isinstance(value, str):



Was:
==
ERROR: test_run (distutils.tests.test_build_clib.BuildCLibTestCase)
--
Traceback (most recent call last):
  File 
"/data/prj/python/git/python3-3.8/Lib/distutils/tests/test_build_clib.py", line 
121, in test_run
ccmd = missing_compiler_executable()
  File "/data/prj/python/git/python3-3.8/Lib/test/support/__init__.py", line 
2730, in missing_compiler_executable
if spawn.find_executable(cmd[0]) is None:
IndexError: list index out of range

==
ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
--
Traceback (most recent call last):
  File 
"/data/prj/python/git/python3-3.8/Lib/distutils/tests/test_build_ext.py", line 
62, in test_build_ext
cmd = support.missing_compiler_executable()
  File "/data/prj/python/git/python3-3.8/Lib/test/support/__init__.py", line 
2730, in missing_compiler_executable
if spawn.find_executable(cmd[0]) is None:
IndexError: list index out of range

==
ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
--
Traceback (most recent call last):
  File 
"/data/prj/python/git/python3-3.8/Lib/distutils/tests/test_build_ext.py", line 
308, in test_get_outputs
cmd = support.missing_compiler_executable()
  File "/data/prj/python/git/python3-3.8/Lib/test/support/__init__.py", line 
2730, in missing_compiler_executable
if spawn.find_executable(cmd[0]) is None:
IndexError: list index out of range

==
ERROR: test_build_ext (distutils.tests.test_build_ext.ParallelBuildExtTestCase)

[issue34801] codecs.getreader() splits lines containing control characters

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Thank you for the research. The problem is indeed that \v is getting treated as 
a line separator.  That is an intentional design choice, see:

https://bugs.python.org/issue12855

It would seem to have some surprising implications for CSV parsing.  E.g. if 
someone embeds a \v character in a quoted field, parsing the file using 
codecs.getreader() will cause the field to be split across two rows.

Someone else has run into the same issue:

https://www.enigma.com/blog/the-secret-world-of-newline-characters

I'm not sure anything should be done.  Perhaps we should do something to reduce 
that chances that people trip over this issue.  E.g. if I want to parse a file 
containing Unicode text with the CSV module, how do I do it while allowing \v 
characters (or other new-line like characters other than \n) within fields?

--

___
Python tracker 

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



[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-10-04 Thread Steve Dower


Steve Dower  added the comment:

Reading the docs, I'm pretty sure we need a new Py_SetProgramFullPath() 
function. Py_SetProgramName explicitly is only providing a hint to figure out 
the file containing the executable, and I really want this to make my new 
launcher feasible: https://github.com/zooba/cpython/blob/msix/Programs/launch.c

Victor - I've tried for an hour now and I can't figure out where to put this 
value in all the new configuration stuff. I'm finding it *very* convoluted, 
with so much copying of config structs and then back-and-forth copying certain 
values around. Some guidance would be great.

--

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Turn the check on only when PYTHONDEVMODE is set?

This will reduce the value of this warning to zero. If the user doesn't know 
that using "is" with string or numerical literals is bad and doesn't use 
checkers, it is unlikely that he uses PYTHONDEVMODE.

--

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-04 Thread Pranav Devarakonda


Pranav Devarakonda  added the comment:

Thanks Karthikeyan

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Tim Peters


Tim Peters  added the comment:

>> people already wrote substantial test suites dedicated
>> to that sole purpose, and we should aim to be "mere
>> consumers" of functions that pass _those_ tests.

> There are hash functions that pass those tests which
> are still bad in practice when used as tuple hash function.

Really?  Which one(s)?  If you're talking about that some fail badly when you 
_replace_ the constants they picked, I doubt they'd accept that as proof of 
anything.  Things like FNV and DJB score poorly on SMHasher to begin with.


> That's really unfortunate, but it's a fact that we need
> to live with.

I'm surprised they do as well as they do using less than a handful of 
invertible transformations per input, using state of the same bit width as the 
inputs.

I don't expect them to be immune to all easily-provoked "worse than random" 
cases, though.  Over time, these hashes change while keeping the same name.  As 
noted before, this is at least the second version of SeaHash.  The best of the 
original algorithms of this kind - murmurhash - is on its 3rd version now.

The motivation is the same:  someone bumps into real-life cases where they do 
_way way way_ worse than "random", and so they try to repair that as cheaply as 
possible.

Most of these are designed for data centers to do cheap-as-possible reasonably 
robust fingerprinting of giant data blobs.  They could already have used, e.g., 
SHA-2 for highly robust fingerprinting, but they don't want to pay the very 
much higher runtime cost.

If you can provoke any deviation from randomness in that kind of hash, it's 
considered "broken" and is never used again.  But in these far cheaper hashes, 
it's considered part of the tradeoffs.  If you read the Reddit thread about 
SeaHash I cited before, the person who suggested the current transformations 
noted that there were still weaknesses in some areas of the input space he was 
able to find just by thinking about how it worked, but far milder than the 
weaknesses he found by thinking about how the original version worked.

That doesn't imply there aren't far worse weaknesses in areas he _didn't_ think 
about.  So it goes.

> It means that we may need to do some adjustments to
> the hash functions.

I'm fine with the faithful (barring errors on my part) xxHash I posted here 
before.  And I don't care whether it works "better" or "worse" on Python's tiny 
test suite if its constants are replaced, or its algorithm is "tweaked".  When 
xxHash version 2 is released, I want it to be as mindless as possible to 
replace the guts of Python's tuple-hash loop with the guts of xxHash version 2.

It's easy to believe that SMHasher has nothing testing the bit patterns 
produced by mixing two's-complement integers of similar magnitude but opposite 
signs.  That's not the kind of data giant data centers are likely to have much 
of ;-)  If Appleby can be talked into _adding_ that kind of keyset data to 
SMHasher, then the next generations of these hashes will deal with it for us.  
But an objectively small number of collisions more than expected in some such 
cases now doesn't annoy me enough to want to bother.

--

___
Python tracker 

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



[issue34844] logging.Formatter enhancement - Checking on style and fmt fields

2018-10-04 Thread Luna Chen


Change by Luna Chen :


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

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread Yury Selivanov


Yury Selivanov  added the comment:

Thank you Inada-san for taking care of this.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 476c294f260ebe1b44157a168c3dfa4a43724ce3 by Yury Selivanov (Miss 
Islington (bot)) in branch '3.7':
bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (#9701)
https://github.com/python/cpython/commit/476c294f260ebe1b44157a168c3dfa4a43724ce3


--

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 70a083bc46aea84e3b3ffca2c10c295917a98fec by Yury Selivanov (Miss 
Islington (bot)) in branch '3.6':
bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (GH-9702)
https://github.com/python/cpython/commit/70a083bc46aea84e3b3ffca2c10c295917a98fec


--

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

> The problem with a SyntaxWarning is that the wrong people will see it. It 
> gets in the way of users of applications that happen to be written in Python.

Turn the check on only when PYTHONDEVMODE is set?  Seems like it solves the 
issue with the wrong people seeing the warning.

--
nosy: +nascheme

___
Python tracker 

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



[issue34867] Add mode to disable small integer and interned string caches

2018-10-04 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Woudn't turning these off hurt performance a lot?  If so, I don't know if 
people would actually use such a mode.  Then it becomes pretty useless.  Could 
we combine this idea with the PYTHONDEVMODE flag?  If PYTHONDEVMODE is turned 
on, we could do a check like Serhiy suggests for inappropriate 'is' 
comparisons.  That seems more useful to me.

--
nosy: +nascheme

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Ah, sorry I totally forgot about dict fixer. Thanks for the details. I would 
wait for Benjamin's call on this.

Thanks

--

___
Python tracker 

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



[issue34801] codecs.getreader() splits lines containing control characters

2018-10-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

codecs.getreader('utf-8')(open('test.txt', 'rb')) during iteration 
str.splitlines on the decoded data that takes '\x0b' as a valid newline as 
specified in [0] being a superset of universal newlines. Thus splits on '\x0b' 
as a valid newline for string and works correctly.

./python.exe
Python 3.8.0a0 (heads/master:6f85b826b5, Oct  4 2018, 22:44:36)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'first line\x0b\x0bblah blah\nsecond line\n' # returned by 
>>> codecs.getreader()
>>> a.splitlines(keepends=True)
['first line\x0b', '\x0b', 'blah blah\n', 'second line\n']

# for bytes bytes.splitlines works only on universal-newlines thus doesn't 
split on '\x0b' [1]
>>> b = b'first line\x0b\x0bblah blah\nsecond line\n' 
>>> b.splitlines(keepends=True)
[b'first line\x0b\x0bblah blah\n', b'second line\n']


But io.TextIOWrapper only accepts None, '', '\n', '\r\n' and '\r' as newline 
for text mode but for binary files it's different as noted in readline to 
accept only '\n' [2]

> The line terminator is always b'\n' for binary files; for text
> files, the newlines argument to open can be used to select the line
> terminator(s) recognized.

Thus 'first line\x0b\x0bblah blah\nsecond line\n' gives ['first 
line\x0b\x0bblah blah\n', 'second line\n'] . Trying to use '\x0b' as new line 
results in illegal newline error in TextIOWrapper.

Hope I am correct on the above analysis.

[0] https://docs.python.org/3.8/library/stdtypes.html#str.splitlines
[1] https://docs.python.org/3.8/library/stdtypes.html#bytes.splitlines
[2] https://docs.python.org/3/library/io.html#io.TextIOBase.readline

--
nosy: +xtreak

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-04 Thread Pranav Devarakonda


Pranav Devarakonda  added the comment:

Thanks for taking time and updating this, Karthikeyan Singaravelan. I do agree 
that there there is no proper way to find out if an object is of type socket or 
not. 

However other fixers in lib2to3 are not any different. For example the 
fix_dict.py changes every instance of viewkeys() method to keys() irrespective 
of the type of the object. And I guess that applies to all other fixers in 
lib2to3 as well. So that convinced me that a fix for this can also be 
accommodated.

A compromise that we could foster, as I already mentioned is to make this fix 
explicit so users can use this only if they need it. Please find attached the 
fixer I wrote. I haven't made a PR yet.

--
Added file: https://bugs.python.org/file47850/fix_socket_send_recv.py

___
Python tracker 

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



Re: Calling an instance method defined without any 'self' parameter

2018-10-04 Thread Ibrahim Dalal
On Thu, Oct 4, 2018 at 10:20 PM Thomas Jollans  wrote:

> On 2018-10-04 10:25, Ibrahim Dalal wrote:
> > class A:
> > def foo():
> > print 'Hello, world!'
> >
> > a = A()print A.foo   # print a.foo   #
> > >print
> > type(A.foo) # 
> > a.foo()   # TypeError: foo() takes no arguments (1 given)
> > A.foo()   # TypeError: unbound method foo() must be called
> > with A instance as first argument (got nothing instead)
> >
>
> There is a way in Python 2 as well, and I'm sure someone else will
> demonstrate. I won't. It's easy enough to discover if you know that it
> should exist. I'll just tell you that Python 3 is much nicer:
>

Thought a little about it. A.__dict__['foo']() works! Thanks.


>
> Python 3 is much nicer.
>
> Cheers,
> Thomas
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Calling an instance method defined without any 'self' parameter

2018-10-04 Thread Bob van der Poel
On Thu, Oct 4, 2018 at 1:25 AM Ibrahim Dalal 
wrote:

> class A:
> def foo():
> print 'Hello, world!'
>
> a = A()print A.foo   # print a.foo   #
> >print
> type(A.foo) # 
> a.foo()   # TypeError: foo() takes no arguments (1 given)
> A.foo()   # TypeError: unbound method foo() must be called
> with A instance as first argument (got nothing instead)
>
>
> Clearly, foo is an instance method. I know one should use @staticmethod for
> declaring a method static. The question here is, given the above code, is
> there any way to call foo?
>
> Python 2.7
>
>
> Thanks,
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Use the magic of staticmethod :)

class A:
   @staticmethod
   def foo():
... do foo stuff


Hope this helps.

-- 

 Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW:   http://www.mellowood.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem

2018-10-04 Thread Terry Reedy

On 10/4/2018 6:05 AM, Rémy Dpx wrote:

Hello,
I’ve got a problem with my Python.


What OS?, What Python version?


Indeed my Idle act like if my ctrl button were always pushed ( when i press Q, 
it selects everything ;


On all built-in keysets, Control-Q is bound to 'close-all-windows', 
which is 'quit'.



when i press W, it goes back in the last form)


Control-W does not have this meaning in any built-in IDLE keyset.
Are you really using IDLE?


I tried to uninstall and download back and also to change the version, but my 
problem is still there.


Perhaps your keyboard or OS keyboard handler has a problem.

--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


[issue34896] Unable to install Python 3.5

2018-10-04 Thread Zachary Ware


Zachary Ware  added the comment:

According to the name of your log file, you're trying to install an old 
pre-release version (3.5.0rc3).  Try the latest version instead 
(https://www.python.org/ftp/python/3.5.4/python-3.5.4-amd64-webinstall.exe).  

Since 3.5 is in security-fix-only mode and no more binary releases will be 
made, changes to the installer are out of scope and so I'm closing the issue.  
I would also recommend updating to 3.6 or 3.7 if at all possible; 3.5.4 is a 
couple of security fixes behind at this point.

--
nosy: +zach.ware
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue34576] [EASY doc] http.server, SimpleHTTPServer: warn users on security

2018-10-04 Thread Prashant Sharma


Prashant Sharma  added the comment:

Should this change be done? If so, I would want to take up this issue.

--
nosy: +gutsytechster

___
Python tracker 

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



Re: Calling an instance method defined without any 'self' parameter

2018-10-04 Thread Terry Reedy

On 10/4/2018 4:25 AM, Ibrahim Dalal wrote:

class A:
 def foo():
 print 'Hello, world!'

a = A()print A.foo   # print a.foo   #
>print
type(A.foo) # 
a.foo()   # TypeError: foo() takes no arguments (1 given)
A.foo()   # TypeError: unbound method foo() must be called
with A instance as first argument (got nothing instead)


Clearly, foo is an instance method.


It is either a buggy instance method, missing the required first 
parameter, *or* a buggy static method, missing the decorator, making it 
appear to the interpreter as an instance method even though it it not.


 I know one should use @staticmethod for

declaring a method static. The question here is, given the above code, is
there any way to call foo?


Fix the bug, whichever deficiency you regard as the bug.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue34751] Hash collisions for tuples

2018-10-04 Thread Tim Peters


Change by Tim Peters :


--
components: +Interpreter Core -XML

___
Python tracker 

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



Re: Calling an instance method defined without any 'self' parameter

2018-10-04 Thread Thomas Jollans
On 2018-10-04 10:25, Ibrahim Dalal wrote:
> class A:
> def foo():
> print 'Hello, world!'
> 
> a = A()print A.foo   # print a.foo   #
> >print
> type(A.foo) # 
> a.foo()   # TypeError: foo() takes no arguments (1 given)
> A.foo()   # TypeError: unbound method foo() must be called
> with A instance as first argument (got nothing instead)
> 
> 
> Clearly, foo is an instance method. I know one should use @staticmethod for
> declaring a method static. The question here is, given the above code, is
> there any way to call foo?

Yes: use Python 3!

Python 3.7.0 (default, Jun 28 2018, 13:15:42)
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
... def foo():
... print('yo!')
...
>>> A.foo

>>> A.foo()
yo!
>>>


> 
> Python 2.7
> 

There is a way in Python 2 as well, and I'm sure someone else will
demonstrate. I won't. It's easy enough to discover if you know that it
should exist. I'll just tell you that Python 3 is much nicer:

Python 3 is much nicer.

Cheers,
Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34896] Unable to install Python 3.5

2018-10-04 Thread Ruchir Jha


New submission from Ruchir Jha :

Hi, I was trying to install Danjo to work on Python. However it was not working 
fine hence I uninstalled the version 3.5 which I installed and tried to install 
it again as the earlier version was used for Anaconda. However even after 
multiple attempts to install Python its throws and error 0x80070643 fatal error 
during python installation. I have restarted the system and have also cleared 
the cache. I am working under strict deaadline hence an urgent help will be 
highly appreciated

--
components: Installation
files: Python 3.5.0rc3 (64-bit)_20181004220550_000_core_JustForMe.log
messages: 327067
nosy: ruchirjha
priority: normal
severity: normal
status: open
title: Unable to install Python 3.5
type: crash
versions: Python 3.5
Added file: https://bugs.python.org/file47849/Python 3.5.0rc3 
(64-bit)_20181004220550_000_core_JustForMe.log

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9087

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9086

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread miss-islington


miss-islington  added the comment:


New changeset 6f85b826b527e240551613aeec3118a5469e3a33 by Miss Islington (bot) 
(INADA Naoki) in branch 'master':
bpo-34871: inspect: Don't pollute sys.modules (GH-9696)
https://github.com/python/cpython/commit/6f85b826b527e240551613aeec3118a5469e3a33


--

___
Python tracker 

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



[issue34895] Mark optional stdlib modules in documentation

2018-10-04 Thread Marcus


New submission from Marcus :

Some stdlib modules have external build time dependencies and will be 
automatically disabled if the dependencies can't be met (cf. detect_modules() 
in setup.py).
>From a user's perspective there is no reason to assume that the presence of a 
>stdlib module may not be relied upon. See also the discussion on python-ideas 
>(https://mail.python.org/pipermail/python-ideas/2018-October/054008.html).
A rather simple to implement debugging aid would be to add a note to the 
affected modules' documentation, stating that these modules may not be 
available on all systems.

--
assignee: docs@python
components: Documentation
messages: 327065
nosy: docs@python, of4tvziy
priority: normal
severity: normal
status: open
title: Mark optional stdlib modules in documentation
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. In my opinion it's difficult to handle this scenario and 
as far as I know 2to3 can only do syntax level changes with modular fixers for 
each case. Since Python is dynamic and there is no static type system available 
it's difficult to differentiate between a socket object and any other object 
that has the same API with send and recv methods like below : 

if foo():
s = Socket()
else:
s = AnotherSocketAPI()

Hence in this case s might be another object that might have the same interface 
like Socket expecting string for send and recv. Since there is no static typing 
in Python it depends on runtime introspection to get it right. I will wait for 
others opinion on this.

--
nosy: +xtreak

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Tim Peters


Tim Peters  added the comment:

>> In the 64-bit build there are no collisions across my
>> tests except for 11 in the new tuple test.

> That's pretty bad actually. With 64 bits, you statistically
> expect something in the order of 10**-8 collisions. So
> what you're seeing is 9 orders of magnitude too many collisions.

You wrote the test, so you should remember that you throw away the top 32 bits 
of the 64-bit hash code :-)  Tossing 345130 balls into 2**32 bins has an 
expected mean of 13.9 collisions and sdev 3.7.  11 collisions is fine.

If I change the test to retain all the hash bits in the 64-bit build, there are 
no collisions in the new tuple test.

If I change it again to retain only the high 32 hash bits, 27 collisions.  
Which is statistically suspect, but still universes away from "disaster" 
territory.

--
components: +XML -Interpreter Core

___
Python tracker 

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



[issue34776] Postponed annotations break inspection of dataclasses

2018-10-04 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Please note that postponed annotations only reveal a problem that we already 
> had if anybody used a string forward reference:

Yeah, makes sense. It's cool that the PR fixes string forward references as 
well.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Tim Peters


Tim Peters  added the comment:

> Note that I'm always considering parametrized
> versions of the hash functions that I'm testing.
> I'm replacing the fixed multiplier (all algorithms
> mentioned here have such a thing) by a random
> multiplier which is 3 mod 8.

I've explained before in some detail that this makes NO SENSE for SeaHash:  its 
multiplier was specially constructed to guarantee certain dispersion 
properties, to maximize the effectiveness of its "propagate right" step.

You already have my explanation about that, and a link to the original Reddit 
thread in which it was proposed (and eagerly accepted by SeaHash's primary 
author).  Also already explained that its multiplier appears to fail its design 
criteria at two specific bit positions.  Which I can repair, but I would do so 
not by changing Python's version, but by bringing it to SeaHash's author's 
attention.

OTOH, I haven't been able to find anything explaining why the xxHash authors 
picked what they picked.  But they certainly didn't have "random" in mind - 
nobody does.  You discovered for yourself by trying things that various 
properties make for bad multipliers, and people who work on these things "for 
real" knew that a long time ago.  They almost certainly know a great deal more 
that we haven't thought of at all.

--

___
Python tracker 

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



problem

2018-10-04 Thread Rémy Dpx
Hello,
I’ve got a problem with my Python.
Indeed my Idle act like if my ctrl button were always pushed ( when i press Q, 
it selects everything ; when i press W, it goes back in the last form)
I tried to uninstall and download back and also to change the version, but my 
problem is still there.
I hope u will give me a solution.
Thanks.
Rémy


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus
-- 
https://mail.python.org/mailman/listinfo/python-list


Calling an instance method defined without any 'self' parameter

2018-10-04 Thread Ibrahim Dalal
class A:
def foo():
print 'Hello, world!'

a = A()print A.foo   # print a.foo   #
>print
type(A.foo) # 
a.foo()   # TypeError: foo() takes no arguments (1 given)
A.foo()   # TypeError: unbound method foo() must be called
with A instance as first argument (got nothing instead)


Clearly, foo is an instance method. I know one should use @staticmethod for
declaring a method static. The question here is, given the above code, is
there any way to call foo?

Python 2.7


Thanks,
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34894] Unexpected error while unpickling lxml.etree.Element object

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a tracker for bugs in the C implementation of Python. lxml is not a 
part of the Python standard library. Use corresponded bug trackers for 
reporting bugs in third-party packages.

--
nosy: +serhiy.storchaka
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue34776] Postponed annotations break inspection of dataclasses

2018-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Yury, thanks for your patch. I'll review it soon.

Please note that postponed annotations only reveal a problem that we already 
had if anybody used a string forward reference:

>>> from dataclasses import dataclass
>>> from typing import get_type_hints
>>> class C:
...   pass
...
>>> @dataclass
... class D:
...   c: C
...
>>> @dataclass
... class E:
...   c: "C"
...
>>> get_type_hints(C.__init__)
{}
>>> get_type_hints(D.__init__)
{'c': , 'return': }
>>> get_type_hints(E.__init__)
Traceback (most recent call last):
...
NameError: name 'C' is not defined

--

___
Python tracker 

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



[issue34878] Lock Objects documentation bug

2018-10-04 Thread ulrich.stern


ulrich.stern  added the comment:

I still think the documentation should be changed, and an improved version 
would look more like your comment than what it looks now.  I assume to most 
people "owning" means exclusively holding the lock, and a particular thread can 
do this for Lock Objects.  For example, here what my #1 Google result for "lock 
ownership" 
(https://www.justsoftwaresolutions.co.uk/threading/locks-mutexes-semaphores.html)
 says:

> What it means to "own" a lock depends on the precise type of the lockable 
> object. For some lockable objects...  In other cases, the definition is more 
> fluid, and the ownership of the lock is more conceptual. In these cases, 
> ownership can be relinquished by a different thread or object than the thread 
> or object that acquired the lock.

In my opinion, the Python documentation currently takes the unusual point of 
view "a thread cannot 'own' a lock since it could be 'stolen' (released) by 
another thread."  And the Lock Objects documentation has no explanation for 
this view, which makes it possibly confusing.  Since multithreading is often 
tricky, documentation improvement seems worthwhile.  Happy to propose wording 
that incorporates our discussion if you are interested.

--

___
Python tracker 

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



[issue34890] Support functools.partial in inspect.is*function() checks

2018-10-04 Thread Yury Selivanov


Yury Selivanov  added the comment:

Feel free to work on the PR.  If we want to push this to 3.8 we should do that 
now and have enough time for it to be tested.

--

___
Python tracker 

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



[issue34890] Support functools.partial in inspect.is*function() checks

2018-10-04 Thread Yury Selivanov


Yury Selivanov  added the comment:

I think the fact that `inspect.isfunction` recognizes partials is a very strong 
argument to enable inspect.iscoroutinefunction to do so as well.  

This is a backwards incompatible change though, strictly speaking.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Taking an algorithm in wide use that's already known to get a top score on 
> SMHasher and fiddling it to make a "slight" improvement in one tiny Python 
> test doesn't make sense to me.

OK, I won't do that. The difference is not that much anyway (it increases the 
test success rate from about 85% to 90%)

--

___
Python tracker 

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



[issue34894] Unexpected error while unpickling lxml.etree.Element object

2018-10-04 Thread Marcin Raczyński

New submission from Marcin Raczyński :

If we use pickle.HIGHEST_PROTOCOL we can pickle lxml.etree.Element object but 
unpickling give us misleading error description:

>>> from lxml import etree
>>> import pickle
>>> import sys
sys.version
'2.7.15rc1 (default, Apr 15 2018, 21:51:34) \n[GCC 7.3.0]'
>>> etree.__version__
u'4.2.5'
>>> pickled = pickle.dumps(etree.Element('x'), protocol=pickle.HIGHEST_PROTOCOL)
>>> pickle.loads(pickled)
Traceback (most recent call last):
  File "", line 1, in 
pickle.loads(pickled)
  File "src/lxml/etree.pyx", line 1131, in lxml.etree._Element.__repr__
  File "src/lxml/etree.pyx", line 981, in lxml.etree._Element.tag.__get__
  File "src/lxml/apihelpers.pxi", line 19, in lxml.etree._assertValidNode
AssertionError: invalid Element proxy at 140260172089392


See also: https://bugs.launchpad.net/lxml/+bug/736708

--
components: Library (Lib)
messages: 327054
nosy: marc1nr
priority: normal
severity: normal
status: open
title: Unexpected error while unpickling lxml.etree.Element object
type: behavior
versions: Python 2.7

___
Python tracker 

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



Re: Help please installing Python on Windows 10

2018-10-04 Thread Sibylle Koczian

Am 03.10.2018 um 09:34 schrieb Timothy Cowell via Python-list:

Could I please ask for help installing Python on Windows 10 - I've tried twice 
(Version 3.7 for windows) selecting the install now option. After first attempt 
I uninstalled and tried again.

Each time it has put 4 items in the programs list from the windows start 
button, all under heading Python 3.7, but the first time they said 64 bit and 
the second time only 32 bit - I guess I must have clicked on different versions.

32 bit on a 64 bit PC and Windows version should work, 64 bit on 32 bit 
Windows probably not. So, if you kept your second attempt, that should 
be enough to start with.


Both times there was IDLE, Python 3.7, Manuals, and Module Docs. The last two 
of these worked when clicked on, but the first two just put up a small window 
of which first was white, and second was black, but I couldn't make them do 
anything.


IDLE and the Python shell both start with windows showing text like this:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 
bit (AMD64)] on win32

Type "copyright", "credits" or "license()" for more information.
>>>

Did you get something like this? In that case nothing was wrong, Python 
just waited for your commands. The manual contains a tutorial which 
starts using the interactive interpreter - try it out. If you don't get 
the results the tutorial predicts, come back here or subscribe to the 
tutor list:

Tutor maillist  -  tu...@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

If your "small windows" don't contain such a header, that really would 
look wrong. In that case: are they completely empty? Or what else? If 
they contain any text at all, can you copy and paste it into your 
answer? Please don't try to send a screenshot, the list won't accept it.


HTH
Sibylle





--
https://mail.python.org/mailman/listinfo/python-list


Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-04 Thread Chris Angelico
On Fri, Oct 5, 2018 at 12:47 AM Alister via Python-list
 wrote:
>
> On Thu, 04 Oct 2018 09:44:01 +0100, Tony van der Hoff wrote:
>
> > On 04/10/18 09:31, Alister via Python-list wrote:
> >> On Wed, 03 Oct 2018 09:43:07 -0700, Musatov wrote:
> >>
> >>> On Wednesday, October 3, 2018 at 11:12:43 AM UTC-5, Michael Torrie
> >>> wrote:
>  On 10/03/2018 09:26 AM, Musatov wrote:
> > I don't even know where to begin! (I'm reading the Dummies book)
> 
>  If you have no experience in computer programming, it's going to be a
>  steep learning curve.
> 
>  But your first step is to learn Python and how to write programs in
>  it.
>  That book and others will help with that.  You'll have to write lots
>  of simple programs unrelated to primes along the way that help you
>  understand programming concepts.
> 
>  If you already have experience in other languages, the task will be
>  easier.
> 
>  Computer programming is quite natural to some (small children seem to
>  get it much easier than us adults), but I've seen others struggle to
>  grasp the abstract concepts for years.
> 
>  Once you've grasped basic Python programming, you can return top the
>  original problem at hand.  Start by identifying the process or
>  algorithm that would find these primes. In other words, how would you
>  do it on pen and paper?  Computer programs are not magic.  They are
>  only expressions of human thinking. Often some very smart
>  mathematicians have come up with powerful algorithms (a step-by-step
>  process) to do these things,
>  and your job as a programmer is to turn this mathematical process
>  into a computer program using things like loops and Boolean logic.
>  How would you find these primes using your pen, paper, and
>  calculator?
> >>>
> >>> Literally, how I found them was taking a list of primes and checking
> >>> if the calculations with the lesser primes resulted in numbers also
> >>> further along on the list.
> >>>
> >>> Another way I guess would be to do the calculations then check if the
> >>> number is prime.
> >>
> >> That is exactly how you do it with in a program.
> >>
> >> create a loop & check to see if the target number can be divided by
> >> each possible divisor in turn .
> >> for large numbers this will take a large number of tests (hey that is
> >> why you have the computer do them, it is faster than you & does not get
> >> bored ;-) ) there are numerous tricks for speeding up this process once
> >> you have the basic working.
> >>
> >> start by testing small numbers & then use your real data once you have
> >> something that works
> >>
> >> as a starter a simple loop in python could be as follows
> >>
> >> for x in xrange(10):
> >>  print x
> >>
> >> once you have an outline of a program post it back here if things dont
> >> work as expected
> >>
> >>
> > Two lines, two errors! To save the noob a lot of head-scratching, that
> > should be:
> > for x in range(10):
> >
> > If you're running python 3, as you should do for any new project:
> >   print( x )
>
> perfectly legit python 2.7
> I probably should have considered writing python 3 compatible code but
> range operates differently on the 2 versions & would be a poor choice for
> python 2 when numbers get larger

For a loop with a print in it, I'd definitely just use range(). It'll
work on all versions, and long before you run into problems with the
RAM usage on Py2, you've spammed your terminal so much that you're
waiting for it :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2018-10-04 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +christian.heimes

___
Python tracker 

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



Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-04 Thread Alister via Python-list
On Thu, 04 Oct 2018 09:44:01 +0100, Tony van der Hoff wrote:

> On 04/10/18 09:31, Alister via Python-list wrote:
>> On Wed, 03 Oct 2018 09:43:07 -0700, Musatov wrote:
>> 
>>> On Wednesday, October 3, 2018 at 11:12:43 AM UTC-5, Michael Torrie
>>> wrote:
 On 10/03/2018 09:26 AM, Musatov wrote:
> I don't even know where to begin! (I'm reading the Dummies book)

 If you have no experience in computer programming, it's going to be a
 steep learning curve.

 But your first step is to learn Python and how to write programs in
 it.
 That book and others will help with that.  You'll have to write lots
 of simple programs unrelated to primes along the way that help you
 understand programming concepts.

 If you already have experience in other languages, the task will be
 easier.

 Computer programming is quite natural to some (small children seem to
 get it much easier than us adults), but I've seen others struggle to
 grasp the abstract concepts for years.

 Once you've grasped basic Python programming, you can return top the
 original problem at hand.  Start by identifying the process or
 algorithm that would find these primes. In other words, how would you
 do it on pen and paper?  Computer programs are not magic.  They are
 only expressions of human thinking. Often some very smart
 mathematicians have come up with powerful algorithms (a step-by-step
 process) to do these things,
 and your job as a programmer is to turn this mathematical process
 into a computer program using things like loops and Boolean logic.
 How would you find these primes using your pen, paper, and
 calculator?
>>>
>>> Literally, how I found them was taking a list of primes and checking
>>> if the calculations with the lesser primes resulted in numbers also
>>> further along on the list.
>>>
>>> Another way I guess would be to do the calculations then check if the
>>> number is prime.
>> 
>> That is exactly how you do it with in a program.
>> 
>> create a loop & check to see if the target number can be divided by
>> each possible divisor in turn .
>> for large numbers this will take a large number of tests (hey that is
>> why you have the computer do them, it is faster than you & does not get
>> bored ;-) ) there are numerous tricks for speeding up this process once
>> you have the basic working.
>> 
>> start by testing small numbers & then use your real data once you have
>> something that works
>> 
>> as a starter a simple loop in python could be as follows
>> 
>> for x in xrange(10):
>>  print x
>> 
>> once you have an outline of a program post it back here if things dont
>> work as expected
>> 
>> 
> Two lines, two errors! To save the noob a lot of head-scratching, that
> should be:
> for x in range(10):
> 
> If you're running python 3, as you should do for any new project:
>   print( x )

perfectly legit python 2.7
I probably should have considered writing python 3 compatible code but 
range operates differently on the 2 versions & would be a poor choice for 
python 2 when numbers get larger

ass for the head scratching a noob (& anyone else for that mater) far 
more from correcting code than they do from simply copy & pasting working 
code.




-- 
TAILFINS!! ... click ...
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-04 Thread Pranav Devarakonda


New submission from Pranav Devarakonda :

The send() method of the the Socket object in Python 3.x requires the data to 
be sent to be first converted into bytes(object) which was not the case with 
Python 2.x. The 2to3 tool doesn't handle this case and hence an explicit fixer 
would help many beginners learning the socket module(most tutorials regarding 
this online are in Python 2.x)

Similarly the fixer can change the recv() method by converting the returned 
bytes object back to a str object.
For example, consider the following lines in Python 2.x, (for demonstration 
only)

s.send("Foo") #where 's' is a socket object
data = s.recv(1024)

After the 2to3 fixer has been applied the above lines will change to,

s.send(str.encode("Foo"))
data = s.recv(1024).decode("utf-8")

PS: I am a beginner in open source so any changes or suggestions are welcome.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 327053
nosy: benjamin.peterson, devarakondapranav
priority: normal
severity: normal
status: open
title: Add 2to3 fixer to change send and recv methods of socket object.
type: enhancement

___
Python tracker 

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



[issue34892] persistence of attributes with new instance

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is how default values work in Python.

See the FAQ question: 
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue34892] persistence of attributes with new instance

2018-10-04 Thread Florian Michaux


New submission from Florian Michaux :

Hello,

I don't know what's going on.
When using a for loop over multiple same instance creation, i got persistence 
with instance attributes

Code example in attachement.

--
components: Interpreter Core
files: buggyclass.py
messages: 327051
nosy: Florian Michaux
priority: normal
severity: normal
status: open
title: persistence of attributes with new instance
versions: Python 2.7, Python 3.7
Added file: https://bugs.python.org/file47848/buggyclass.py

___
Python tracker 

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



[issue27165] Skip callables when displaying exception fields in cgitb

2018-10-04 Thread Adam Bielański

Change by Adam Bielański :


--
pull_requests: +9085

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread miss-islington


miss-islington  added the comment:


New changeset c57eb9a336391dc22aa29e9db592fa06d7fb7101 by Miss Islington (bot) 
(Chih-Hsuan Yen) in branch 'master':
bpo-34871: Fix two typos in test_inspect.py (GH-9698)
https://github.com/python/cpython/commit/c57eb9a336391dc22aa29e9db592fa06d7fb7101


--
nosy: +miss-islington

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
pull_requests: +9084

___
Python tracker 

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



[issue34891] Multi-processing example inaccurate warning

2018-10-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Are you referring to the below warning?

> Functionality within this package requires that the __main__ module be 
> importable by the children. This is covered in Programming guidelines however 
> it is worth pointing out here. This means that some examples, such as the 
> multiprocessing.pool.Pool examples will not work in the interactive 
> interpreter. For example:

I tried the example and it throws the AttributeError as shown in the example in 
Linux and MacOS. Maybe I am wrong on the above. Can you please add in the 
specific example that is shown as not executable from the interpreter but 
actually works?

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue27165] Skip callables when displaying exception fields in cgitb

2018-10-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue33331] Clean modules in the reversed order

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

While this change fixes issue33328, it doesn't help with the similar issue13044 
which is more complex. Still I think there is a value of wiping modules in such 
order.

--

___
Python tracker 

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



[issue11191] test_search_cpp error on AIX (with xlc)

2018-10-04 Thread Michael Felt


Michael Felt  added the comment:

The current PR8709 resolves two issues, not one - so will create a new issue 
for the second element.

Am also shorting the NEWS text, with the expanded explanation here as:

* skip the distutils test 'test_search_cpp' when not gcc as compiler
  because not all compilers, e.g. IBM xlc et al do not support
  redirected stdout when using the argument -E (aka cpp_preprocessing)
  while gcc is know to support the pair -E -o outputfile

The additional find while researching this issue:
* add the argument '-C' for AIX xlc cpp processing so comments are
included in the cpp output rather than replaced by a single ' ' (space) 
char.

--

___
Python tracker 

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



[issue34891] Multi-processing example inaccurate warning

2018-10-04 Thread Anthony Flury


New submission from Anthony Flury :

On the Multi-processing page 
 (just above the 
reference section) there is a warning that the examples wont work from the 
interpreter.

This is not entirely accurate in that the examples do work, in the interpreter 
within Linux (and Mac OS I think), where the O/S supports processes being 
forked.

In fact it is only in Windows, where a brand new process needs to be started 
and the source is effectively re-imported is there an issue running the 
examples in the interpreter.

Should the documentation make this clearer ?

--
assignee: docs@python
components: Documentation
messages: 327046
nosy: anthony-flury, docs@python
priority: normal
severity: normal
status: open
title: Multi-processing example inaccurate warning
versions: Python 3.8

___
Python tracker 

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



[issue34871] test_site fails if run after test_inspect

2018-10-04 Thread INADA Naoki


Change by INADA Naoki :


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

___
Python tracker 

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



Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-04 Thread Tony van der Hoff
On 04/10/18 09:31, Alister via Python-list wrote:
> On Wed, 03 Oct 2018 09:43:07 -0700, Musatov wrote:
> 
>> On Wednesday, October 3, 2018 at 11:12:43 AM UTC-5, Michael Torrie
>> wrote:
>>> On 10/03/2018 09:26 AM, Musatov wrote:
 I don't even know where to begin! (I'm reading the Dummies book)
>>>
>>> If you have no experience in computer programming, it's going to be a
>>> steep learning curve.
>>>
>>> But your first step is to learn Python and how to write programs in it.
>>> That book and others will help with that.  You'll have to write lots of
>>> simple programs unrelated to primes along the way that help you
>>> understand programming concepts.
>>>
>>> If you already have experience in other languages, the task will be
>>> easier.
>>>
>>> Computer programming is quite natural to some (small children seem to
>>> get it much easier than us adults), but I've seen others struggle to
>>> grasp the abstract concepts for years.
>>>
>>> Once you've grasped basic Python programming, you can return top the
>>> original problem at hand.  Start by identifying the process or
>>> algorithm that would find these primes. In other words, how would you
>>> do it on pen and paper?  Computer programs are not magic.  They are
>>> only expressions of human thinking. Often some very smart
>>> mathematicians have come up with powerful algorithms (a step-by-step
>>> process) to do these things,
>>> and your job as a programmer is to turn this mathematical process into
>>> a computer program using things like loops and Boolean logic. How would
>>> you find these primes using your pen, paper, and calculator?
>>
>> Literally, how I found them was taking a list of primes and checking if
>> the calculations with the lesser primes resulted in numbers also further
>> along on the list.
>>
>> Another way I guess would be to do the calculations then check if the
>> number is prime.
> 
> That is exactly how you do it with in a program.
> 
> create a loop & check to see if the target number can be divided by each 
> possible divisor in turn
> .
> for large numbers this will take a large number of tests (hey that is why 
> you have the computer do them, it is faster than you & does not get 
> bored ;-) ) there are numerous tricks for speeding up this process once 
> you have the basic working.
> 
> start by testing small numbers & then use your real data once you have 
> something that works
> 
> as a starter a simple loop in python could be as follows
> 
> for x in xrange(10):
>   print x
> 
> once you have an outline of a program post it back here if things dont 
> work as expected
> 

Two lines, two errors! To save the noob a lot of head-scratching, that
should be:
for x in range(10):

If you're running python 3, as you should do for any new project:
print( x )



-- 
Tony van der Hoff| mailto:t...@vanderhoff.org
Buckinghamshire, England |
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-04 Thread Alister via Python-list
On Wed, 03 Oct 2018 09:43:07 -0700, Musatov wrote:

> On Wednesday, October 3, 2018 at 11:12:43 AM UTC-5, Michael Torrie
> wrote:
>> On 10/03/2018 09:26 AM, Musatov wrote:
>> > I don't even know where to begin! (I'm reading the Dummies book)
>> 
>> If you have no experience in computer programming, it's going to be a
>> steep learning curve.
>> 
>> But your first step is to learn Python and how to write programs in it.
>> That book and others will help with that.  You'll have to write lots of
>> simple programs unrelated to primes along the way that help you
>> understand programming concepts.
>> 
>> If you already have experience in other languages, the task will be
>> easier.
>> 
>> Computer programming is quite natural to some (small children seem to
>> get it much easier than us adults), but I've seen others struggle to
>> grasp the abstract concepts for years.
>> 
>> Once you've grasped basic Python programming, you can return top the
>> original problem at hand.  Start by identifying the process or
>> algorithm that would find these primes. In other words, how would you
>> do it on pen and paper?  Computer programs are not magic.  They are
>> only expressions of human thinking. Often some very smart
>> mathematicians have come up with powerful algorithms (a step-by-step
>> process) to do these things,
>> and your job as a programmer is to turn this mathematical process into
>> a computer program using things like loops and Boolean logic. How would
>> you find these primes using your pen, paper, and calculator?
> 
> Literally, how I found them was taking a list of primes and checking if
> the calculations with the lesser primes resulted in numbers also further
> along on the list.
> 
> Another way I guess would be to do the calculations then check if the
> number is prime.

That is exactly how you do it with in a program.

create a loop & check to see if the target number can be divided by each 
possible divisor in turn
.
for large numbers this will take a large number of tests (hey that is why 
you have the computer do them, it is faster than you & does not get 
bored ;-) ) there are numerous tricks for speeding up this process once 
you have the basic working.

start by testing small numbers & then use your real data once you have 
something that works

as a starter a simple loop in python could be as follows

for x in xrange(10):
print x

once you have an outline of a program post it back here if things dont 
work as expected



-- 
A narcissist is someone better looking than you are.
-- Gore Vidal
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34751] Hash collisions for tuples

2018-10-04 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> In the 64-bit build there are no collisions across my tests except for 11 in 
> the new tuple test.

That's pretty bad actually. With 64 bits, you statistically expect something in 
the order of 10**-8 collisions. So what you're seeing is 9 orders of magnitude 
too many collisions.

--

___
Python tracker 

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



[issue27165] Skip callables when displaying exception fields in cgitb

2018-10-04 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +9082
stage:  -> patch review

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Taking an algorithm in wide use that's already known to get a top score on 
> SMHasher and fiddling it to make a "slight" improvement in one tiny Python 
> test doesn't make sense to me.

What I'm doing is the most innocent change: just applying a fixed permutation 
on the *input* of the hash function. I'm not changing the actual hashing 
algorithm.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> people already wrote substantial test suites dedicated to that sole purpose, 
> and we should aim to be "mere consumers" of functions that pass _those_ tests.

There are hash functions that pass those tests which are still bad in practice 
when used as tuple hash function. That's really unfortunate, but it's a fact 
that we need to live with. It means that we may need to do some adjustments to 
the hash functions.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-04 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Note:  I'm assuming that by "PRIME32_2" you mean 2246822519U

Yes indeed.

> and that "MULTIPLIER" means 2654435761U.

No, I mean a randomly chosen multiplier which is 3 mod 8.

--

___
Python tracker 

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



[issue34739] Get rid of tp_getattro in xml.etree.ElementTree.XMLParser

2018-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue34740] Get rid of tp_getattro in ossaudiodev.oss_audio_device

2018-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue34740] Get rid of tp_getattro in ossaudiodev.oss_audio_device

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5f5a7781c8bf7bcc476d3e05d980711be3920724 by Serhiy Storchaka in 
branch 'master':
bpo-34740: Get rid of tp_getattro in ossaudiodev.oss_audio_device. (GH-9421)
https://github.com/python/cpython/commit/5f5a7781c8bf7bcc476d3e05d980711be3920724


--

___
Python tracker 

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



[issue34739] Get rid of tp_getattro in xml.etree.ElementTree.XMLParser

2018-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b2953fa3dda5898fcb0029792d9229f150e6e2cb by Serhiy Storchaka in 
branch 'master':
bpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420)
https://github.com/python/cpython/commit/b2953fa3dda5898fcb0029792d9229f150e6e2cb


--

___
Python tracker 

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



[issue34890] Support functools.partial in inspect.is*function() checks

2018-10-04 Thread Andrew Svetlov


New submission from Andrew Svetlov :

isfunction() processes both `isfunction(func)` and `isfunction(partial(func, 
arg))` correctly.

But `iscoroutinefunction()` misses this functionality.

We can implement it easy by adding a check for `isinstance(func, partial)` and 
applying a coroutine check for `func.func`.

Also, we can do the same for `isgeneratorfunction()` and `isasyncgenfunction()`.

The patch looks easy and straightforward.

Yuri, what do you think about?

--
components: Library (Lib)
messages: 327039
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Support functools.partial in inspect.is*function() checks
versions: Python 3.8

___
Python tracker 

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



  1   2   >