[issue46353] 'pydoc -k' fails when some module's loader is not found

2022-01-12 Thread Denis Laxalde


Change by Denis Laxalde :


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

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



[issue46353] 'pydoc -k' crashes when some module's loader is not found

2022-01-12 Thread Denis Laxalde


New submission from Denis Laxalde :

On my (Debian 10) system, 'pydoc -k' crashes as follows:
  

$ python3 -m pydoc -k foo
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File "/usr/lib/python3.9/pydoc.py", line 2862, in 
cli()
  File "/usr/lib/python3.9/pydoc.py", line 2795, in cli
apropos(val)
  File "/usr/lib/python3.9/pydoc.py", line 2287, in apropos
ModuleScanner().run(callback, key, onerror=onerror)
  File "/usr/lib/python3.9/pydoc.py", line 2248, in run
loader = spec.loader
AttributeError: 'NoneType' object has no attribute 'loader'

(The same happens with current 'main' of CPython.)

The module that is tried to be loaded is 'ansible.galaxy.data', installed in 
/usr/lib/python3/dist-packages/ and it uses a custom (Ansible) finder 
_AnsiblePathHookFinder.

Maybe this finder has problems, but since Finder.find_module() may return None, 
I believe this should be handled by pydoc's ModuleScanner.

If agreed, I'll prepare a fix accordingly.

--
components: Library (Lib)
messages: 410388
nosy: dlax
priority: normal
severity: normal
status: open
title: 'pydoc -k' crashes when some module's loader is not found
type: crash
versions: Python 3.9

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



[issue44564] DeprecationWarning in test_enum over formatting

2021-07-29 Thread Denis Laxalde


Denis Laxalde  added the comment:

The assertion at stake looks redundant since we already check that 
`'{}'.format(OkayEnum.one) == '1'` (the line above) and that `OkayEnum.one == 
'1'` (3 lines above).

--
nosy: +dlax

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



[issue42414] unable to document fields of dataclass

2021-07-22 Thread Denis Laxalde


Change by Denis Laxalde :


--
nosy: +dlax

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



[issue44353] PEP 604 NewType

2021-07-21 Thread Denis Laxalde


Change by Denis Laxalde :


--
nosy: +dlax

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-24 Thread Denis S. Otkidach


Denis S. Otkidach  added the comment:

Re: msg393586
> See my comment in the PR for a suggestion about an alternative structure for 
> wait_for, which may avoid this gap and hence prevent the leak (but I have not 
> tested it!)

Unfortunately this didn't close the gap, so the leak persisted.

I did some research on the source of the error. There are circular references 
between instances of _SelectorSocketTransport and _SSLProtocolTransport (see 
attached image), therefore these objects are destroyed by garbage collector. 
The order might be arbitrary. When _SelectorSocketTransport is destroyed after 
_SSLProtocolTransport everything is ok, but with the opposite order we get the 
error printed. Here is description on how to reproduce this:
https://github.com/ods/bpo-37658#circular-references-when-using-ssltls

--
Added file: https://bugs.python.org/file50061/ssl_circular_refs.png

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach

Denis S. Otkidach  added the comment:

The original problem can be fixed by wrapping await into try-except block:

```
async def create_connection(ssl_obj):
loop = asyncio.get_event_loop()
connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000, 
ssl=ssl_obj)
connector = asyncio.ensure_future(connector)
try:
tr, pr = await connector
except asyncio.CancelledError:
if connector.done():
tr, pr = connector.result()
# Uncommenting the following line fixes the problem:
# tr.close()
raise
return tr, pr
```

I've updated my example to reproduce this: 
https://github.com/ods/bpo-37658/commit/eca3d81d60cbe129ce687674e6451836d567f6b9

I believe it's general problem with maintaining atomicity in async code, and 
not a bug in `wait_for`. Probably having an interface like `async with 
loop.create_connection(…) as transport, protocol` might simplify correct usage 
for this particular case.

--

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



[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2021-05-13 Thread Denis S. Otkidach


Change by Denis S. Otkidach :


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

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach


Change by Denis S. Otkidach :


--
pull_requests: +24738
pull_request: https://github.com/python/cpython/pull/26097

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach


Denis S. Otkidach  added the comment:

The current solutions doesn't look correct. It swallows cancelling causing task 
to hang: https://bugs.python.org/issue42130 .

Proposed test case calls cancel for inner future and set_result for outer task 
in the same loop step. The old (prior to this patch) behaviour in this case 
looks correct to me. We have to elaborate on original problem to find the 
source of actual race.

Therefore I've tried to reproduce the problem with original code sample and 
published the adapted version of it here: https://github.com/ods/bpo-37658 . 
Nikita Ilyasov, please correct me if I've misunderstood what you meant. My 
result is that proposed solution actually doesn't solve the problem, but rather 
lowers the chance to get it. Namely, I get the traceback quoted in README both 
with 3.8.5, 3.9.4, and current code in main.

--
nosy: +ods

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



[issue43029] unittest: Add assertUniqeIn

2021-01-29 Thread Denis Roussel


Denis Roussel  added the comment:

Of course. Wanted a shortcut. Can close it if you want.

--

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



[issue43029] unittest: Add assertUniqeIn

2021-01-29 Thread Denis Roussel


Denis Roussel  added the comment:

Indeed, can do 
assertNotEquals(len(the_list), len(set(the_list))

--

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



[issue43029] unittest: Add assertUniqeIn

2021-01-26 Thread Denis Roussel


Change by Denis Roussel :


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

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



[issue43029] unittest: Add assertUniqeIn

2021-01-26 Thread Denis Roussel


New submission from Denis Roussel :

Allows to test uniqueness of members of a list

--
components: Tests
messages: 385700
nosy: rousseldenis
priority: normal
severity: normal
status: open
title: unittest: Add assertUniqeIn

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



[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-10-31 Thread Denis Kasak


Denis Kasak  added the comment:

Anything still left to do that is stalling this? I just got bitten by it when 
trying to use modulefinder.

--
nosy: +dkasak

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



[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-26 Thread Denis S. Otkidach


Change by Denis S. Otkidach :


--
nosy: +ods

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



[issue42140] asyncio.wait function creates futures set two times

2020-10-25 Thread Denis S. Otkidach


Denis S. Otkidach  added the comment:

The current error message is way too cryptic anyway.  And restricting it to the 
set type only, as in docs, will certainly break a lot of code (passing a list 
is quite common).

--

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



[issue42140] asyncio.wait function creates futures set two times

2020-10-24 Thread Denis S. Otkidach


Change by Denis S. Otkidach :


--
nosy: +ods

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



[issue42020] interpreter hangs forever on invalid input

2020-10-13 Thread denis


denis  added the comment:

I do confirm that different terminals react differently (xterm doesn't hang)

Definitely not a python bug

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue42020] interpreter hangs forever on invalid input

2020-10-12 Thread denis

New submission from denis :

Python 3.8.5, Python 3.7.3
When trying to print invalid unicode, interpreter goes to a completely 
unresponsive state

>>> print("\x9b")


eyboardInterrupt
>>> print("\xa5")
¥
>>> print("\x95")

>>> print("\x90")
denis@debian:~$ 

--
components: Unicode
messages: 378514
nosy: dgan, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: interpreter hangs forever on invalid input
type: behavior
versions: Python 3.7, Python 3.8

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



[issue39618] logger.exception with default message

2020-02-12 Thread Denis Vieira


New submission from Denis Vieira :

On my Python projects i like to use the logger.exception() method without any 
other message. 

I'm forced to send an empty string on every call.
logger.exception('')

It would be nice the exception method have the expected parameter "msg" with an 
default value ('').

--
messages: 361908
nosy: Denis Vieira
priority: normal
severity: normal
status: open
title: logger.exception with default message
type: enhancement
versions: Python 3.5

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-02 Thread Kaveshnikov Denis


New submission from Kaveshnikov Denis :

Hi, I found that if to call run_until_complete() in the task while the event 
loop will be running, a coroutine sent to run_until_complete() will be 
performed despite the exception raised from run_until_complete().
It seems to me, it would be better to cancel such a coroutine or just do 
nothing with it.

--
components: asyncio
files: test_event_loop.py
messages: 359196
nosy: asvetlov, dkaveshnikov, yselivanov
priority: normal
severity: normal
status: open
title: Coroutine is awaited despite an exception in run_until_complete()
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48819/test_event_loop.py

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



[issue36221] Setting PYTHONASYNCIODEBUG breaks warnings

2019-11-26 Thread Denis S. Otkidach


Denis S. Otkidach  added the comment:

It's fixed in 3.8 final, but the problem persists in 3.7.5

--
versions:  -Python 3.8

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



[issue34364] problem with traceback for syntax error in f-string

2019-05-28 Thread Denis S. Otkidach


Change by Denis S. Otkidach :


--
nosy: +ods

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



[issue37065] File and lineno is not reported for syntax error in f-string

2019-05-27 Thread Denis S. Otkidach


New submission from Denis S. Otkidach :

Minimal example to reproduce:

-->8--
>>> with open('f_bug.py', 'w') as fp:
... fp.write('f"{a b}"')
... 
8
>>> import f_bug
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
(a b)
   ^
SyntaxError: invalid syntax
-->8--

Here we see in track trace "" and line number in erroneous expression 
in f-string, but no "f_bug.py" and line number in it.

--
components: Interpreter Core
messages: 343639
nosy: ods
priority: normal
severity: normal
status: open
title: File and lineno is not reported for syntax error in f-string
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

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



ANN: Lea 3.1.0 released

2019-03-27 Thread Pierre Denis
Lea 3.1.0 final is now released!

---> http://pypi.org/project/lea/3.1.0

What is Lea?

Lea is a Python module aiming at working with discrete probability
distributions in an intuitive way.

It allows you modeling a broad range of random phenomena: gambling, weather,
finance, etc. More generally, Lea may be used for any finite set of discrete
values having known probability: numbers, booleans, date/times, symbols, ...
Each probability distribution is modeled as a plain object, which can be
named, displayed, queried or processed to produce new probability
distributions. Lea also provides advanced functions and Probabilistic
Programming (PP) features; these include conditional probabilities, Bayesian
networks, joint probability distributions, Markov chains and symbolic
computation. Lea can be used for AI, PP, gambling, education, ...

LGPL - Python 2.6+ / Python 3 supported

What's new in Lea 3.1.0?

The present version essentially consolidates the previous one (3.0.1),
adding just few new features. The main changes are:

- new switch_func method, for defining CPT by a function (far less
memory-consuming for models like noisy-or, noisy-max)
- improvements on Markov chain functions, including calculation of absorbing
MC
- optimization of lea.max_of, lea.min_of functions
- bug fixes for symbolic calculation (in particular for Python 2.7)
- numerous addings/improvements on wiki tutorials and documentation,
especially on Lea API

Many thanks...
--
... to Paul Moore, Jens Finkhaeuser and Rasmus Bonnevie who provided
proposals, contributions, feedbacks that gave the impetus for the present
version.

To learn more...

Lea 3 on PyPI -> http://pypi.org/project/lea/3.1.0
Lea project page  -> http://bitbucket.org/piedenis/lea
Documentation -> http://bitbucket.org/piedenis/lea/wiki/Home
Statues algorithm -> http://arxiv.org/abs/1806.09997

With the hope that Lea can make this Universe less hazardous,

Pierre Denis

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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue36221] Setting PYTHONASYNCIODEBUG breaks warnings

2019-03-06 Thread Denis S. Otkidach


New submission from Denis S. Otkidach :

Test script:

-->8--
import asyncio

@asyncio.coroutine
def test():
with (yield from asyncio.Lock()):
pass

asyncio.run(test())
-->8--

Correct behavior without flag (warning is reported and points to correct line 
of code):
---
$ python test.py 
test.py:5: DeprecationWarning: 'with (yield from lock)' is deprecated use 
'async with lock' instead
  with (yield from asyncio.Lock()):
---

Setting PYTHONASYNCIODEBUG flag disables warning:
---
$ PYTHONASYNCIODEBUG=1 python test.py
$
---

Warning is back explicitly turned on, but points to incorrect position in stack:
---
$ PYTHONASYNCIODEBUG=1 python -Wall test.py 
lib/python3.8/asyncio/coroutines.py:58: DeprecationWarning: 'with (yield from 
lock)' is deprecated use 'async with lock' instead
  return self.gen.send(None)
---

Another way to enable debugging doesn't disable warnings, but break its 
location too:
---
$ python -Xdev test.py 
lib/python3.8/asyncio/coroutines.py:58: DeprecationWarning: 'with (yield from 
lock)' is deprecated use 'async with lock' instead
  return self.gen.send(None)
---

--
components: asyncio
messages: 337366
nosy: asvetlov, ods, yselivanov
priority: normal
severity: normal
status: open
title: Setting PYTHONASYNCIODEBUG breaks warnings
type: behavior
versions: Python 3.7, Python 3.8

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



Cloud platform with GPU

2018-11-09 Thread denis meng
Good day all,

I am looking for a good cloud platform to do all my python development for
machine learning with GPU availability, so far I have used Amazon ec2,
google colab, kaggle etc but none of them was very satisfactory.

Anyone has good experience with other options? please share and TIA

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


[issue35165] Possible wrong method name in attribute references doc

2018-11-05 Thread Denis Osipov


Denis Osipov  added the comment:

Got it.

But now docs says that overriding the __getattr__() method is enough to 
customize attribute access. It's not completely true.

If I understand it correct, to make __getattr__() work every time you need to 
call it by __getattribute__ or raise AttributeError, e.g. store attributes 
somewhere not in instance __dict__. In this case you need to override 
__setattr__ too.

class MyGetattrClass:
def __init__(self):
super().__setattr__("attrs", {})

def __setattr__(self, name, value):
self.attrs[name] = value

def __getattr__(self, name):
try:
print(f"{name} equals {self.attrs[name]}")
except KeyError:
raise AttributeError(
f"{type(self).__name__!r} object has no attribute {name!r}"
) from None

If it's correct, we probably should add some clarification in expressions doc. 
Or maybe just link to 
https://docs.python.org/3/reference/datamodel.html#object.__getattr__ (which 
mention about it) will be enough.

