[issue42664] strptime(%c) fails to parse the output of strftime(%c)

2020-12-16 Thread sds


New submission from sds :

>>> import datetime, locale
>>> locale.getlocale()
('en_US', 'UTF-8')
>>> datetime.datetime.strptime("%c",datetime.datetime.now().strftime("%c"))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '%c' does not match format 'Wed Dec 16 18:44:27 2020'

--
components: Library (Lib)
messages: 383217
nosy: sam-s
priority: normal
severity: normal
status: open
title: strptime(%c) fails to parse the output of strftime(%c)
versions: Python 3.8

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



[issue42561] better error reporting in ast

2020-12-03 Thread sds


New submission from sds :

ast parsing error locations are hard to pinpoint.
See https://stackoverflow.com/q/46933995/850781.

--
components: Library (Lib)
files: ast.diff
keywords: patch
messages: 382449
nosy: sam-s
priority: normal
severity: normal
status: open
title: better error reporting in ast
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file49653/ast.diff

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



[issue39617] max_workers argument to concurrent.futures.ProcessPoolExecutor is not flexible enough

2020-02-20 Thread sds


sds  added the comment:

On a closer observation, I think you are eminently right.
Idle workers take far far far too much RAM.
In fact, I would like to be able to specify that the workers are to be spinned 
up on demand only and terminated immediately when they they are done.

--

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



[issue39617] max_workers argument to concurrent.futures.ProcessPoolExecutor is not flexible enough

2020-02-16 Thread sds


sds  added the comment:

I don't think you need this complexity - just keep the pool max size and submit 
jobs only when the loadavg drops below the threshold.
See my implementation attached.

--
Added file: https://bugs.python.org/file48898/run-at-load-avg.py

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



[issue39617] max_workers argument to concurrent.futures.ProcessPoolExecutor is not flexible enough

2020-02-13 Thread sds


sds  added the comment:

cf https://github.com/joblib/loky/issues/233

--

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



[issue39617] max_workers argument to concurrent.futures.ProcessPoolExecutor is not flexible enough

2020-02-12 Thread sds


sds  added the comment:

cf https://github.com/joblib/joblib/issues/1006

--

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



[issue39617] max_workers argument to concurrent.futures.ProcessPoolExecutor is not flexible enough

2020-02-12 Thread sds


New submission from sds :

The number of workers (max_workers) I want to use often depends on the server 
load.
Imagine this scenario: I have 64 CPUs and I need to run 200 processes.
However, others are using the server too, so currently loadavg is 50, thus I 
will set `max_workers` to (say) 20. 
But 2 hours later when those 20 processes are done, loadavg is now 0 (because 
the 50 processes run by my colleagues are done too), so I want to increase the 
pool size max_workers to 70.
It would be nice if it were possible to adjust the pool size depending on the 
server loadavg when a worker is started.
Basically, the intent is maintaining a stable load average and full resource 
utilization.

--
components: Library (Lib)
messages: 361905
nosy: sam-s
priority: normal
severity: normal
status: open
title: max_workers argument to concurrent.futures.ProcessPoolExecutor is not 
flexible enough
type: enhancement
versions: Python 3.8

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



[issue13947] gdbm reorganize() leaves hanging file descriptor

2019-04-08 Thread sds


sds  added the comment:

Upstream claims that this is fixed by 
http://git.gnu.org.ua/cgit/gdbm.git/commit/?id=a0d6c1a8

--

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



[issue13947] gdbm reorganize() leaves hanging file descriptor

2019-04-03 Thread sds


Change by sds :


--
versions: +Python 3.6 -Python 3.7

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



[issue13947] gdbm reorganize() leaves hanging file descriptor

2019-04-03 Thread sds


Change by sds :


--
components: +Library (Lib)
versions: +Python 3.7 -Python 2.7, Python 3.2

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



[issue13947] gdbm reorganize() leaves hanging file descriptor

2019-04-03 Thread sds


Change by sds :


--
type:  -> behavior

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



[issue13947] gdbm reorganize() leaves hanging file descriptor

2019-04-03 Thread sds


sds  added the comment:

I observe the same behavior on Linux 4.18.0-17-generic #18-Ubuntu
with Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0].
gdbm 1.14.1-6:
after

db = dbm.gnu.open("asdf","n")
db["a"] = "124"
db.reorganize()
db.close()

I see

$ lsof ~/asdf 
COMMAND   PID USER  FD   TYPE DEVICE SIZE/OFFNODE NAME
python3 22071  sds mem-W  REG8,216384 4328326 /home/sds/asdf

and

>>> db = dbm.gnu.open("asdf","r")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/sds/src/pyapp/tests/fileconv_test.py", line 1053, in 
_gdbm.error: [Errno 11] Resource temporarily unavailable

