[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a06d683d7fd88721eaf59abcf5b02eb82045c7b1 by Serhiy Storchaka 
(Xtreak) in branch 'master':
bpo-38120: Fix DeprecationWarning in test_random for invalid type of arguments 
to random.seed. (GH-15987)
https://github.com/python/cpython/commit/a06d683d7fd88721eaf59abcf5b02eb82045c7b1


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-12 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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Okay.  This looks good to go.

I don't remember why the original test repeated some of the seeds -- that would 
normally only be done if caching was present.

--
assignee: rhettinger -> xtreak

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that test_random currently fails using -Werror:

$ ./python -W error -m test  -v test_random

==
ERROR: test_seed_when_randomness_source_not_found 
(test.test_random.MersenneTwister_TestBasicOps)
--
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/unittest/mock.py", line 1319, in 
patched
return func(*newargs, **newkeywargs)
  File "/home/vstinner/python/master/Lib/test/test_random.py", line 60, in 
test_seed_when_randomness_source_not_found
self.test_seedargs()
  File "/home/vstinner/python/master/Lib/test/test_random.py", line 46, in 
test_seedargs
self.gen.seed(arg)
  File "/home/vstinner/python/master/Lib/random.py", line 156, in seed
_warn('Seeding based on hashing is deprecated\n'
DeprecationWarning: Seeding based on hashing is deprecated
since Python 3.9 and will be removed in a subsequent version. The only 
supported seed types are: None, int, float, str, bytes, and bytearray.

==
ERROR: test_seedargs (test.test_random.MersenneTwister_TestBasicOps)
--
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/test_random.py", line 46, in 
test_seedargs
self.gen.seed(arg)
  File "/home/vstinner/python/master/Lib/random.py", line 156, in seed
_warn('Seeding based on hashing is deprecated\n'
DeprecationWarning: Seeding based on hashing is deprecated
since Python 3.9 and will be removed in a subsequent version. The only 
supported seed types are: None, int, float, str, bytes, and bytearray.


I also confirm that PR 15987 fix the issue.

--

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sure, I think these were not caught since deprecation warnings are not shown as 
part of CI as failure. I just caught them at the sprint running with -Wall.

--

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for doing this.

If you don't mind, let's hold off one day so I can take a closer look at this 
when I get home tonight.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Since d0cdeaab76fef8a6e5a04665df226b6659111e4e (bpo-32554) using random.seed 
raises DeprecationWarning for some types. This is not handled in test_random 
causing DeprecationWarnings. I will raise a PR for this.

commit d0cdeaab76fef8a6e5a04665df226b6659111e4e
Author: Raymond Hettinger 
Date:   Thu Aug 22 09:19:36 2019 -0700

bpo-32554: Deprecate hashing arbitrary types in random.seed() (GH-15382)

--
components: Tests
messages: 351966
nosy: pablogsal, rhettinger, vstinner, xtreak
priority: normal
severity: normal
status: open
title: DeprecationWarning in test_random due to invalid seed arguments
type: behavior
versions: Python 3.9

___
Python tracker 

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