--

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-04 Thread Denis Osipov


Change by Denis Osipov :


--
keywords: +patch
pull_requests: +9625
stage: needs patch -> patch review

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



[issue31583] 2to3 call for file in current directory yields error

2018-11-04 Thread Denis Osipov


Change by Denis Osipov :


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

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



[issue35165] Possible wrong method name in attribute references doc

2018-11-04 Thread Denis Osipov


New submission from Denis Osipov :

6.3.1. Attribute references says:

"The primary must evaluate to an object of a type that supports attribute 
references, which most objects do. This object is then asked to produce the 
attribute whose name is the identifier. This production can be customized by 
overriding the __getattr__() method. If this attribute is not available, the 
exception AttributeError is raised."

It seems that __getattribute__ method is meaning.

--
assignee: docs@python
components: Documentation
messages: 329245
nosy: denis-osipov, docs@python
priority: normal
severity: normal
status: open
title: Possible wrong method name in attribute references doc
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-04 Thread Denis Osipov


Denis Osipov  added the comment:

I understand that it's expected behavior. But why don't use completely working 
example in the docs, which one could just copy and paste? It requires to add 
just seven chars)

--

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-10-30 Thread Denis Osipov


New submission from Denis Osipov :

Customizing module attribute access example raises RecursionError:

>>> import sys
>>> from types import ModuleType
>>> class VerboseModule(ModuleType):
... def __repr__(self):
... return f'Verbose {self.__name__}'
... def __setattr__(self, attr, value):
... print(f'Setting {attr}...')
... setattr(self, attr, value)
...
>>> sys.modules[__name__].__class__ = VerboseModule
>>> sys.modules[__name__].a = 5
Setting a...
<...>
Setting a...
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 6, in __setattr__
  File "", line 6, in __setattr__
  File "", line 6, in __setattr__
  [Previous line repeated 495 more times]
  File "", line 5, in __setattr__
RecursionError: maximum recursion depth exceeded while calling a Python object
Setting a...>>>

Something like this can fix it:

def __setattr__(self, attr, value):
... print(f'Setting {attr}...')
... super().setattr(self, attr, value)

--
assignee: docs@python
components: Documentation
messages: 328966
nosy: denis-osipov, docs@python
priority: normal
severity: normal
status: open
title: Customizing module attribute access example raises RecursionError
type: behavior
versions: Python 3.7, Python 3.8

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



[issue35017] socketserver accept a last request after shutdown

2018-10-26 Thread Denis Ledoux


Denis Ledoux  added the comment:

The pleasure is all mine.

Thanks to you and the other contributors involved. For my first contribution to 
Python, I am glad everything went smoothly :).

--

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



[issue35017] socketserver accept a last request after shutdown

2018-10-26 Thread Denis Ledoux


Change by Denis Ledoux :


--
pull_requests: +9461

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



[issue35017] socketserver accept a last request after shutdown

2018-10-18 Thread Denis Ledoux


Change by Denis Ledoux :


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

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



[issue35017] socketserver accept a last request after shutdown

2018-10-18 Thread Denis Ledoux


New submission from Denis Ledoux :

After the shutdown of a `BaseServer`, the server may accept a last single 
request if it is sent between the server socket polling and the polling timeout.

This can be problematic for instance for a server restart for which you do not 
want to interrupt the service, by not closing the listening socket during the 
restart. One request can fail because of this behavior.

Note that only one request will fail, following requests will not be accepted, 
as expected.

--
components: Library (Lib)
messages: 327969
nosy: beledouxdenis
priority: normal
severity: normal
status: open
title: socketserver accept a last request after shutdown
type: behavior
versions: Python 3.6

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



telluric 0.2 released

2018-08-28 Thread Denis Rykov
On behalf of the telluric development community, I'm happy to announce the
availability of telluric 0.2.

telluric library is an open source library developed by Satellogic, which aims
to be an one stop source (library) for manipulating geospatial data in an
interactive way.

Changelog: 
https://telluric.readthedocs.io/en/v0.2.0/changelog.html#telluric-0-2-0-2018-08-22
Docs: https://telluric.readthedocs.io/en/v0.2.0
Video from PyCon Israel 2018: https://youtu.be/BhobgSkySzc
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


RE: ironpython not support py3.6