--
nosy: +sam-s

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



[issue34248] dbm errors should contain file names

2018-07-31 Thread sds


sds  added the comment:

thanks for the patch.
alas, I do not build python myself, so I cannot try it.

--

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



[issue34248] dbm errors should contain file names

2018-07-27 Thread sds


New submission from sds :

`dbm` errors should contain file names when appropriate, just like `OSError`.
E.g.:
```
>>> open("fo")
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [Errno 2] No such file or directory: 'fo'
>>> import dbm.gnu
>>> dbm.gnu.open("fo")
Traceback (most recent call last):
  File "", line 1, in 
_gdbm.error: [Errno 2] No such file or directory
```
the `_gdbm.error` should report the file name `'fo'` just like 
`FileNotFoundError` does (and `exn.args` should contain the file name too!)

--
components: Extension Modules
messages: 322492
nosy: sam-s
priority: normal
severity: normal
status: open
title: dbm errors should contain file names
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-06-08 Thread sds


sds  added the comment:

I think consistency would be nice -- so, yes, `dbm.dumb.error` instead of 
`ValueError` (or at least a subtype of `dbm.dumb.error`). 
Thanks!

--

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



[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-03-19 Thread sds

sds <s...@gnu.org> added the comment:

Same problem with 3.6.4, start with

>>> from dbm import gnu as gdbm

then the same incorrect behavior

--
versions: +Python 3.6 -Python 2.7

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



[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-03-19 Thread sds

New submission from sds <s...@gnu.org>:

deleting a key from a read-only gdbm should be gdbm.error, not KeyError:


>>> import gdbm
>>> db = gdbm.open("foo","n")   # create new
>>> db["a"] = "b"
>>> db.close()
>>> db = gdbm.open("foo","r")   # read only
>>> db["x"] = "1"
Traceback (most recent call last):
  File "", line 1, in 
gdbm.error: Reader can't store# correct
>>> db["a"]
'b'
>>> del db["a"]
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'a'# WRONG!  should be the same as above

--
components: Library (Lib)
messages: 314119
nosy: sam-s
priority: normal
severity: normal
status: open
title: Deleting a key in a read-only gdbm results in KeyError, not gdbm.error
type: behavior
versions: Python 2.7

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



[issue32494] interface to gdbm_count

2018-01-04 Thread sds

New submission from sds <s...@gnu.org>:

gdbm offers a function to quickly find number of records: gdbm_count()
http://www.gnu.org/software/gdbm/manual/html_node/Count.html
It would be nice to be able to call it.

--
components: Library (Lib)
messages: 309483
nosy: sam-s
priority: normal
severity: normal
status: open
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue32484] ImportError for gdbm 1.14

2018-01-02 Thread sds

New submission from sds <s...@gnu.org>:

After upgrading to gdbm stable 1.14, I get this:
```
>>> import gdbm
Traceback (most recent call last):
  File "", line 1, in 
ImportError: dlopen(/.../lib/python2.7/lib-dynload/gdbm.so, 2): Symbol not 
found: _gdbm_errno
  Referenced from: /.../lib/python2.7/lib-dynload/gdbm.so
  Expected in: /usr/local/opt/gdbm/lib/libgdbm.4.dylib
 in /.../lib/python2.7/lib-dynload/gdbm.so
```
This is probably related to this change:
```
* Make gdbm_error global thread safe.
```
(https://lists.gnu.org/archive/html/info-gnu/2018-01/msg0.html)

--
components: Library (Lib)
messages: 309392
nosy: sam-s
priority: normal
severity: normal
status: open
title: ImportError for gdbm 1.14
versions: Python 2.7

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



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

sds added the comment:

the problem is not present in 
Python 3.6.2 (default, Jul 17 2017, 16:44:45):
```
>>> import dbm
>>> import dbm.gnu
>>> db = dbm.gnu.open("foo","c")
>>> "a" in db
False
>>> u"a" in db
False
```

--

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



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

New submission from sds:

`in` and `has_key` have different behavior for Unicode keys for `gdbm` in 2.7:
```
>>> import gdbm
>>> db = gdbm.open("foo.gdbm","c")
>>> db.has_key("a")
0
>>> db.has_key(u"a")
0
>>> "a" in db
False
>>> u"a" in db
Traceback (most recent call last):
  File "", line 1, in 
TypeError: gdbm key must be string, not unicode
```

--
components: Unicode
messages: 301728
nosy: ezio.melotti, haypo, sam-s
priority: normal
severity: normal
status: open
title: TypeError: gdbm key must be string, not unicode
type: behavior
versions: Python 2.7

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



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

sds added the comment:

platform:
Python 2.7.13 (default, Jul 18 2017, 09:17:00) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin

--

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