[issue35636] remove redundant code in unicode_hash(PyObject *self)

2019-01-01 Thread Ma Lin


Change by Ma Lin :


--
versions: +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



[issue35636] remove redundant code in unicode_hash(PyObject *self)

2019-01-01 Thread Ma Lin


Ma Lin  added the comment:

Every non-empty str will be checked twice at present.

--
components: +Interpreter Core
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



[issue35636] remove redundant code in unicode_hash(PyObject *self)

2019-01-01 Thread Ma Lin


Change by Ma Lin :


--
keywords: +patch, patch, patch
pull_requests: +10783, 10784, 10785
stage:  -> patch review

___
Python tracker 

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



[issue35636] remove redundant code in unicode_hash(PyObject *self)

2019-01-01 Thread Ma Lin


Change by Ma Lin :


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

___
Python tracker 

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



[issue35636] remove redundant code in unicode_hash(PyObject *self)

2019-01-01 Thread Ma Lin


Change by Ma Lin :


--
keywords: +patch, patch
pull_requests: +10783, 10784
stage:  -> patch review

___
Python tracker 

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



[issue35636] remove redundant code in unicode_hash(PyObject *self)

2019-01-01 Thread Ma Lin


New submission from Ma Lin :

Please see the PR

--
messages: 332857
nosy: Ma Lin
priority: normal
severity: normal
status: open
title: remove redundant code in unicode_hash(PyObject *self)

___
Python tracker 

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



[issue35623] Segfault in test_bigmem.ListTest.test_sort

2019-01-01 Thread miss-islington


miss-islington  added the comment:


New changeset a5955b0895aa011b0beff1ceb6539b2ff425 by Miss Islington (bot) 
in branch '3.7':
closes bpo-35623: Fix integer overflow when sorting large lists (GH-11380)
https://github.com/python/cpython/commit/a5955b0895aa011b0beff1ceb6539b2ff425


--
nosy: +miss-islington

___
Python tracker 

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



[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-01-01 Thread Stefan Seefeld


New submission from Stefan Seefeld :

This is an addendum to issue35621:

To be able to call `asyncio.create_subprocess_exec()` from another thread, A 
separate event loop needs to be created. To make the child watcher aware of 
this new loop, I have to call `asyncio.get_child_watcher().attach_loop(loop)`. 
However, in the current implementation this call needs to be made by the main 
thread (or else the `signal` module will complain as handlers may only be 
registered in the main thread).

So, to work around the above limitations, the following workflow needs to be 
used:

1) create a new loop in the main thread
2) attach it to the child watcher
3) spawn a worker thread
4) set the previously created event loop as default loop

After that, I can run `asyncio.create_subprocess_exec()` in the worker thread. 
However, I suppose the worker thread will be the only thread able to call that 
function, given the child watcher's limitation to a single loop.

Am I missing something ? Given the complexity of this, I would expect this to 
be better documented in the sections explaining how `asyncio.subprocess` and 
`threading` interact.

--
components: asyncio
messages: 332855
nosy: asvetlov, stefan, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.create_subprocess_exec() only works in main thread
type: behavior

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread miss-islington


miss-islington  added the comment:


New changeset 513fab2c67365e1693216dd59e4df0a5f6bfeb26 by Miss Islington (bot) 
in branch '3.7':
closes bpo-35630: Use code tag for 'python3' in 'README.rst' (GH-11394)
https://github.com/python/cpython/commit/513fab2c67365e1693216dd59e4df0a5f6bfeb26


--
nosy: +miss-islington

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset de66b8d498e47ed9d70607ac9b9f72468241da77 by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.6':
closes bpo-35630: Use code tag for 'python3' in 'README.rst' (GH-11400)
https://github.com/python/cpython/commit/de66b8d498e47ed9d70607ac9b9f72468241da77


--

___
Python tracker 

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



[issue35623] Segfault in test_bigmem.ListTest.test_sort

2019-01-01 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset f8b534477a2a51d85ea1663530f685f805f2b247 by Benjamin Peterson 
(sth) in branch 'master':
closes bpo-35623: Fix integer overflow when sorting large lists (GH-11380)
https://github.com/python/cpython/commit/f8b534477a2a51d85ea1663530f685f805f2b247