2018-06-26 Thread denis akhiyarov
  To: Schachner, Joseph
From: "denis akhiyarov" 

  To: Schachner, Joseph
From: denis.akhiya...@gmail.com

Either wait for IronPython 3.6, use COM interop, pythonnet, subprocess, or
things like gRPC. Based on PyPy experience, it is probably 1-2 years of
sponsored development to get a working IronPython 3.6.

-+- BBBS/Li6 v4.10 Toy-3
 + Origin: Prism bbs (1:261/38)

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: ironpython not support py3.6

2018-06-24 Thread denis akhiyarov
  To: Schachner, Joseph
From: denis.akhiya...@gmail.com

Either wait for IronPython 3.6, use COM interop, pythonnet, subprocess, or
things like gRPC. Based on PyPy experience, it is probably 1-2 years of
sponsored development to get a working IronPython 3.6.

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: ironpython not support py3.6

2018-06-22 Thread denis . akhiyarov
Either wait for IronPython 3.6, use COM interop, pythonnet, subprocess, or 
things like gRPC. Based on PyPy experience, it is probably 1-2 years of 
sponsored development to get a working IronPython 3.6.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31118] Make super() work with staticmethod by using __class__ for both arguments to super()

2018-05-14 Thread Denis Ryzhkov

Denis Ryzhkov <den...@denisr.com> added the comment:

Simple explanation: if you call a method of a parent, then you are using class 
information now, so your child method is not static any more. Please use 
classmethod decorator and super() with no arguments - it will use cls argument 
implicitly

--
nosy: +denisr

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



Re: Enumerating all 3-tuples

2018-03-15 Thread Denis Kasak

On 2018-03-13 23:56, Denis Kasak wrote:

On 2018-03-10 02:13, Steven D'Aprano wrote:


But I've stared at this for an hour and I can't see how to extend the
result to three coordinates. I can lay out a grid in the order I want:

1,1,1   1,1,2   1,1,3   1,1,4   ...
2,1,1   2,1,2   2,1,3   2,1,4   ...
1,2,1   1,2,2   1,2,3   1,2,4   ...
3,1,1   3,1,2   3,1,3   3,1,4   ...
2,2,1   2,2,2   2,2,3   2,2,4   ...
...

and applying Cantor's diagonal order will give me what I want, but 
damned

if I can see how to do it in code.



[snip]


The triples can be viewed as a pair of a pair and a natural number:

(1,1),1 (1,1),2 (1,1),3 ...
(2,1),1 (2,1),2 (2,1),3 ...
(1,2),1 (1,2),2 (1,2),3 ...
   .   .   .
   .   .   .
   .   .   .

[snip]

def c3(i):
"""
Inverse of the Cantor pairing function generalization to 
triples,

mapping N → N×N×N.
"""
n, m = c(i)
return c(n) + (m,)


In fact, extending this idea further, we can view the grid as a 
Cartesian product of two sets: the natural numbers and an arbitrary 
enumerable set. In your intended grid layout, the natural numbers were 
put (in their usual ordering) on the horizontal axis and the 2-tuples 
given by the pairing function on the vertical axis.


However, diagonalizing this grid allows us to enumerate the Cartesian 
product itself, which means we can repeat the process by using this 
enumeration as the new vertical axis. Therefore, this process 
generalizes naturally to an arbitrary number of dimensions:


def cr(i, d=2):
"""
Inverse of the Cantor pairing function generalization to 
d-tuples,

mapping N → N^d.
"""
if d == 1:
return i
elif d == 2:
return c(i)
else:
n, m = c(i)
return cr(n, d-1) + (m,)


>>> def first_ten(d):
...return [cr(i, d) for i in range(1, 11)]

>>> for d in range(2, 5):
... pprint(first_ten(d))
[(1, 1), (2, 1), (1, 2), (3, 1), (2, 2), (1, 3), (4, 1), (3, 2), (2, 
3), (1, 4)]

[(1, 1, 1),
(2, 1, 1),
(1, 1, 2),
(1, 2, 1),
(2, 1, 2),
(1, 1, 3),
(3, 1, 1),
(1, 2, 2),
(2, 1, 3),
(1, 1, 4)]
[(1, 1, 1, 1),
(2, 1, 1, 1),
(1, 1, 1, 2),
(1, 1, 2, 1),
(2, 1, 1, 2),
(1, 1, 1, 3),
(1, 2, 1, 1),
(1, 1, 2, 2),
(2, 1, 1, 3),
(1, 1, 1, 4)]


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


Re: Enumerating all 3-tuples

2018-03-14 Thread Denis Kasak

On 2018-03-10 02:13, Steven D'Aprano wrote:


But I've stared at this for an hour and I can't see how to extend the
result to three coordinates. I can lay out a grid in the order I want:

1,1,1   1,1,2   1,1,3   1,1,4   ...
2,1,1   2,1,2   2,1,3   2,1,4   ...
1,2,1   1,2,2   1,2,3   1,2,4   ...
3,1,1   3,1,2   3,1,3   3,1,4   ...
2,2,1   2,2,2   2,2,3   2,2,4   ...
...

and applying Cantor's diagonal order will give me what I want, but 
damned

if I can see how to do it in code.


If you want this exact order, it can be reproduced in the following way.

The triples can be viewed as a pair of a pair and a natural number:

(1,1),1 (1,1),2 (1,1),3 ...
(2,1),1 (2,1),2 (2,1),3 ...
(1,2),1 (1,2),2 (1,2),3 ...
   .   .   .
   .   .   .
   .   .   .

Decomposing this by the diagonals yields

1: (1,1),1
2: (2,1),1  (1,1),2
3: (1,2),1  (2,1),2  (1,1),3
.
.
.

Notice that the first elements of each pair (i.e. the inner pairs) are 
given by the (inverse of the) original Cantor pairing function, in 
decreasing order. The second elements are just the natural numbers. 
Naming the inverse c, we can rewrite the above like this:


1: c(1),1
2: c(2),1  c(1),2
3: c(3),1  c(2),2  c(1),3
.
.
.

Rewriting this to spell out the mapping between the natural numbers and 
the pairs, we get


1 -> c(1),1
2 -> c(2),1
3 -> c(1),2
4 -> c(3),1
5 -> c(2),2
6 -> c(1),3
.
.
.

Squinting a bit, this might seem familiar. This is exactly the same as 
the original pairing function, except for an additional application of c 
to the first element of the pair!


1 -> 1,1
2 -> 2,1
3 -> 1,2
4 -> 3,1
5 -> 2,2
6 -> 1,3

This leads fairly naturally to the implementation.

from itertools import accumulate, count

def c(i):
"""
Inverse of the Cantor pairing function, mapping N → N×N.
"""
assert i >= 1

# partial sums of the series 1 + 2 + 3 + ...
sums = accumulate(count(1))
n = 0

while True:
m = next(sums)
if m < i:
n += 1
else:
r = m - i
break

return r + 1, n - r + 1


def c3(i):
"""
Inverse of the Cantor pairing function generalization to 
triples,

mapping N → N×N×N.
"""
n, m = c(i)
return c(n) + (m,)

Applying c3 to the natural numbers gives the sequence you wanted:


s = map(c3, count(1))
pprint([next(s) for _ in range(10)])

[(1, 1, 1),
 (2, 1, 1),
 (1, 1, 2),
 (1, 2, 1),
 (2, 1, 2),
 (1, 1, 3),
 (3, 1, 1),
 (1, 2, 2),
 (2, 1, 3),
 (1, 1, 4)]

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


[issue32171] Inconsistent results for fractional power of -infinity

2017-12-01 Thread Pierre Denis

Pierre Denis <pie.de...@skynet.be> added the comment:

> So this justifies things like `sqrt(-0.0)` giving a zero result (rather than 
> being considered invalid)

Well, I didn’t noticed that the wolf was already in the henhouse! This choice 
seems disputable for me because it is precisely a case where f(-0.0) should NOT 
behave as f(+0.0). The treatment of functions like atan2 and 1/x lets me think 
that the standards tend to follow the results of one-sided limits. So, I’m 
surprised that pow and sqrt functions in IEEE754/C99 standards are treated in 
this unfettered way.

That being said, I’m not involved at all in IEEE/C99 standards; that’s probably 
why I look at this from a pristine point of view. Provided that I accept the 
"axioms" of these standards, the explanations you both give are very 
convincing. I understand well that self-consistency is utmost important, maybe 
even above consistency with mathematical rules. Also, I concede that the 
standards are well-established and considerable efforts have been made to 
validate their different implementations (including Python).

BTW, congratulations to you guys that made the effort to understand the 
standards and rigorously implementing them in Python!

--

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Pierre Denis

Pierre Denis <pie.de...@skynet.be> added the comment:

Thanks, Tim & Mark. This indeed clarifies and gives a good rationale on Python 
implementation. Nevertheless, despite the authority arguments, I continue to 
wonder what is the rationale for these specifications. Probably the debate 
should move to the standards C99 and IEEE754 themselves.
Agreed to close the ticket on Python... waiting a change to the standards!

--

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Pierre Denis

New submission from Pierre Denis <pie.de...@skynet.be>:

