[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



[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



[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



[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



[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



[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



[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



[issue25841] In FancyURLopener error in example with http address.

2015-12-11 Thread Denis Savenko

New submission from Denis Savenko:

In documentation from this page 
https://docs.python.org/3.5/library/urllib.request.html#examples in examples 
uses default address to python site with http. ( http://python.org/ ). But now 
python.org use https. When i try use example in ipython i get I/0 error, but 
error is very simple - http change by https. I found this error on many pages, 
where use http://python.org/ address, but on FancyURLopener example compiller 
error very difficult for understanding.

--
assignee: docs@python
components: Documentation
messages: 256221
nosy: Denis Savenko, docs@python
priority: normal
severity: normal
status: open
title: In FancyURLopener error in example with http address.
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue6331] Add unicode script info to the unicode database

2015-10-17 Thread Denis Jacquerye

Changes by Denis Jacquerye <moy...@gmail.com>:


--
nosy: +Denis Jacquerye

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



[issue22612] Add block info to unicodedata

2015-10-17 Thread Denis Jacquerye

Changes by Denis Jacquerye <moy...@gmail.com>:


--
nosy: +Denis Jacquerye

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



[issue24504] os.listdir() error if the last folder starts not with the capital letter

2015-06-24 Thread Denis Gordeev

New submission from Denis Gordeev:

My code is:
mypath = 'Z:\Pr Files\norma'
file_list = [ f for f in listdir(mypath) if isfile(join(mypath,f))]

Error:
Traceback (most recent call last):
  File C:\Documents and Settings\Administrator\Desktop\uni\click zhenilo 
workshop\noise.py, line 13, in module
file_list = [ f for f in listdir(mypath) if isfile(join(mypath,f))]
WindowsError: [Error 123] The filename, directory name, or volume label syntax 
is incorrect: 'Z:\\Pr Files\norma/*.*'

It works all right, if the path is:
mypath = 'Z:\Pr Files\Norma'

--
components: Windows
messages: 245777
nosy: Denis Gordeev, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.listdir() error if the last folder starts not with the capital letter
versions: Python 2.7

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin

Denis Sukhonin added the comment:

It returns an integer.

 import os
 os.open('/tmp/test', os.O_RDONLY)
3

--

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin

Denis Sukhonin added the comment:

No, it throws 22.

 os.listdir(os.open('/tmp/test', os.O_RDONLY))
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 22] Invalid argument

--

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin

Denis Sukhonin added the comment:

The same problem.

 os.listdir(os.open('/tmp/test/', os.O_RDONLY))
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 22] Invalid argument

--

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-28 Thread Denis Sukhonin

New submission from Denis Sukhonin:

shutil.rmtree doesn't work correctly on FreeBSD 9.1.

For example if I create a path /tmp/test and try to remove it, I get an 
exception:

 shutil.rmtree('/tmp/test')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python3.4/shutil.py, line 463, in rmtree
_rmtree_safe_fd(fd, path, onerror)
  File /usr/local/lib/python3.4/shutil.py, line 385, in _rmtree_safe_fd
onerror(os.listdir, path, sys.exc_info())
  File /usr/local/lib/python3.4/shutil.py, line 382, in _rmtree_safe_fd
names = os.listdir(topfd)
OSError: [Errno 22] Invalid argument: '/tmp/test'

---

shutil._use_fd_functions has value True. When I change it to False, the 
shutil.rmtree works perfecty.

Version info:
 print(sys.version)
3.4.2 (default, Dec 22 2014, 21:56:20) 
[GCC 4.2.1 20070831 patched [FreeBSD]]
 print(sys.platform)
freebsd9

$ uname -r
9.1-RELEASE

--
components: Library (Lib)
messages: 234946
nosy: negval
priority: normal
severity: normal
status: open
title: shutil.rmtree doesn't work correctly on FreeBSD.
type: behavior
versions: Python 3.4

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



[issue22438] eventlet broke by python 2.7.x

2014-11-07 Thread Denis Bilenko

Denis Bilenko added the comment:

gevent's ssl support is also broken by 2.7.9.

https://github.com/gevent/gevent/issues/477

IMO, it is totally unexpected to have some API (even though it's undocumented 
and internal) removed in non-major release.

Even though both gevent and eventlet can be fixed, there still be combinations 
of versions that break (python = 2.7.9  gevent = 1.0.1)

Please put _ssl.sslwrap back. It would save a lot of people a lot of time. I 
don't mind fixing gevent not to use it, but there's nothing I can do about 
versions already released.

--
nosy: +Denis.Bilenko

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



[issue18587] urllib raises exception with string in 'errno' attribute

2013-07-29 Thread Denis

New submission from Denis:

On 'connection refused' error urllib creates IOError with wrong arguents:
args ('socket error', error(os-dependent-number, 'Connection refused'))

It results to dirty hacks in Python code like
  'if e.errno == socket error: ...'

instead of traditional

  'id e.errno == errno.ECONNREFUSED: ...'

--
files: pyerror.py
messages: 193878
nosy: denkoren
priority: normal
severity: normal
status: open
title: urllib raises exception with string in 'errno' attribute
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file31075/pyerror.py

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



[issue15896] Sporadic EINVAL in nonblocking pipe os.read when forked child fails on Mac OS

2012-09-10 Thread Denis Bilenko

Changes by Denis Bilenko denis.bile...@gmail.com:


--
nosy: +Denis.Bilenko

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



[issue10496] import site failed when Python can't find home directory

2011-04-01 Thread Denis Barmenkov

Denis Barmenkov denis.barmen...@gmail.com added the comment:

I saw similar error on Python 2.6 installed on freeBSD.
I had test SVN server and wrote pre-commit hook using python. When remote 
developer commited his changes to repository, hook called os.path.expanduser 
and exception was raised:
#  File /usr/local/lib/python2.6/posixpath.py, line 259, in expanduser
#userhome = pwd.getpwuid(os.getuid()).pw_dir
#KeyError: 'getpwuid(): uid not found: 12345'

So its not a just-Linux issue.

--
nosy: +Denis.Barmenkov

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



[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-20 Thread Denis S. Otkidach

Denis S. Otkidach denis.otkid...@gmail.com added the comment:

Phillip, your argument about interfacing with code written in C doesn't work 
for built-in immutable types like str. Any subclass of str must call 
str.__new__ thus keeping proper internal state.

--

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



[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-19 Thread Denis S. Otkidach

Denis S. Otkidach denis.otkid...@gmail.com added the comment:

Current behavior is unpythonic: documentation explicitly mentions isinstance as 
preferred way to check type (see http://docs.python.org/library/types.html ).

Also 2.7 is the last minor version with str as main string type. So I believe 
it should use isinstance(val, basestring) to help transition to Python 3.

--
nosy: +ods

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



[issue8571] zlib causes a SystemError when decompressing a chunk 1GB

2010-05-07 Thread Denis Dmitriev

Denis Dmitriev dmitr...@deshaw.com added the comment:

Is there a reason to keep inplen and max_length ints instead of making them 
Py_ssize_t too? I'm a little worried that keeping them ints will cause a 
similar problem further down the line.

--

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



[issue8571] zlib causes a SystemError when decompressing a chunk 1GB

2010-04-29 Thread Denis Dmitriev

New submission from Denis Dmitriev dmitr...@deshaw.com:

There's a bug in python's zlibmodule.c that makes it raise SystemError whenever 
it tries to decompress a chunk larger than 1GB is size. Here's an example of 
this in action:

dmitr...@...:~/moo/zlib_bug cat zlib_bug.py 
import zlib

def test_zlib(size_mb):
print testing zlib with a %dMB object % size_mb
c = zlib.compressobj(1)
sm = c.compress(' ' * (size_mb*1024*1024)) + c.flush()
d = zlib.decompressobj()
dm = d.decompress(sm) + d.flush()

test_zlib(1024)
test_zlib(1025)

dmitr...@...:~/moo/zlib_bug python2.6 zlib_bug.py 
testing zlib with a 1024MB object
testing zlib with a 1025MB object
Traceback (most recent call last):
  File zlib_bug.py, line 11, in module
test_zlib(1025)
  File zlib_bug.py, line 8, in test_zlib
dm = d.decompress(sm) + d.flush()
SystemError: Objects/stringobject.c:4271: bad argument to internal function

dmitr...@...:~/moo/zlib_bug

A similar issue was reported in issue1372; however, either this one is 
different, or the issue still exists in all versions of Python 2.6 that I 
tested, on both Solaris and Mac OS X. These are all 64-bit builds and have no 
problem manipulating multi-GB structures, so it's not an out-of-memory 
condition:

dmitr...@...:~/moo/zlib_bug python2.6   
Python 2.6.1 (r261:67515, Nov 18 2009, 12:21:47) 
[GCC 4.3.3] on sunos5
Type help, copyright, credits or license for more information.
 len(' ' * (6000*1024*1024))
6291456000


--
components: Library (Lib)
messages: 104522
nosy: ddmitriev
priority: normal
severity: normal
status: open
title: zlib causes a SystemError when decompressing a chunk 1GB
type: crash
versions: Python 2.6

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



[issue8571] zlib causes a SystemError when decompressing a chunk 1GB

2010-04-29 Thread Denis Dmitriev

Denis Dmitriev dmitr...@deshaw.com added the comment:

Alright, I think this is caused by the following:

static PyObject *
PyZlib_objdecompress(compobject *self, PyObject *args)
{
int err, inplen, old_length, length = DEFAULTALLOC;
int max_length = 0;

The problem is that inplen, length, old_length, and max_length are all ints, 
whereas they should be Py_ssize_t. I think replacing them should make the bug 
go away. (I can't test it right now though because I'm having trouble compiling 
zlibmodule on my current machine)

--

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



[issue7114] HTMLParser doesn't handle ![CDATA[ ... ]]

2009-12-08 Thread Denis

Denis pyt...@sokolov.cc added the comment:

The CDATA sections are part of XML specification.
http://www.w3.org/TR/REC-xml/#sec-cdata-sect

HTML is not XML, so HTMLParser does the right thing here.

--
nosy: +Denis

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



[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-11-24 Thread Denis S. Otkidach

Denis S. Otkidach denis.otkid...@gmail.com added the comment:

Here is a regexp I use to clean up text (note, that I don't touch 
compatibility characters that are also not recommended in XML; some 
other developers remove them too):

# http://www.w3.org/TR/REC-xml/#NT-Char
# Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | 
#  [#x1- #x10]
# (any Unicode character, excluding the surrogate blocks, FFFE, and 
)
_char_tail = ''
if sys.maxunicode  0x1:
_char_tail = u'%s-%s' % (unichr(0x1),
 unichr(min(sys.maxunicode, 0x10)))
_nontext_sub = re.compile(
ur'[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD%s]' % 
_char_tail,
re.U).sub
def replace_nontext(text, replacement=u'\uFFFD'):
return _nontext_sub(replacement, text)

--

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



[issue7101] tarfile: OSError with TarFile.add(..., recursive=True) about non-existing file

2009-10-10 Thread Denis Martinez

New submission from Denis Martinez deuns.marti...@gmail.com:

I have written a server backup script (file attached) which archives a
list of directories with tarfile and uploads the file to FTP. Today, the
script hanged, with an exception:

Exception in thread Thread-1:
Traceback (most recent call last):
  File /usr/lib/python2.6/threading.py, line 525, in __bootstrap_inner
self.run()
  File ./backup.py, line 48, in run
tar.add(file_or_directory, recursive=True)
  File /usr/lib/python2.6/tarfile.py, line 1981, in add
self.add(os.path.join(name, f), os.path.join(arcname, f), recursive,
exclude)
  File /usr/lib/python2.6/tarfile.py, line 1965, in add
tarinfo = self.gettarinfo(name, arcname)
  File /usr/lib/python2.6/tarfile.py, line 1834, in gettarinfo
statres = os.lstat(name)
OSError: [Errno 2] No such file or directory: '/srv/myfile.htdigest'

What I did here is that I removed the htdigest file while the tarfile
was archiving /srv. I haven't managed to reproduce the bug a second time.
It seems normal that tarfile shouldn't fail is this case; maybe it needs
some exception checking around the stat/lstat calls.

--
components: Library (Lib)
files: backup2.py
messages: 93845
nosy: denis
severity: normal
status: open
title: tarfile: OSError with TarFile.add(..., recursive=True) about 
non-existing file
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file15098/backup2.py

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



[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-06-25 Thread Denis S. Otkidach

Denis S. Otkidach denis.otkid...@gmail.com added the comment:

Every blog engine I've even seen so far pass through comments from
untrusted users to RSS/Atom feeds without proper validation causing
broken XML in feeds. Sure, this is a bug in web applications, but DOM
manipulation packages should prevent from creation broken XML to help
detecting errors earlier.

--

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



[issue1576598] ftplib doesn't follow standard

2009-03-30 Thread Denis S. Otkidach

Denis S. Otkidach denis.otkid...@gmail.com added the comment:

Yes, it's a problem in Python library. I believe the patch proposed by
Oleg in the issue821862 is the best solution to it.

--

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



[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-02-06 Thread Denis S. Otkidach

New submission from Denis S. Otkidach denis.otkid...@gmail.com:

ElementTree and minidom allow creation of not well-formed XML, that
can't be parsed:

 from xml.etree import ElementTree
 element = ElementTree.Element('element')
 element.text = u'\0'
 xml = ElementTree.tostring(element, encoding='utf-8')
 ElementTree.fromstring(xml)
[...]
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1,
column 9

 from xml.dom import minidom
 doc = minidom.getDOMImplementation().createDocument(None, None, None)
 element = doc.createElement('element')
 element.appendChild(doc.createTextNode(u'\0'))
DOM Text node 
 doc.appendChild(element)
DOM Element: element at 0xb7ca688c
 xml = doc.toxml(encoding='utf-8')
 minidom.parseString(xml)
[...]
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, colum

I believe they should raise some exception when there are characters 
not allowed in XML (http://www.w3.org/TR/REC-xml/#NT-Char) are used in
attribute values, text nodes and CDATA sections.

--
components: Library (Lib)
messages: 81259
nosy: ods
severity: normal
status: open
title: ElementTree and minidom don't prevent creation of not well-formed XML
type: behavior
versions: Python 2.5, Python 2.6, Python 3.0

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



[issue3924] cookielib chokes on non-integer cookie version, should ignore it instead

2008-09-21 Thread Denis

New submission from Denis [EMAIL PROTECTED]:

PROBLEM:

Some sites (e.g. https://itunesconnect.apple.com) sends cookies where
version is 1 instead of 1. Cookielib chokes on it so none of the
cookies work after that.

PROBLEM CODE:
def _cookie_from_cookie_tuple(self, tup, request):
...
name, value, standard, rest = tup
...
version = standard.get(version, None)
if version is not None: version = int(version)  CRASH HERE!!!



WORKAROUND:

use my own cookie jar, e.g.:

class MyCookieJar(CookieJar):
def _cookie_from_cookie_tuple(self, tup, request):
name, value, standard, rest = tup
standard[version]= None
CookieJar._cookie_from_cookie_tuple(self, tup, request)

REAL FIX:
do not assume that version is int, keep it as string if it does not
parse as int:

CRASH STACK:

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/cookielib.py:1577:
UserWarning: cookielib bug!
Traceback (most recent call last):
  File
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/cookielib.py,
line 1575, in make_cookies
parse_ns_headers(ns_hdrs), request)
  File
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/cookielib.py,
line 1532, in _cookies_from_attrs_set
cookie = self._cookie_from_cookie_tuple(tup, request)
  File
/Users/denis/Documents/svn2/tson/main/sales/src/download_sales.py,
line 28, in _cookie_from_cookie_tuple
CookieJar._cookie_from_cookie_tuple(self, tup, request)
  File
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/cookielib.py,
line 1451, in _cookie_from_cookie_tuple
if version is not None: version = int(version)
ValueError: invalid literal for int() with base 10: '1'

  _warn_unhandled_exception()

--
components: None
messages: 73518
nosy: DenNukem
severity: normal
status: open
title: cookielib chokes on non-integer cookie version, should ignore it instead
type: crash
versions: Python 2.5

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3924
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com