--
nosy: +benjamin.peterson
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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10779, 10780, 10781

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10779, 10780

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10777, 10778

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10777

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10778, 10779

___
Python tracker 

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



[issue35630] Missing code tag for "python3" in README.rst

2019-01-01 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 7e3fb40b923cb09ecc67816d3191197868593737 by Benjamin Peterson 
(Suriyaa ✌️️) in branch 'master':
closes bpo-35630: Use code tag for 'python3' in 'README.rst' (GH-11394)
https://github.com/python/cpython/commit/7e3fb40b923cb09ecc67816d3191197868593737


--
nosy: +benjamin.peterson
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



[issue35608] python3 multiprocessing queue deadlock when use thread and process at same time

2019-01-01 Thread beruhan


beruhan  added the comment:

I also tested on windows 10,it worked normally.But when I run it under 
ubuntu16.04,It will blocked.my python version is 3.6.5

--

___
Python tracker 

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



[issue35634] kwargs regression when there are multiple entries with the same key

2019-01-01 Thread iceboy


New submission from iceboy :

Using the multidict package on pypi to illustrate the problem.

Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multidict
>>> d = multidict.CIMultiDict([('a', 1), ('a', 2)])
>>> def foo(**kwargs): pass
... 
>>> foo(**d)
>>> foo(**{}, **d)

Python 3.6.7 (default, Oct 21 2018, 08:08:16) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multidict
>>> d = multidict.CIMultiDict([('a', 1), ('a', 2)])
>>> def foo(**kwargs): pass
... 
>>> foo(**d)
>>> foo(**{}, **d)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: foo() got multiple values for keyword argument 'a'

(1) foo(**d)
(2) foo(**{}, **d)

(1) works fine in both versions but (2) only works in Python 3.5 but raises 
TypeError in Python 3.6. This should be a regression. We should either make 
both expressions work or raises error.

--
messages: 332849
nosy: iceboy
priority: normal
severity: normal
status: open
title: kwargs regression when there are multiple entries with the same key
versions: Python 3.6

___
Python tracker 

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



[issue35577] side_effect mocked method lose reference to instance

2019-01-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Is there a problem with:

from unittest import mock

class SomeClass:
def do_something(self, x):
pass

def some_function(x):
obj = SomeClass()
y = obj.do_something(x)
return y

def do_something_side_effect(self, x):
print(self)
return x

def test_some_function():
with mock.patch.object(SomeClass, "do_something", do_something_side_effect):
assert some_function(1)

?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue35527] Make fields selectively immutable in dataclasses

2019-01-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi @rhettinger, this is similar to #33474.

I started working on an implementation of this.

With the implementation you propose, if a field has both init=True and 
frozen=True, it may be set after the creation of the instance:

@dataclass
class Person:
ssn: int = field(init=False, frozen=True)
name: str

p = Person(name='foo')
p.name = 'bar'
p.ssn = 1234

Wouldn't this conflict with the purpose of safe hashing?

I think it would need __setattr__ to be:

  def __setattr__(self, attr, value):
if attr in {'ssn', 'birth_city'}:
 raise TypeError(
 f'{attr!r} is not settable after initialization')
return super(cls, self).__setattr__(self, name, attr)

wouldn't it?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-01-01 Thread Stefan Seefeld


Change by Stefan Seefeld :


--
nosy: +stefan

___
Python tracker 

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



SCons 3.0.2 Release

2019-01-01 Thread Bill Deegan
  A new SCons release, 3.0.2, is now available on the SCons download page:

  https://scons.org/pages/download.html

  Here is a summary of the changes since 3.0.1:

  NEW FUNCTIONALITY

- Properly support versioned shared libraries for MacOS.  We've also
introduced two
  new env variables APPLELINK_CURRENT_VERSION and
APPLELINK_COMPATIBILITY_VERSION which will specify
  what is passed to the linkers -current_version and
-compatibility_version flags.  If not specified
  they will be derived from SHLIBVERSION as such:
  - APPLELINK_CURRENT_VERSION = SHLIBVERSION
  - APPLELINK_COMPATIBILITY_VERSION = all but the last digit in
SHLIBVERSION with .0 appended.
  Note that the values of the above will be validated. Valid format