Python returns inconsistent results when negative infinity is raised to a 
non-integer power. This happens with the ** operator as well as with the pow 
and math.pow functions. The most blatant symptom occurs with power 0.5, which 
is expectedly equivalent to a square root:

>>> float('-inf') ** 0.5
inf
>>> pow(float('-inf'), 0.5)
inf
>>> import math
>>> math.pow(float('-inf'), 0.5)
inf

Mathematically, these operations are invalid if we restrict to real numbers. 
Also, if we extend to complex numbers, the results are wrong since the result 
should be infj, which is the value returned by cmath.sqrt(float('-inf')).

IMHO, there are three possible ways to fix this:

1) raise an exception ValueError
2) return nan
3) return (nan + nanj)

Discussion:

- Solution 1) is consistent with current handling of *finite* negative base 
with non-integer exponent; also, it is consistent with 
math.sqrt(float('-inf')), which raises ValueError.

- I expected solution 2) to be more in line with IEEE754 … until I read the 
following statement in this specification: "pow(x, y) signals the invalid 
operation exception for finite x<0 and finite non-integer y". I’m not an expert 
of this topic but I think that there is miss here since IEEE754 does not state 
what happens for *infinite* x<0 and finite non-integer y.

- Solution 3) emphasizes the fact that, although the result is generally 
undefined, it belongs to complex type.

- In any case, the solution should be consistent also with the case with 
negative fractional exponent… even if I would tend to accept that 
(float('-inf')**-0.5) == 0.0 is mathematically sensible!

- The test assertions shall be updated in Python standard test suite 
(test_float.py).

Note that Python 2.6 behaves consistently for all negative bases, finite or not 
finite: it raises ValueError exception with the message "negative number cannot 
be raised to a fractional power". The behavior described here seems to be 
introduced in this commit: 
https://github.com/python/cpython/commit/9ab44b509a935011beb8e9108a2271ee728e8ad4#diff-b7e3652f51768cec742ef07326413ad0

--
messages: 307256
nosy: pdenis
priority: normal
severity: normal
status: open
title: Inconsistent results for fractional power of -infinity
type: behavior
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/issue32171>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31761] regrtest: faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from IDLE

2017-10-12 Thread Denis Osipov

Denis Osipov <osipo...@list.ru> added the comment:

Got it. Thank you for your help.

--

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



[issue31761] Possible error in devguide part about tests

2017-10-11 Thread Denis Osipov

New submission from Denis Osipov <osipo...@list.ru>:

In Developer Guide says:

"If you don’t have easy access to a command line, you can run the test suite 
from a Python or IDLE shell:

>>> from test import autotest"

But I can't run test from IDLE:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in 
from test import autotest
  File "D:\repos\cpython\Lib\test\autotest.py", line 5, in 
main()
  File "D:\repos\cpython\Lib\test\libregrtest\main.py", line 585, in main
Regrtest().main(tests=tests, **kwargs)
  File "D:\repos\cpython\Lib\test\libregrtest\main.py", line 510, in main
self._main(tests, kwargs)
  File "D:\repos\cpython\Lib\test\libregrtest\main.py", line 524, in _main
setup_tests(self.ns)
  File "D:\repos\cpython\Lib\test\libregrtest\setup.py", line 18, in setup_tests
faulthandler.enable(all_threads=True)
io.UnsupportedOperation: fileno

If I understand it correct, this behavior is reasonable (issues 3003 and 25588).
Maybe it's worth to remove words about running from IDLE. Or in case if it's 
possible to run such tests add some words about it.

--
assignee: docs@python
components: Documentation
messages: 304163
nosy: denis-osipov, docs@python
priority: normal
severity: normal
status: open
title: Possible error in devguide part about tests
type: behavior
versions: Python 3.7, Python 3.8

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



[issue31747] fatal error LNK1120 in PCbuild\python3dll.vcxproj

2017-10-10 Thread Denis Osipov

Denis Osipov <osipo...@list.ru> added the comment:

Oops... I've tried to rebuild, it didn't help. But after deleting folder 
cpython\PCbuild\amd64 everything works well again.

Sorry for false alarm.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

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



[issue31747] fatal error LNK1120 in PCbuild\python3dll.vcxproj

2017-10-10 Thread Denis Osipov

New submission from Denis Osipov <osipo...@list.ru>:

Since today (2017-10-10) I have compile error on Windows 10:

$ PCbuild/build.bat -e -d -p x64
Using py -3.6 (found with py.exe)
Fetching external libraries...
bzip2-1.0.6 already exists, skipping.
sqlite-3.14.2.0 already exists, skipping.
xz-5.2.2 already exists, skipping.
zlib-1.2.11 already exists, skipping.
Fetching external binaries...
openssl-bin-1.1.0f already exists, skipping.
tcltk-8.6.6.0 already exists, skipping.
Finished.
Using "C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" (found in the Visual 
Studio 2017 registry)

D:\repos\cpython>"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" 
"D:\repos\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m 
/p:Configuration=Debug /p:Platform=x64 /p:IncludeExternals=true 
/p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program 
Files\Git\mingw64\bin\git.exe"
  Killing any running python_d.exe instances...
  Getting build info from "C:\Program Files\Git\mingw64\bin\git.exe"
  Building heads/master:a997c7b434 master
  pythoncore.vcxproj -> D:\repos\cpython\PCbuild\amd64\python37_d.dll
  pythoncore.vcxproj -> D:\repos\cpython\PCbuild\amd64\python37_d.pdb (Full PDB)
  _ctypes_test.vcxproj -> D:\repos\cpython\PCbuild\amd64\_ctypes_test_d.pyd
  _ctypes_test.vcxproj -> D:\repos\cpython\PCbuild\amd64\_ctypes_test_d.pdb 
(Full PDB)
  _testbuffer.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testbuffer_d.pyd
  _testbuffer.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testbuffer_d.pdb (Full 
PDB)
  _testcapi.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testcapi_d.pyd
  _testcapi.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testcapi_d.pdb (Full PDB)
  _testembed.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testembed_d.exe
  _testembed.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testembed_d.pdb (Full 
PDB)
  _testimportmultiple.vcxproj -> 
D:\repos\cpython\PCbuild\amd64\_testimportmultiple_d.pyd
  _testimportmultiple.vcxproj -> 
D:\repos\cpython\PCbuild\amd64\_testimportmultiple_d.pdb (Full PDB)
  _testmultiphase.vcxproj -> 
D:\repos\cpython\PCbuild\amd64\_testmultiphase_d.pyd
  _testmultiphase.vcxproj -> 
D:\repos\cpython\PCbuild\amd64\_testmultiphase_d.pdb (Full PDB)
  _testconsole.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testconsole_d.pyd
  _testconsole.vcxproj -> D:\repos\cpython\PCbuild\amd64\_testconsole_d.pdb 
(Full PDB)
  pylauncher.vcxproj -> D:\repos\cpython\PCbuild\amd64\py_d.exe
  pylauncher.vcxproj -> D:\repos\cpython\PCbuild\amd64\py_d.pdb (Full PDB)
  pywlauncher.vcxproj -> D:\repos\cpython\PCbuild\amd64\pyw_d.exe
  pywlauncher.vcxproj -> D:\repos\cpython\PCbuild\amd64\pyw_d.pdb (Full PDB)
  pyshellext.vcxproj -> D:\repos\cpython\PCbuild\amd64\pyshellext_d.dll
  pyshellext.vcxproj -> D:\repos\cpython\PCbuild\amd64\pyshellext_d.pdb (Full 
PDB)
 Создается библиотека D:\repos\cpython\PCbuild\amd64\python3_dstub.lib и 
объект D:\repos\cpython\PCbuild\amd64\python3_dstub.exp
  _asyncio.vcxproj -> D:\repos\cpython\PCbuild\amd64\_asyncio_d.pyd
  _asyncio.vcxproj -> D:\repos\cpython\PCbuild\amd64\_asyncio_d.pdb (Full PDB)
  _ctypes.vcxproj -> D:\repos\cpython\PCbuild\amd64\_ctypes_d.pyd
  _ctypes.vcxproj -> D:\repos\cpython\PCbuild\amd64\_ctypes_d.pdb (Full PDB)
  _decimal.vcxproj -> D:\repos\cpython\PCbuild\amd64\_decimal_d.pyd
  _decimal.vcxproj -> D:\repos\cpython\PCbuild\amd64\_decimal_d.pdb (Full PDB)
  LINK : не найден или не выполнена сборка 
D:\repos\cpython\PCbuild\amd64\python3_d.dll при последней инкрементной 
компоновке; выполняется полная компоновка
  _elementtree.vcxproj -> D:\repos\cpython\PCbuild\amd64\_elementtree_d.pyd
  _elementtree.vcxproj -> D:\repos\cpython\PCbuild\amd64\_elementtree_d.pdb 
