[issue39289] crypt.crypt crashes on 3.9 where it didn't on 3.8

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

I fail to reproduce the issue on the master branch of Python on Fedora 31.

--
nosy: +vstinner

___
Python tracker 

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



[issue39289] crypt.crypt crashes on 3.9 where it didn't on 3.8

2020-01-10 Thread Vinay Sajip


New submission from Vinay Sajip :

The following script (cryptest.py):

import crypt

for salt in ('foo', 
'$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK'):
t = 'test'
h = crypt.crypt(t, salt)
print("'%s' with '%s' -> %s" % (t, salt, h))

crashes in 3.9, whereas it doesn't in earlier versions:

$ python2.7 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
'test' with '$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK' -> 
None
$ python3.7 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
'test' with '$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK' -> 
None
$ python3.8 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
'test' with '$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK' -> 
None
$ python3.9 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
Traceback (most recent call last):
  File "/home/vinay/projects/scratch/cpython/cryptest.py", line 5, in 
h = crypt.crypt(t, salt)
  File "/home/vinay/.local/lib/python3.9/crypt.py", line 82, in crypt
return _crypt.crypt(word, salt)
OSError: [Errno 22] Invalid argument

This is on Ubuntu 18.04, 64-bit.

--
components: Library (Lib)
keywords: 3.9regression
messages: 359732
nosy: vinay.sajip
priority: normal
severity: normal
status: open
title: crypt.crypt crashes on 3.9 where it didn't on 3.8
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