for either APPLELINK variable is
  X[.Y[.Z]] where 0 <= X <= 65535, 0 <= Y <= 255, 0 <= Z <= 255.
- Add flag must_exist to SConscript() call to fail on missing script.
Not failing on missing script is now considered deprecated, and the
first instance will print a
deprecation message.
- Add xz compression format to packaging choices.
- Add Textfile/Substfile to default environment. (issue #3147)
- Added virtualenv support. A new function Virtualenv() determines
whether
SCons runs in a virtualenv. The search PATH may also be extended to
prefer executables from the current virtualenv over the ones
provided by
base environment. New option --enable-virtualenv provided to import
some
virtualenv-related variables to SCons and extend every
env['ENV']['PATH']
automatically. New option --ignore-virtualenv disables this. Two
environment variables, SCONS_ENABLE_VIRTUALENV and
SCONS_IGNORE_VIRTUALENV are supported for the same purpose.

  DEPRECATED FUNCTIONALITY

- Going forward calling SConscript on a non-existing SConscript file
will issue a warning.  Currently
  it will issue a deprecation notice.

  CHANGED/ENHANCED EXISTING FUNCTIONALITY

- Recognize new java 9, 10, 11 (as 9.0 and 10.0, 11.0)

  FIXES

- Fix issue #2980 with credit to Piotr Bartosik (and William Blevins).
This is an issue where using
 TimeStamp-MD5 Decider and CacheDir can yield incorrect md5's being
written into the .sconsign.
 The difference between Piotr Bartosik's patch and the current code
is that the more complicated
 creation of file to csig map is only done when the count of
children for the current node doesn't
 match the previous count which is loaded from the sconsign.


  Thanks to Bernard Blackham, William Deegan, Ray Donnelly, Andrew
Featherstone, Arda Fu,
  Philipp Maierhöfer,  Matthew Marinets, Fredrik Medley, Daniel Moody, Gary
Oberbrunner,
  Jonathon Reinhart, Zachary Tessler, Paweł Tomulik, Richard West, Mats
Wichmann, Bernhard M. Wiedemann,
  and Hao Wu for their contributions to this release.
  Contributors are listed alphabetically by their last name.

git shortlog --no-merges -ns 3.0.1..HEAD
   226  William Deegan
79  Daniel Moody
72  Mats Wichmann
17  Paweł Tomulik
16  Andrew Featherstone
 8  grbd
 7  maiphi
 6  Gary Oberbrunner
 6  Daniel
 4  Hao Wu
 3  Gabriel Russell
 2  MatthewMarinets
 2  Jonathon Reinhart
 2  ArdaFu
 1  Bernhard M. Wiedemann
 1  Isaac Pascual Monells
 1  Fredrik Medley
 1  Philipp Maierhoefer
 1  Piotr Kasprzyk
 1  Ray Donnelly
 1  Zachary Tessler
 1  cclauss
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: mouse click automation

2019-01-01 Thread Larry Martell
On Tue, Jan 1, 2019 at 12:10 PM Siddha 2305  wrote:
>
> Hello All,
>
> I am trying to write a script to emulate mouse clicks.
> The script launches Google chrome, navigates to the website. But after that 
> the script does not go to the specified coordinates.
>
> Also, I noticed that the screen coordinate is different every time I tried to 
> check it.
>
> Could someone please help me fix this?
>
> PS : I am a complete beginner and this is my first attempt at this
>
> from pynput.mouse import Button, Controller
>
> import webbrowser
>
> mouse = Controller()
>
> chromedir= 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
>
> webbrowser.get(chromedir).open("https://lnkd.in/fT4AKq8;)
>
> time.sleep(30) # to let the link load
>
> mouse.position = (43, 483) # everytime I tried to check the coordinates of 
> the pace I wanted to do a left click, it was different.
>
> mouse.click(Button.left, 1)

I have done this work both Selenium and Cypress. Check those out.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: mouse click automation

2019-01-01 Thread Brian Oney via Python-list
I am unfamiliar with pynput. I have had good experience with pyautogui. As your 
script isn't yet advanced, you may consider it.

https://pyautogui.readthedocs.io/en/latest/introduction.html
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35633] test_eintr fails on AIX since fcntl functions were modified

2019-01-01 Thread Michael Felt


New submission from Michael Felt :

test_eintr fails on AIX since fcntl functions were modified
In issue35189 the fnctl() module was modified so that the EINTR interruption 
should be retried automatically.

On AIX the test for flock() passes, but the test for lockf() fails:

 ==
> ERROR: test_lockf (__main__.FNTLEINTRTest)
> --
> Traceback (most recent call last):
>   File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", 
> line 522, in test_lockf
> self._lock(fcntl.lockf, "lockf")
>   File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", 
> line 507, in _lock
> lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
> PermissionError: [Errno 13] Permission denied
>

Researching...

--
components: IO, Tests
messages: 332846
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: test_eintr fails on AIX since fcntl functions were modified
type: behavior
versions: 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



[issue35632] support unparse for Suite ast

2019-01-01 Thread thautwarm


New submission from thautwarm :

Although `Suite` is not an actual AST used in CPython, it's quite useful when 
performing some code analysis. 

`Suite` is a sequence of statements which could be used to represent a block 
whose context inherits from outside block's.

Also, the document said it's useful in Jython.

I wonder if we could support `unparse` for Suite through making a tiny 
modification to

https://github.com/python/cpython/blob/master/Tools/parser/unparse.py

def _Suite(self, tree):
  for stmt in tree.body:
 self.dispatch(stmt)

--
components: Demos and Tools
messages: 332845
nosy: thautwarm
priority: normal
severity: normal
status: open
title: support unparse for Suite ast
type: enhancement
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



mouse click automation

2019-01-01 Thread Siddha 2305
Hello All,

I am trying to write a script to emulate mouse clicks.
The script launches Google chrome, navigates to the website. But after that the 
script does not go to the specified coordinates. 

Also, I noticed that the screen coordinate is different every time I tried to 
check it.

Could someone please help me fix this?

PS : I am a complete beginner and this is my first attempt at this

from pynput.mouse import Button, Controller

import webbrowser

mouse = Controller()

chromedir= 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'

webbrowser.get(chromedir).open("https://lnkd.in/fT4AKq8;)

time.sleep(30) # to let the link load

mouse.position = (43, 483) # everytime I tried to check the coordinates of the 
pace I wanted to do a left click, it was different.

mouse.click(Button.left, 1)



Thank you in advance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Python Humble Bundle from Packt

2019-01-01 Thread beliavsky--- via Python-list
For about the next two weeks, Humble Bundle 
https://www.humblebundle.com/books/python-packt-2019-books offers the following 
18 books and 7 videos on Python for $15.

BOOKS:

Python Interviews

OpenCV 3 Computer Vision with Python Cookbook

Mastering Flask Web Development

Python Automation Cookbook

Python Machine Learning By Example

Qt5 Python GUI Programming Cookbook.

Python Microservices Development

Hands-On Data Structures and Algorithms with Python

Python High Performance

Hands-On Software Engineering with Python

Django 2 by Example

Python Deep Learning Projects

Mastering Python Networking

Clean Code in Python

Modern Python Cookbook

Python 3 Object-Oriented Programming.

Raspberry Pi 3 Cookbook for Python Programmers

Django 2 Web Development Cookbook


VIDEOS:

Learn Python 3 from Scratch

Data Visualization with Python: The Complete Guide
 
REST APIs with Flask and Python
 
Data Analysis with Pandas and Python
 
Learn Python by Building a Blockchain and Cryptocurrency
 
Python for Finance: Investment Fundamentals and Data Analytics
 
Python For Offensive PenTest: A Complete Practical Course
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2019-01-01 Thread Tal Einat


Change by Tal Einat :


--
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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2019-01-01 Thread Tal Einat


Change by Tal Einat :


--
Removed message: https://bugs.python.org/msg332827

___
Python tracker 

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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2019-01-01 Thread Tal Einat


Change by Tal Einat :


--
Removed message: https://bugs.python.org/msg332828

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-01-01 Thread Yash Aggarwal


Yash Aggarwal  added the comment:

Thanks @mark.dickinson. As @rhettinger suggested, I'll write a basic function 
that uses division and works in O(k) for now. It's holiday season but hopefully 
@kellerfuchs will respond by then, and in the meantime I'll write more tests 
other than pascal's identity and corner cases.

--

___
Python tracker 

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