(Full PDB)
python3_d.def : error LNK2001: неразрешенный внешний символ 
"PyThread_tss_alloc" [D:\repos\cpython\PCbuild\python3dll.vcxproj]
python3_d.def : error LNK2001: неразрешенный внешний символ 
"PyThread_tss_create" [D:\repos\cpython\PCbuild\python3dll.vcxproj]
python3_d.def : error LNK2001: неразрешенный внешний символ 
"PyThread_tss_delete" [D:\repos\cpython\PCbuild\python3dll.vcxproj]
python3_d.def : error LNK2001: неразрешенный внешний символ "PyThread_tss_free" 
[D:\repos\cpython\PCbuild\python3dll.vcxproj]
python3_d.def : error LNK2001: неразрешенный внешний символ "PyThread_tss_get" 
[D:\repos\cpython\PCbuild\python3dll.vcxproj]
python3_d.def : error LNK2001: неразрешенный внешний символ 
"PyThread_tss_is_created" [D:\repos\cpython\PCbuild\python3dll.vcxproj]
python3_d.def : error LNK2001: неразрешенный внешний символ "PyThread_tss_set" 
[D:\repos\cpython\PCbuild\python3dll.vcxproj]
D:\repos\cpython\PCbuild\amd64\python3_d.lib : fatal error LNK1120: 
неразреш

[issue31583] 2to3 call for file in current directory yields error

2017-09-25 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


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

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



[issue31583] 2to3 call for file in current directory yields error

2017-09-25 Thread Denis Osipov

New submission from Denis Osipov:

2to3 doesn't work if called for file in current directory with --add-suffix 
option.

$ /d/repos/cpython/python.bat /d/repos/cpython/Tools/scripts/2to3 -n -W 
--add-suffix=3 test2to3.py
Running Debug|x64 interpreter...
WARNING: --write-unchanged-files/-W implies -w.
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored test2to3.py
--- test2to3.py (original)
+++ test2to3.py (refactored)

--some changes--

Traceback (most recent call last):
  File "D:/repos/cpython/Tools/scripts/2to3", line 5, in 
sys.exit(main("lib2to3.fixes"))
  File "D:\repos\cpython\lib\lib2to3\main.py", line 259, in main
options.processes)
  File "D:\repos\cpython\lib\lib2to3\refactor.py", line 687, in refactor
items, write, doctests_only)
  File "D:\repos\cpython\lib\lib2to3\refactor.py", line 282, in refactor
self.refactor_file(dir_or_file, write, doctests_only)
  File "D:\repos\cpython\lib\lib2to3\refactor.py", line 728, in refactor_file
*args, **kwargs)
  File "D:\repos\cpython\lib\lib2to3\refactor.py", line 339, in refactor_file
write=write, encoding=encoding)
  File "D:\repos\cpython\lib\lib2to3\refactor.py", line 505, in processed_file
self.write_file(new_text, filename, old_text, encoding)
  File "D:\repos\cpython\lib\lib2to3\main.py", line 84, in write_file
os.makedirs(output_dir)
  File "D:\repos\cpython\\lib\os.py", line 221, in makedirs
mkdir(name, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''


It works well if I use absolute path for target file or set -o:

$ /d/repos/cpython/python.bat /d/repos/cpython/Tools/scripts/2to3 -n -W 
--add-suffix=3 /d/MyPythonScripts/test2to3.py

$ /d/repos/cpython/python.bat /d/repos/cpython/Tools/scripts/2to3 -n -W 
--add-suffix=3 -o . test2to3.py

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 303001
nosy: denis-osipov
priority: normal
severity: normal
status: open
title: 2to3 call for file in current directory yields error
type: behavior
versions: Python 3.6, Python 3.7

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



[issue27426] Encoding mismatch causes some tests to fail on Windows

2017-09-25 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
keywords: +patch
pull_requests: +3727
stage: needs patch -> patch review

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2017-09-25 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


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

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



[issue31498] Default values for zero in time.strftime()

2017-09-20 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov

Denis Osipov added the comment:

Thank you for your answers. It's what I want to know. It looks like I shouldn't 
try to fix (to break) something that works well enough.

If nobody minds I'll close the issue with not a bug resolution.

--

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



[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov

Denis Osipov added the comment:

Actually now Python time.strftime not always returns the same value as C 
strftime with the same arguments, because timemodule make some refining of raw 
argument values to avoid errors.

--

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



[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov

Denis Osipov added the comment:

Yes, C strftime returns the same. Inside of Python time.strftime() in Windows 
we give struct tm with inconsistent attributes (year, mon, mday and wday,yday) 
as argument for C strftime().

Before it timemodule does a lot of work to parse arguments of time.strftime() 
and check if all values in obtained struct tm are correct. Also it force values 
of some attributes to correct ones. Why don't make one more step (e.g. call C 
mktime before C strftime) to give C function a struct time argument with all 
consistent attributes?

Or Python time.strftime() should return exactly the same as C strftime?

--

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



[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread Denis Osipov

Denis Osipov added the comment:

It seems strange to me that time.strftime() returns formatted date with wrong 
day of week and day of year values. So, I think it's probably a bug.
But I'm just learning Python and programming and I think that it can be 
intentional behavior.
If it's a bug I'd like to try to fix it. Otherwise could someone tell me why 
this behavior is OK?

--

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



[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread Denis Osipov

Denis Osipov added the comment:

If it's really a bug I could make PR with changes in timemodule.c (in 
gettmarg() and checktm() functions). But I'm not sure that it's not intended 
behavior.

--

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



[issue31498] Default values for zero in time.strftime()

2017-09-17 Thread Denis Osipov

New submission from Denis Osipov:

Now default values for zero in time.strftime returns string with day of week 
value 1:

>>> time.strftime("%Y %m %d %H %M %S %w %j", (2000,)+(0,)*8)
'2000 01 01 00 00 00 1 001'

while 2000-01-01 is Saturday (=6th day of week).

Now each illegal value (day of month < 1 etc.) are forced to a correct one (by 
the way why now day of week isn't 0=Sunday and forced to 1). Maybe strftime 
also should force day of week to according to the date (%Y %m %d) if it's given.

>>> time.strftime("%Y %m %d %H %M %S %w %j", (2000,)+(0,)*8)
'2000 01 01 00 00 00 6 001'

--
components: Interpreter Core
messages: 302374
nosy: denis-osipov
priority: normal
severity: normal
status: open
title: Default values for zero in time.strftime()
type: behavior
versions: Python 3.6, Python 3.7

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



[issue31381] Unable to read the project file "pythoncore.vcxproj".

2017-09-17 Thread Denis Osipov

Denis Osipov added the comment:

Fixed in PR 3397 (I guess).

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

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



[issue31381] Unable to read the project file "pythoncore.vcxproj".

2017-09-07 Thread Denis Osipov

Denis Osipov added the comment:

Thank you. Looking forward to it.

--

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



[issue31381] Unable to read the project file "pythoncore.vcxproj".

2017-09-07 Thread Denis Osipov

New submission from Denis Osipov:

Can't load pythoncore.vcxproj in VS2017 after PR 3375 bpo-31358: Pull zlib out 
of the repository #3375.

During pcbuild.sln loading there is error message:

D:\repos\cpython\PCbuild\pythoncore.vcxproj : error  : Unable to read the 
project file "pythoncore.vcxproj".
D:\repos\cpython\PCbuild\pythoncore.vcxproj(70,37): Specified condition 
"$(IncludeExternals)" evaluates to "" instead of a boolean.

--
components: Windows
messages: 301581
nosy: denis-osipov, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Unable to read the project file "pythoncore.vcxproj".
versions: Python 3.7

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



[issue31364] Possible problem with PR #3377

2017-09-06 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


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

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



[issue31364] Possible problem with PR #3377

2017-09-06 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
pull_requests: +3391

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



[issue31364] Possible problem with PR #3377

2017-09-06 Thread Denis Osipov

New submission from Denis Osipov:

It looks like last PR #3377 changing pytime.c (adding #include ) 
causing problem with compilation. Now on my Win10 i have multiple warnings and 
errors about ws2def.h, winsock.h and winsock2.h (see attached file).

--
components: Windows
files: output.txt
messages: 301455
nosy: denis-osipov, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Possible problem with PR #3377
type: compile error
versions: Python 3.7
Added file: http://bugs.python.org/file47123/output.txt

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



[issue30757] pyinstaller can be added to docs, py2exe ref can be updated

2017-06-25 Thread Denis Akhiyarov

Changes by Denis Akhiyarov <denis.akhiya...@gmail.com>:


--
pull_requests: +2443

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



[issue30757] pyinstaller can be added to docs, py2exe ref can be updated

2017-06-25 Thread Denis Akhiyarov

New submission from Denis Akhiyarov:

https://github.com/python/cpython/pull/1158

It is not clear why this FAQ item is written in addition to this document:

https://github.com/python/cpython/blob/master/Doc/faq/windows.rst#how-do-i-make-python-scripts-executable

https://github.com/python/cpython/blob/master/Doc/faq/programming.rst#how-can-i-create-a-stand-alone-binary-from-a-python-script

--
assignee: docs@python
components: Documentation
messages: 296844
nosy: denfromufa, docs@python
priority: normal
severity: normal
status: open
title: pyinstaller can be added to docs, py2exe ref can be updated
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-08 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


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

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-08 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
versions: +Python 3.5, Python 3.6

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-08 Thread Denis Osipov

Denis Osipov added the comment:

Tests on Windows buildbots passed. I've made PR for 3.5 and 3.6 backporting.

--

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-08 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
pull_requests: +2067

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-08 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
pull_requests: +2066

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread Denis Osipov

Denis Osipov added the comment:

Using the numeric SID instead of localized name in test_access_denied works for 
me (I've made PR).

--

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread Denis Osipov

Changes by Denis Osipov <osipo...@list.ru>:


--
pull_requests: +2046

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread Denis Osipov

New submission from Denis Osipov:

test_os fails on non-English (Russian) Windows 7 Home Extended 6.1.7601 x64

==
ERROR: test_access_denied (test.test_os.StatAttributeTests)
--
Traceback (most recent call last):
  File "C:\repos\cpython\lib\test\test_os.py", line 476, in test_access_denied
creationflags=DETACHED_PROCESS
  File "C:\repos\cpython\lib\subprocess.py", line 293, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['icacls.exe', 'C:\\Users\\User\

\AppData\\Local\\Temp\\@test_6804_tmp', '/deny', 'Users:(S)']' returned 
non-zero 

exit status 1332.

--
Ran 250 tests in 5.120s

FAILED (errors=1, skipped=92)
test_os failed

1 test failed:
test_os

Total duration: 5 sec
Tests result: FAILURE

There is no group BUILTIN\Users on my Windows. There is BUILTIN\Пользователи 
instead.

--
components: Tests
messages: 295315
nosy: denis-osipov
priority: normal
severity: normal
status: open
title: test_os fails on non-English (Russian) Windows
type: behavior
versions: Python 3.7

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



ANN: Lea 2.3 released

2017-05-02 Thread Pierre Denis
Lea 2.3 is now released!
---> http://pypi.python.org/pypi/lea/2.3.4

What is Lea?

Lea is a Python package aiming at working with discrete probability
distributions in an intuitive way. It allows you to model a broad range of
random phenomenons, like dice throwing, coin tossing, gambling, finance,
weather, etc. It offers high-level modeling features for probabilistic
programming and Bayesian inference. Lea has several original features: the
storage of probabilities as integer weights, an inference algorithm that
produces *exact* results and a strong emphasis on ease-of-use. Lea is
lightweight, open-source (LGPL) and pure Python, with support of versions 2
and 3). See project page below for installation, tutorials, examples, etc.

What's new in Lea 2.3?
--
Compared to latest version (2.2), few things, although important, have been
added.

* A new method, 'switch', allows you to make efficient Bayesian networks.
For variables having many dependences, there is a dramatic speed improvement
regarding the 'buildCPT' method available so far. The new method is fully
documented in the wiki page dedicated to Bayesian inference, which has been
updated in depth: http://bitbucket.org/piedenis/lea/wiki/LeaPyTutorial2.

* A new method, 'internal', allows you to see what's inside any Lea instance
(should you be curious of that).

* Bugs on some secondary methods have been fixed.

* Last but not least, for those of you interested in information theory, two
new methods have been added to calculate joint entropy and conditional
entropy (aka equivocation):
http://bitbucket.org/piedenis/lea/wiki/LeaPyTutorial1#markdown-header-mutual
-information-joint-and-conditional-entropy

What's *in* Lea?

Lea uses an original probabilistic inference algorithm called the *Statues
algorithm*. This relies on the generator construct, a special case of
coroutine, embodied in Python with the 'yield' statement. Should you be
interested in this topic:
- you could have a look at the MicroLea project, which implements no more
than the core Statues algorithm (http://bitbucket.org/piedenis/microlea);
- be informed that I've written a paper (draft/unpublished) that describes
this algorithm in details; if you required it to me, I can provide you this
paper; BTW, I would be glad to receive your feedbacks/advices for a
potential submission.

Lea project page

http://bitbucket.org/piedenis/lea

Documentation
-
http://bitbucket.org/piedenis/lea/wiki/Home

Download Lea (PyPI)
---
http://pypi.python.org/pypi/lea/2.3.4

With the hope that Lea can make the World less uncertain,

Pierre Denis


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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Python.NET (pythonnet) 2.3.0 released

2017-03-17 Thread Denis Akhiyarov
Python.NET (pythonnet) 2.3.0 released with docker, nuget, pip, conda, and 
source installation options. Python.NET based CPython extensions can be 
packaged with PyInstaller and cx_freeze hooks.

https://github.com/pythonnet/pythonnet/releases/tag/v2.3.0

https://github.com/pythonnet/pythonnet/wiki/Installation



Added

Added Code Coverage (#345)
Added PySys_SetArgvEx (#347)
Added XML Documentation (#349)
Added Embedded_Tests on AppVeyor (#224)(#353)
Added Embedded_Tests on Travis (#224)(#391)
Added PY3 settings to solution configuration-manager (#346)
Added Slack (#384)(#383)(#386)
Added function of passing an arbitrary .NET object as the value
of an attribute of PyObject (#370)(#373)
Added Coverity scan (#390)
Added bumpversion for version control (#319)(#398)
Added tox for local testing (#345)
Added requirements.txt
Added to PythonEngine methods Eval and Exec (#389)
Added implementations of ICustomMarshal (#407)
Added docker images (#322)
Added hooks in pyinstaller and cx_freeze for pythonnet (#66)
Added nuget packages (#165)

Changed

Refactored python unittests (#329)
Refactored python setup.py (#337)
Refactored remaining of Build Directives on runtime.cs (#339)
Refactored Embedded_Tests to make easier to write tests (#369)
Changed unittests to pytest (#368)
Upgraded NUnit framework from 2.6.3 to 3.5.0 (#341)
Downgraded NUnit framework from 3.5.0 to 2.6.4 (#353)
Upgraded NUnit framework from 2.6.4 to 3.6.0 (#371)
Unfroze Mono version on Travis (#345)
Changed conda.recipe build to only pull-requests (#345)
Combine Py_DEBUG and PYTHON_WITH_PYDEBUG flags (#362)


Deprecated

Deprecated RunString (#401)


Fixed

Fixed crash during Initialization (#262)(#343)
Fixed crash during Shutdown (#365)
Fixed multiple build warnings
Fixed method signature match for Object Type (#203)(#377)
Fixed outdated version number in AssemblyInfo (#398)
Fixed wrong version number in conda.recipe (#398)
Fixed fixture location for Python tests and Embedded_Tests
Fixed PythonException crash during Shutdown (#400)
Fixed AppDomain unload during GC (#397)(#400)
Fixed Py_Main & PySys_SetArgvEx no mem error on UCS4/PY3 (#399)
Fixed Python.Runtime.dll.config on macOS (#120)
Fixed crash on PythonEngine.Version (#413)
Fixed PythonEngine.PythonPath issues (#179)(#414)(#415)


Removed

Removed six dependency for unittests (#329)
Removed Mono.Unix dependency for UCS4 (#360)
Removed need for Python.Runtime.dll.config
Removed PY32 build option PYTHON_WITH_WIDE_UNICODE (#417)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Python for .NET (pythonnet) v2.2.2 with Python 3.6 support

2017-01-30 Thread Denis Akhiyarov
Download from PYPI using pip or from Anaconda using conda:

https://pypi.python.org/pypi/pythonnet/2.2.2

https://anaconda.org/pythonnet/pythonnet
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: What are your opinions on .NET Core vs Python?

2017-01-29 Thread denis . akhiyarov
On Sunday, January 29, 2017 at 4:00:27 PM UTC-6, Gregory Ewing wrote:
> Joseph L. Casale wrote:
> >>.NET is a library that can be used from many languages, including Python. 
> >
> > No.
> 
> Yes:
> 
> http://pythonnet.sourceforge.net/
> 
> "Python for .NET is a package that gives Python programmers nearly seamless 
> integration with the .NET Common Language Runtime (CLR) and provides a 
> powerful 
> application scripting tool for .NET developers. Using this package you can 
> script .NET applications or build entire applications in Python, using .NET 
> services and components written in any language that targets the CLR (Managed 
> C++, C#, VB, JScript)."
> 
> -- 
> Greg

This is outdated location. pythonnet (python for .NET) is on GitHub since 2014.

https://github.com/pythonnet/pythonnet

We just released v2.2.2 with Python 3.6 support and transition to MIT license.

Download from PYPI using pip or from Anaconda using conda:

https://pypi.python.org/pypi/pythonnet/2.2.2
https://anaconda.org/pythonnet/pythonnet

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


Re: Build desktop application using django

2016-10-17 Thread Denis Akhiyarov
Have a look at automatic web app builder using Django or Flask called Wooey 
based Gooey.

https://github.com/wooey/Wooey
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: announcing fython

2016-10-02 Thread Denis Akhiyarov
On Sunday, October 2, 2016 at 10:57:57 AM UTC-5, nicolases...@gmail.com wrote:
> >One problem with using very similar syntax for distinct languages is that it 
> >can get confusing.
> 
> The first inspiration for Fython was to be close to Fortran, while improving 
> the syntax. The project is in the early days, so all suggestions are welcome.
> Some difference to the Python language are inevitable though, as Fython is a 
> compiled language.
> 
> >does an actual Fortran compiler need to be invoked? 
> 
> Yes, this is done in the background.
> 
> 
> >And do you need to install one, or is it all included?
> 
> A Fortran compiler must be avalaible on the machine.
> A free often used compiler is gfortran.
> 
> 
> >If so, at what point in the above example is it invoked? 
> >Is it every time you run that Python code, or will the load() used a cached 
> >copy of the compiled mean.fy? 
> 
> The compiler is invoked whenever the Fython sources are new or have changed.
> A cached copy is used to avoid unnessecary compilation.

Have you looked at f2py? You can write Fortran and then use it Python by just 
wrapping it with f2py. Actually this is a project bundled in numpy. There is 
also fortran magic for Jupyter notebooks. f90wrap extends f2py to support 
modern Fortran.

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


Python for .NET (pythonnet) 2.2.0.dev1 new development release available

2016-09-21 Thread Denis Akhiyarov
Hello Python and .NET developers,

New pythonnet 2.2.0.dev1 version with (pre-)release notes are available for
download from PYPI and GitHub:


https://pypi.python.org/pypi/pythonnet/2.2.0.dev1

Note that since this is pre-release, use this command for installation:

pip install pythonnet --pre -U

Detailed release notes:

https://github.com/pythonnet/pythonnet/releases

News

   - clrmagic for IPython kernel 
   - presentation on PyOhio 2016
   
   - 3 new pythonnet core developers @denfromufa
    @filmor 
   @vmuriart 
   - 26+1 contributors
   

Changelog

   - Switch to C# 6.0 (#219
   )
   - Relative imports (#219
   )
   - Recursive types (#250 
   )
   - Demo fix - stream reading (#225
   )
   - setup.py improvements for locating build tools (#208
   )
   - unmanaged exports updated (#206
   )
   - Mono update pinned to 4.2.4.4 (#233
   )
   - Documentation update (http://pythonnet.github.io/)
   - wiki added (https://github.com/pythonnet/pythonnet/wiki)

Known Issues

   - Subclassing .NET classes (#264
   )
   - Mixing python and .NET constructors (#252
   )
   - License update (one blocking contributor @tiran
    out of 27)
   - Overloading on constructors, ref/out and subtypes (#265
   )
   - pythonhome and pythonpath (#186
   )
   - Regression bug on numpy arrays (#249
   )
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Pythons for .Net

2016-09-05 Thread Denis Akhiyarov
On Saturday, September 3, 2016 at 8:53:18 PM UTC-5, Steve D'Aprano wrote:
> On Sat, 3 Sep 2016 12:34 pm, Denis Akhiyarov wrote:
> 
> > Finally if anyone can contact Christian Heimes (Python Core Developer),
> > then please ask him to reply on request to update the license to MIT:
> > 
> > https://github.com/pythonnet/pythonnet/issues/234
> > 
> > He is the only contributor that prevents updating to MIT license.
> 
> 
> I have emailed him off-list.
> 
> Thanks for the information on PythonNet, Denis.
> 
> 
> 
> -- 
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.

Emailing and twitter did not help either.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pythons for .Net

2016-09-02 Thread Denis Akhiyarov
On Sunday, July 24, 2016 at 11:30:09 PM UTC-5, Steven D'Aprano wrote:
> Yes, I said Pythons plural :-)
> 
> For those wanting to use Python on .Net or Mono, there is some good news.
> 
> Firstly, the venerable old "Python for .Net" project is still alive, and now
> supports up to Python 3.5 on .Net or Mono. PythonNet, as this is known,
> integrates the regular CPython interpreter with .Net or Mono.
> 
> Secondly, we can also expect that IronPython will have a new lease of life.
> Continuing on the work of their predecessor, Jeff Hardy, the IronPython
> project now has two tech leads who will carry it forward: Alex Earl and
> Benedikt Eggers.
> 
> https://thelasttechie.com/2016/07/24/its-back-python-for-net/
> 
> 
> IronPython is a reimplementation of Python, written in C# as managed code
> for .Net. It doesn't use a GIL, and is sometimes considered a little faster
> than CPython, so this is good news for the Python ecosystem.
> 
> IronPython:
> http://ironpython.net/
>  
> Python for .Net:
> https://github.com/pythonnet/pythonnet
> http://pythonnet.github.io/
> https://pypi.python.org/pypi/pythonnet
> 
> 
> 
> 
> -- 
> Steven
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.

Hello Steven,

I'm one of the contributors to pythonnet. We strive for compatibility with 
IronPython, but also have a simplified embedding interface and support Python 3 
+ C-Extensions such as numpy, scipy, sklearn.

If anyone is interested in learning pythonnet, then try it out from PYPI or 
github and use this tutorial:

https://pythonnet.github.io/readme.html

There is also a mailing list and a tag on stackoverflow:

https://mail.python.org/mailman/listinfo/pythondotnet
http://stackoverflow.com/questions/tagged/python.net

Finally if anyone can contact Christian Heimes (Python Core Developer), then 
please ask him to reply on request to update the license to MIT:

https://github.com/pythonnet/pythonnet/issues/234

He is the only contributor that prevents updating to MIT license.

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


[issue6818] remove/delete method for zipfile/tarfile objects

2016-05-25 Thread Denis Akhiyarov

Denis Akhiyarov added the comment:

has this been merged?

--
nosy: +Denis Akhiyarov

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



ANN: Lea 2.2.0

2016-05-04 Thread Pierre Denis
Lea 2.2.0 is now released!

What is Lea?

Lea is a Python package aiming at working with discrete probability
distributions in an intuitive way. It allows you to model a broad range of
random phenomenons, like dice throwing, coin tossing, gambling, finance,
weather, etc. It offers high-level modeling features for probabilistic
programming and bayesian inference. Lea has several original features: the
storage of probabilities as integer weights, an inference algorithm that
produces *exact* results and a strong emphasis on ease-of-use. Lea is
lightweight, open-source (LGPL) and pure Python, with support of versions 2
and 3). See project page below for installation, tutorials, examples, etc.

What's new in Lea 2.2.0?

Compared to latest version (2.1.2), many things have been made to improve
ease-of-use and overall performance. Maybe one of the most notable feature
is that you can now get individual probabilities very easily, as a fraction
or float, thanks to the new 'P' and 'Pf' functions. Here are some examples
that you can type in your Python console:

>>> P(dice <= 5)
5/18
>>> Pf(dice <= 5)
0.2778
>>> P(rain.given(grassWet))
891/2491
>>> Pf(rain.given(grassWet))
0.3576876756322762

Other new features include:
- build joint probability distributions from CSV files or Pandas dataframes
- pmf histograms using matplotlib
- Monte-Carlo sampling estimation
- multi-arguments 'given' method (ANDing of evidences)
- likelihood ratio
- extended 'draw' method: with/without sorting, with/without replacement
- machine learning (experimental)
- built-in functions and distributions for games
- various optimizations

Most of the new features are documented in a new tutorial on Lea's wiki
(http://bitbucket.org/piedenis/lea/wiki/LeaPyTutorial3).

Credits
---
Thanks to all of you for this large bunch of feedbacks, encouragements and
suggestions! In particular, the present version owes much to Paul Moore, who
made important contributions; among other things, Paul fixed the
installation procedure, set up a test suite using the Tox tool and created
an efficient algorithm for calculating probability distribution resulting
from a drawing process. Thanks Paul for making the package more mature!

Lea project page

http://bitbucket.org/piedenis/lea

Download Lea (PyPI)
---
http://pypi.python.org/pypi/lea


With the hope that Lea can make your joy less random,

Pierre Denis

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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue26636] SystemError while running tests: extra exception raised

2016-03-25 Thread Denis

Denis added the comment:

Thank you!  
The error  was that some calls in pycrypto code were aggregated and exceptions 
in those calls were ignored.
Here is the patch for pycrypto that fixed the build.

@@ -1427,7 +1429,9 @@ getStrongPrime (PyObject *self, PyObject *args, PyObject 
*kwargs)
Py_BLOCK_THREADS;
res = 1;
res &= getRandomRange (X, lower_bound, upper_bound, randfunc);
+   if (res!=0)
res &= getRandomNBitInteger (y[0], 101, randfunc);
+   if (res!=0)
res &= getRandomNBitInteger (y[1], 101, randfunc);
Py_UNBLOCK_THREADS;

So this code tried to aggregate exceptions before propagating them, that was 
the reason for exception.

--
resolution:  -> not a bug

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



[issue26636] SystemError while running tests: extra exception raised

2016-03-24 Thread Denis

New submission from Denis:

Looks like related to Issue23571
Probably same issue as in Django, but in other Python module.

While compiling python-module-crypto:

= 
ERROR: test_getStrongPrime_randfunc_bogus 
(Crypto.SelfTest.Util.test_number.FastmathTests) 
Test that when getStrongPrime is called, an exception is raised if randfunc 
returns something bogus. 
-- 
TypeError: randfunc must return a string of random bytes 

During handling of the above exception, another exception occurred: 

SystemError: PyEval_EvalFrameEx returned a result with an error set 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
 File "build/lib.linux-i686-3.5/Crypto/SelfTest/Util/test_number.py", line 322, 
in test_getStrongPrime_randfunc_bogus 
   self.assertRaises(TypeError, number._fastmath.getStrongPrime, 512, 
randfunc=randfunc) 
 File "/usr/lib/python3.5/unittest/case.py", line 765, in assertRaises 
   return context.handle('assertRaises', args, kwargs) 
 File "/usr/lib/python3.5/unittest/case.py", line 214, in handle 
   callable_obj(*args, **kwargs) 
SystemError: PyEval_EvalFrameEx returned a result with an error set 

== 
ERROR: test_getStrongPrime_randfunc_exception 
(Crypto.SelfTest.Util.test_number.FastmathTests) 
Test that when getStrongPrime is called, an exception raised in randfunc is 
propagated. 
-- 
Crypto.SelfTest.Util.test_number.MyError 

During handling of the above exception, another exception occurred: 

SystemError:  returned a 
result with an error set 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
 File "build/lib.linux-i686-3.5/Crypto/SelfTest/Util/test_number.py", line 308, 
in test_getStrongPrime_randfunc_exception 
   self.assertRaises(MyError, number._fastmath.getStrongPrime, 512, 
randfunc=randfunc) 
 File "/usr/lib/python3.5/unittest/case.py", line 765, in assertRaises 
   return context.handle('assertRaises', args, kwargs) 
 File "/usr/lib/python3.5/unittest/case.py", line 214, in handle 
   callable_obj(*args, **kwargs) 
 File "build/lib.linux-i686-3.5/Crypto/SelfTest/Util/test_number.py", line 307, 
in randfunc 
   raise MyError 
SystemError:  returned a 
result with an error set 

The file that cause that exception can be found at

http://git.altlinux.org/gears/p/python-module-pycrypto.git?p=python-module-pycrypto.git;a=blob;f=lib/Crypto/SelfTest/Util/test_number.py;h=ac23e917b6e7d982a33fff0a14bec3e769500ba0;hb=86c4aa4683cd89f89c3d01a689efa525f961d340

--
components: Interpreter Core
messages: 262349
nosy: nbr_alt
priority: normal
severity: normal
status: open
title: SystemError while running tests: extra exception raised
type: behavior
versions: Python 3.5

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



Re: Inception

2016-03-03 Thread Denis Akhiyarov
Thank you Paul and Christian for your reply and understanding my question. I 
was actually inspired by this example for IronPython and thought that this is 
pretty useful for testing and exploring of C-API:

http://www.voidspace.org.uk/ironpython/ip_in_ip.shtml

So does it all boil down to GIL restriction in CPython?



On Thursday, March 3, 2016 at 2:10:15 AM UTC-6, Christian Gollwitzer wrote:
> Hi Denis,
> 
> Am 03.03.16 um 06:01 schrieb Denis Akhiyarov:
> > Is it possible to embed CPython in CPython, e.g. using ctypes, cffi, or 
> > cython?
> >
> 
> since you titled your question with a famous movie title, I take it more 
> as a "philosophical" question (musing about the CPython world) than an 
> actual demand. Technically, I think it cannot work with the current 
> state of CPython. Embedding CPython into another application requires 
> you to load libpython3.5.so (or similar depending on OS and version) and 
> to call the functino sfrom within there. When a Python program runs in 
> the standalone interpreter, then this DLL is already loaded, obviously, 
> so the question is if the Python C API functions can be called from a 
> Python script.
> 
> Possibly  ctypes or cffi can do that for you, but you would end up with 
> the same interpreter that executes your main script. A DLL is loaded by 
> the OS only once, which makes it possible to create plugin interfaces 
> etc. using shared symbols in C.
> 
> Now, the CPython interpreter saves its state in global variables. 
> Therefore only one interpreter can exist in a single process, and this 
> is also the reason that multithreading is complicated and does not 
> really work (GIL ).
> 
> How useful could it be to have more than a single interpreter? For 
> instance, Tcl does it in a different way. All of the interpreter state 
> is stored within a Tcl_Interp struct which is passed around to every API 
> function. You can create more than a single interpreter, and that even 
> works from the script level using the "interp create" command. This is 
> useful to shield user script evaluation from the main script. Such 
> interpreters can be made "safe", i.e. to not allow file operations, or 
> to limit the CPU time for script evaluation, which has its primary use 
> case in things like web browser plugins or simple servers. A pythonized 
> version of the API would look like this:
> 
> from pyembedding import Interp
> 
> i=Interp()
> i2=Interp(safe=True)
> 
> i.eval('print("Hello world")')
> # prints Hello world
> 
> i2.eval('print("Hello world")')
> # raises a SafeInterpException
> # I/O  is unsafe and disabled here
> 
> def greetme():
>   print("Hello world")
> 
> i2.alias(greet=greetme)
> i2.eval('greet')
> # calls back to greetme in main interpreter
> 
> This mechanism would also allow true multithreading. If you run another 
> interpreter in the second thread, it will have it's own GIL.
> 
> I'm not familiar with the internals of other Python implementation, but 
> I can imagine that maybe in Jython such an extension could be written.
> 
>   Christian

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


Re: Inception

2016-03-02 Thread Denis Akhiyarov
Embed using C-API from ctypes, cffi or cython, but not using subprocesses. 
Thanks for asking! 

Here is link to official documentation about embedding:

https://docs.python.org/3.6/extending/index.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Inception

2016-03-02 Thread Denis Akhiyarov
Is it possible to embed CPython in CPython, e.g. using ctypes, cffi, or cython?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Denis Akhiyarov
Note that you can continue using your existing vb6 code from python through COM 
using pywin32 or pythonnet, until you decide to rewrite it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-19 Thread Denis Akhiyarov
On Wednesday, February 17, 2016 at 1:49:44 PM UTC-6, wrong.a...@gmail.com wrote:
> I am mostly getting positive feedback for Python.
> 
> It seems Python is used more for web based applications. Is it equally fine 
> for creating stand-alone *.exe's? Can the same code be compiled to run on 
> Linux or Android or web-based?
> 
> Is it possible to create GUI elements with a good IDE? Can they be defined 
> like in Visual Basic with given sizes, fonts, visible/invisible, etc.?
> 
> Is it easy to do matrix operations in Python? Or do I need to write 
> subroutines like in Visual Basic?
> 
> Could someone kindly tell me advantages and disadvantages of Python? Or any 
> better options? I have like 40-50 VB Forms and may be around 2 lines of 
> code. It will be a task to learn a new language and translate/re-write that 
> code.
> 
> Thanks for your responses.

I'm surprised that no one mentioned this tool called vb2py. It looks outdated, 
but I actually used it successfully to convert vba code to python, once all 
dependencies were installed correctly :)

http://vb2py.sourceforge.net/

You can also understand how vb objects map to python objects.

vb2py has also minimal support for GUI conversion.

Someone has even forked it on github recently:

https://github.com/reingart/vb2py
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Denis McMahon
On Thu, 31 Dec 2015 10:18:52 -0800, otaksoftspamtrap wrote:

> Best to use re and how? Something else?

Split the string on the space character and check the first two non blank 
elements of the resulting list?

Maybe something similar to the following:

if [x for x in s.split(' ') if x != ''][0:3] == ['(', '(', '(']:
# string starts '((('

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Converting py files to .exe and .dmg

2015-12-28 Thread Denis McMahon
On Mon, 28 Dec 2015 07:35:18 -0800, Brian Simms wrote:

> I have done a lot of looking around online to find out how to convert
> Python files to .exe and .dmg files, but I am confused. Could someone
> provide pointers/advice as to how I can turn a Python file into a
> Windows .exe and Mac .dmg file.

Python files are scripts, they need to be run by an interpreter.

If you want an executable file, you need to compile them. I don't know if 
this is possible.

Otherwise, if you want to distribute the .py files, then the people you 
distribute them to will need to install a python interpreter on the 
machine they wish to execute them on.

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: Lea 2.2.0-beta.4

2015-12-23 Thread Pierre Denis
Hi all!

For those of you interested in probabilities and probabilistic programming, I’m
happy to announce that Lea 2.2.0 is now under beta-test.

What is Lea?

Lea is a Python package aiming at working with discrete probability
distributions in an intuitive way. It allows you to model a broad range of
random phenomenons, like dice throwing, coin tossing, gambling, weather, etc. It
offers several high-level modelling features for probabilistic programming,
including bayesian inference and Markov chains. Lea is open-source (LGPL) and
runs on Python 2 or 3. See project page below for more information
(installation, tutorials, examples, etc).

What’s new?
---
Compared to latest version (2.1.2), many things have been made in 2.2.0 to
improve ease-of-use and overall performance, without breaking backward
compatibility. Maybe one of the most notable feature is that you can now get
individual probability very easily, as a fraction or float, thanks to the new
'P' and 'Pf' functions, e.g.

>>> P(dice <= 5)
5/18
>>> Pf(dice <= 5)
0.2778
>>> P(rain.given(grassWet))
891/2491
>>> Pf(rain.given(grassWet))
0.3576876756322762

New methods allow you to read a CSV file or Pandas dataframe, then build the
corresponding joint probability distribution. Also, Monte-Carlo sampling
estimation is now available, should Lea’s default exact evaluation is
intractable. Most of the new features are documented in a new tutorial on Lea's
wiki (https://bitbucket.org/piedenis/lea/wiki/LeaPyTutorial3).

The latest version, Lea 2.2.0-beta.4, is fairly stable (no known bug) so you can
start to use it and report any problem or dislike, if any.

Lea project page

https://bitbucket.org/piedenis/lea

Download Lea (PyPI)
---
http://pypi.python.org/pypi/lea

With the hope that Lea can make the Force less uncertain,

Pierre Denis
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


  1   2   3   4   5   6   7   >