[issue44697] Memory leak when asyncio.open_connection raise

2021-07-22 Thread Andrey


Andrey  added the comment:

Confirmed. I have the same problem. I suspect this is related to 
https://bugs.python.org/issue41699.

--
nosy: +whoKilledLora

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



[issue44460] python crashes when pandas reading parquet

2021-06-19 Thread Andrey Brykin


Andrey Brykin  added the comment:

pandas version is 1.1.5

--

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



[issue44460] python crashes when pandas reading parquet

2021-06-19 Thread Andrey Brykin


New submission from Andrey Brykin :

Python crashes when running this code (I attached the error message screenshot):

import pandas as pd
d = {'col1': [[0.] * 25] * 2560}
df = pd.DataFrame(data=d)
df.to_parquet('data.parquet')
for j in range(15):
  table = pd.read_parquet('data.parquet')

There is no error when running from python 3.9.5 with the same pandas version. 
So it doesn't relate to pandas. 

The error happening with the exact list size of 2560 - no error with 2561 or 
2559. Another dimension is also important: there is no error if it is exceeding 
25.

I am running on Windows 10 2004.

--
components: IO, Windows
files: message.png
messages: 396124
nosy: brand17, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python crashes when pandas reading parquet
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file50118/message.png

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



[issue43771] [Windows] stdin line buffer size

2021-04-08 Thread Andrey Moiseev


New submission from Andrey Moiseev :

sys.stdin.readline() in Windows console only allows 512 characters on input per 
line. So large pastes are truncated at 512 chars, which is a bit inconvenient 
for prototyping.

The buffer size seems to be determined by BUFSIZ compile time constant:
https://github.com/python/cpython/blob/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Modules/_io/winconsoleio.c#L30-L31

In C, I am able to set a larger buffer at runtime with setvbuf() call:
setvbuf(stdin, NULL, 0, 2024);

But I can't seem to make it work through ctypes.cdll.msvcrt.setvbuf

--
components: Windows
messages: 390518
nosy: Andrey Moiseev, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] stdin line buffer size
type: enhancement
versions: Python 3.9

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



[issue43310] Method __del__ with callable

2021-02-23 Thread Andrey Petukhov


New submission from Andrey Petukhov :

Is it possible to use callable to replace __del__ method of class?

if so, how to get self variable?

class A(object):
"""A."""


class C(object):
"""Callable."""
def __call__(self, *args, **kwargs):
print("call", args, kwargs)


def func_del(*args, **kwargs):
"""Method."""
print("func", args, kwargs)


def del_function():
"""
Test del.

('func', (<__main__.A object at 0x7f8ae5a82750>,), {})
('call', (), {})
"""
c = C()
A.__del__ = func_del
a = A()
del a
A.__del__ = c
a = A()
del a

--
components: Interpreter Core
messages: 387609
nosy: andribas404
priority: normal
severity: normal
status: open
title: Method __del__ with callable
versions: Python 3.10

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-25 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


--
pull_requests: +23143
pull_request: https://github.com/python/cpython/pull/24323

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-25 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


--
pull_requests: +23142
pull_request: https://github.com/python/cpython/pull/24322

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



[issue42384] Inconsistent sys.path between python and pdb

2021-01-25 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


--
pull_requests: +23141
pull_request: https://github.com/python/cpython/pull/23412

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



[issue42384] Inconsistent sys.path between python and pdb

2021-01-25 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


--
pull_requests: +23140
pull_request: https://github.com/python/cpython/pull/24321

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



[issue42384] Inconsistent sys.path between python and pdb

2021-01-24 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


--
pull_requests: +23139
pull_request: https://github.com/python/cpython/pull/24320

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



[issue42384] Inconsistent sys.path between python and pdb

2021-01-21 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

I'll give it a try

--

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-19 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


--
pull_requests: +22305
pull_request: https://github.com/python/cpython/pull/23412

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



[issue42387] Pdb should restore the execution environment before reexecuting the target

2020-11-17 Thread Andrey Bienkowski


New submission from Andrey Bienkowski :

When the target exits, pdb automatically restarts it. If the target changed 
something before exiting the changes will remain unless pdb explicitly undoes 
them. While working on #42383 I had an idea: it would be useful if pdb reverted 
the changes the target makes to the execution environment (to a reasonable 
extent) before restarting it. This includes:

1. os.getcwd() - currently not reverted
2. os.environ - I did not check if this is currently restored or not
3. sys.argv - --/--
4. sys.path - --/--

--
components: Library (Lib)
messages: 381225
nosy: hexagonrecursion
priority: normal
severity: normal
status: open
title: Pdb should restore the execution environment before reexecuting the 
target

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



[issue42384] Inconsistent sys.path between python and pdb

2020-11-17 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


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

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-17 Thread Andrey Bienkowski


Change by Andrey Bienkowski :


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

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



[issue42384] Inconsistent sys.path between python and pdb

2020-11-17 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

After reading Lib/pdb.py:main I believe I can fix both by changing a single 
line.

--

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

I'm working on fixing this

--

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



[issue42384] Inconsistent sys.path between python and pdb

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

I'll look into fixing this after I fix #42383

--

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



[issue42384] Inconsistent sys.path between python and pdb

2020-11-16 Thread Andrey Bienkowski


New submission from Andrey Bienkowski :

The first entry in sys.path is different between `python foo.py` and `python -m 
pdb foo.py`. In the former it is the absolute path to the parent directory of 
foo.py while in the later it is a relative path (unless the debug target was 
specified using an absolute path). The meaning of the absolute path does not 
change when the current directory changes (e.g. via os.chdir()) while the 
meaning of the relative path does. Like any environment inconsistency between 
regular program execution and the debugger this may lead to bugs that 
mysteriously vanish when you try to debug them.

$ cat > print-path.py
import sys
from pprint import pprint

pprint(sys.path)
$ python3 print-path.py 
['/home/user',
 '/usr/lib64/python38.zip',
 '/usr/lib64/python3.8',
 '/usr/lib64/python3.8/lib-dynload',
 '/usr/lib64/python3.8/site-packages',
 '/usr/lib/python3.8/site-packages']
$ python3 -m pdb print-path.py  
> /home/user/print-path.py(1)()
-> import sys
(Pdb) c
['',
 '/usr/lib64/python38.zip',
 '/usr/lib64/python3.8',
 '/usr/lib64/python3.8/lib-dynload',
 '/usr/lib64/python3.8/site-packages',
 '/usr/lib/python3.8/site-packages']

--
messages: 381215
nosy: hexagonrecursion
priority: normal
severity: normal
status: open
title: Inconsistent sys.path between python and pdb

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



[issue31121] Unable to exit pdb when script becomes invalid

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

Another way to reproduce this that will continue to work once #42383 is fixed 
is to delete or move the script while it's being debugged.

--
nosy: +hexagonrecursion

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-16 Thread Andrey Bienkowski


New submission from Andrey Bienkowski :

This was mentioned in #31121, but I believe this deserves its own separate 
issue. If the debug target is specified using a relative path and later the 
current directory is changed, pdb tries to search for the target in the new 
current directory. This currently causes pdb to be unable to exit, which is 
what #31121 and #14743 are about, but even if they are fixed we would still be 
left with pdb exiting instead of restarting the target. This issues is about 
the latter.

To reproduce (same as #31121):

$ mkdir foo
$ cat > foo/script.py
import os
os.chdir('foo')
$ python3 -m pdb foo/script.py 
> /home/user/foo/script.py(1)()
-> import os
(Pdb) c
The program finished and will be restarted
Traceback (most recent call last):
  File "/usr/lib64/python3.8/pdb.py", line 1704, in main
pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.8/pdb.py", line 1570, in _runscript
with io.open_code(filename) as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'foo/script.py'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr/lib64/python3.8/pdb.py(1570)_runscript()
-> with io.open_code(filename) as fp:

--
messages: 381213
nosy: hexagonrecursion
priority: normal
severity: normal
status: open
title: Pdb does not correclty restart the target if it changes the current 
directory

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



[issue39706] unittest.IsolatedAsyncioTestCase hangs on asyncio.CancelledError

2020-02-21 Thread Andrey Moiseev


New submission from Andrey Moiseev :

The following code hangs:

import asyncio
import unittest


class TestCancellation(unittest.IsolatedAsyncioTestCase):

async def test_works(self):
raise asyncio.CancelledError()


if __name__ == '__main__':
unittest.main()

--
components: asyncio
messages: 362402
nosy: Andrey Moiseev, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: unittest.IsolatedAsyncioTestCase hangs on asyncio.CancelledError
type: behavior

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



[issue39049] Add "elif" to "for_stmt" and "while_stmt"

2019-12-14 Thread Andrey


Change by Andrey :


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

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



[issue39049] Add "elif" to "for_stmt" and "while_stmt"

2019-12-14 Thread Andrey


New submission from Andrey :

Add an ability to use "elif" in for statement and while statement besides "else"

Example
Now:
```python3
for i in range(j):
...
else:
if i > 5:
...
else:
...
```
Shall be:
```python3
for i in range(j):
...
elif i > 5:
...
else:
...
```

--
components: Build
messages: 358406
nosy: moff4
priority: normal
severity: normal
status: open
title: Add "elif" to "for_stmt" and "while_stmt"
type: enhancement
versions: Python 3.9

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



[issue38000] importlib can not handle module file names with periods

2019-09-01 Thread Andrey


New submission from Andrey :

```
import os, sys

def import_module(dir_path, module_name, ref_module_name = None):
  module_file_path = os.path.join(dir_path, module_name).replace('\\', '/')
  if sys.version_info[0] > 3 or sys.version_info[0] == 3 and 
sys.version_info[1] >= 4:
import importlib
import_spec = 
importlib.util.spec_from_file_location(os.path.splitext(module_name)[0] if 
ref_module_name is None else ref_module_name, os.path.join(dir_path, 
module_name).replace('\\', '/'))
import_module = importlib.util.module_from_spec(import_spec)
import_spec.loader.exec_module(import_module)
#globals()[module_name if ref_module_name is None else ref_module_name] = 
import_module # still does not accept modules with periods without this
  else:
# back compatability
import imp
module_file, module_file_name, module_desc = 
imp.find_module(os.path.splitext(module_name)[0], 
[os.path.dirname(module_file_path)])
globals()[module_name if ref_module_name is None else ref_module_name] = 
imp.load_module(module_file_path, module_file, module_file_name, module_desc)
```

I am trying to import my modules targeted by file path:

```
import_module(MYTOOLS_ROOT, 'cmdoplib.std.py', 'cmdoplib')
import_module(MYTOOLS_ROOT, 'cmdoplib.yaml.py', 'cmdoplib_yaml')
```

And got error:

```
Traceback (most recent call last):
  File "c:\python\x64\37\lib\site-packages\xonsh\proc.py", line 1411, in run
r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec, spec.stack)
  File "c:\python\x64\37\lib\site-packages\xonsh\proc.py", line 1204, in 
proxy_two
return f(args, stdin)
  File "c:\python\x64\37\lib\site-packages\xonsh\aliases.py", line 575, in 
source_alias
builtins.execx(src, "exec", ctx, filename=fpath)
  File "c:\python\x64\37\lib\site-packages\xonsh\built_ins.py", line 1497, in 
__call__
return self.obj.__call__(*args, **kwargs)
  File "c:\python\x64\37\lib\site-packages\xonsh\execer.py", line 190, in exec
return exec(code, glbs, locs)
  File 
"w:/Work/MyProjects/__scm_solutions/all-in-one/_common/tools/cmdoplib.yaml.xsh",
 line 11, in 
g_yaml_env = cmdoplib_yaml.YamlEnv()
NameError: name 'cmdoplib_yaml' is not defined
```

If try to uncomment this:

```
globals()[module_name if ref_module_name is None else ref_module_name] = 
import_module
```

All works fine.
Seems the latest version of the python still can not handle modules with the 
periods in a file name without constructions from the old and well known `imp` 
module.

It seems for me as a bug or at least as an incomplete (re)implementation.

--
components: Interpreter Core
messages: 350950
nosy: andry
priority: normal
severity: normal
status: open
title: importlib can not handle module file names with periods
type: enhancement
versions: Python 3.7

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



[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-04-16 Thread Andrey Paramonov


Andrey Paramonov  added the comment:

Hello!

Below is updated implementation containing more consistent error handling.
The main rough edges encountered:

1. asyncio.Queue alone proved insufficient for precise control of limit, as 
asyncio.create_task() schedules created Task() immediately and it may start 
executing before being added to queue (thus leading to limit+1 tasks running). 
Additional semaphore is used to tackle that.

2. When exception, other running tasks have to be cancel()ed and then await'ed 
to ensure all tasks are successfully finished by the time igather exits. Just 
cancel()ing proved not sufficient.

3. When exception, unscheduled coroutines have to be wrapped with 
asyncio.create_task(coro).cancel() to avoid RuntimeWarning "coroutine was never 
awaited". But maybe there is a more elegant way to suppress this warning for a 
coroutine?

In my client code I didn't so far encounter "an implicit requirement that back 
pressure from the consumer should be handled", but it should be possible to 
implement separately and quite straightforwardly, with the help of 
asyncio.Queue.

async def igather(coros, limit=None):
coros = iter(coros)

buf = asyncio.Queue()
sem = asyncio.Semaphore(limit or math.inf)

async def submit(coros, buf):
while True:
await sem.acquire()
try:
# TODO: additionally support async iterators
coro = next(coros)
except StopIteration:
break
task = asyncio.create_task(coro)
buf.put_nowait(task)
await buf.put(None)

async def consume(buf):
while True:
task = await buf.get()
if task:
v = await asyncio.wait_for(task, None)
sem.release()
yield v
else:
break

submit_task = asyncio.create_task(submit(coros, buf))
try:
async for result in consume(buf):
yield result
except:
submit_task.cancel()
# cancel scheduled
while not buf.empty():
task = buf.get_nowait()
if task:
task.cancel()
try:
await task
except:
pass
# cancel pending
for coro in coros:
asyncio.create_task(coro).cancel()
raise

Shall I go ahead and prepare a PR with docs and tests?

--

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



[issue36449] __aexit__ is not called when a context manager is used in an async generator

2019-03-27 Thread Andrey Lemets


New submission from Andrey Lemets :

This code (https://gist.github.com/EnotYoyo/d751951c5ff77e22686715aa9ab05b56) 
works correctly in python3.6.6 but does not in python3.6.8+

--
components: asyncio
messages: 338953
nosy: Andrey Lemets, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: __aexit__ is not called when a context manager is used in an async 
generator
versions: Python 3.6, Python 3.7

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



[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-02-25 Thread Andrey Paramonov


Andrey Paramonov  added the comment:

> an implicit requirement that back pressure from the consumer should be 
> handled (i.e. if whoever's iterating through "async for fut in 
> as_completed(...)" is too slow, then the tasks should pause until it catches 
> up)

No, I don't think it is required or desired to be handled.

My initial sketch was imprecise: it's better to asynchronously yield task 
results, not "completed task" futures. This way, no additional buffer needed, 
all error handling can be consolidated inside `igather()`, and that's actually 
more compatible with `asyncio.gather()`.

I.e, instead of

yield next_fut

use

yield await next_fut


--

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



[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-02-21 Thread Andrey Paramonov


Andrey Paramonov  added the comment:

Might as_completed() be considered a low-level API, but as of Python 3.7 there 
are seemingly no ready alternatives to achieve proposed behavior. All of 
asyncio.gather(), asyncio.wait(), asyncio.as_completed() expect awaitables list 
of limited size; doing something like 
https://www.artificialworlds.net/blog/2017/06/12/making-100-million-requests-with-python-aiohttp
 is not straightforward.

A function that takes iterator/async iterator of tasks and is itself 
generator/async generator is very much wanted, something in the spirit of (but 
more efficient?)

async def igather(tasks, limit=None):
pending = set()
while True:
for task in islice(tasks, limit - len(pending) if limit else None):
pending.add(task)
if pending:
done, pending = await asyncio.wait(pending, 
return_when=asyncio.FIRST_COMPLETED)
for task in done:
yield task
else:
break


It is an open question whether such function should yield results in the task 
submission order. Albeit useful, it's a bit harder to implement and (most 
importantly) has terrible worst-case memory behavior.

See also:
https://bugs.python.org/issue33533
https://github.com/h2non/paco/issues/38

--
nosy: +aparamon

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



[issue23428] Use the monotonic clock for thread conditions on POSIX platforms

2019-01-17 Thread Andrey Ovchinnikov


Change by Andrey Ovchinnikov :


--
nosy: +anikey

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



[issue34905] Cannot assign memoryview values from array.array

2018-10-05 Thread Andrey Paramonov


New submission from Andrey Paramonov :

Currently, memoryview values can be assigned from all bytes-like objects 
(https://docs.python.org/3/glossary.html#term-bytes-like-object) except byte 
array.array:


import array

mview = memoryview(bytearray(b'hello'))

mview[:] = bytes(b'hello')  # success
mview[:] = bytearray(b'hello')  # success
mview[:] = memoryview(b'hello')  # success
mview[:] = array.array('b', b'hello')  # fail

mview[:] = array.array('b', b'hello')
ValueError: memoryview assignment: lvalue and rvalue have different structures


--
components: Library (Lib)
messages: 327133
nosy: aparamon
priority: normal
severity: normal
status: open
title: Cannot assign memoryview values from array.array
type: behavior
versions: Python 3.6

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



[issue1230540] sys.excepthook doesn't work in threads

2018-08-04 Thread Andrey Vlasovskikh


Andrey Vlasovskikh  added the comment:

> Would it be possible to modify the default implementation of sys.excepthook 
> to have a different output when it's not called from the main thread? Mimick 
> the current traceback from threads.

I agree it's a good idea to mimic what `_thread` does in case of both handled 
and unhandled exceptions. Why would you want to do it in `sys.excepthook`? The 
code for handling unhandled exceptions in `_thread` threads is located in 
`_threadmodule.c` itself, so there is no dependency from `sys` to `_thread`. By 
following the same logic, the code for handling unhandled exceptions in 
`threading` should be located in `threading.py`, like it does now. So the only 
thing that's missing in the pull request compared to `_thread` is the output:

   Unhandled exception in thread started by  at 
0x7f6769ca8e18>


for all the exceptions: not caught by the sys.excepthook **and** caught by the 
sys.exceptook.

> An alternative would be to introduce a new hook to log exceptions in threads, 
> ex: sys.threadexcepthook. That hoook would take a 4th parameter. But Andrey 
> Vlasovskikh didn't like this idea.

I'm overall OK with this idea, but I would prefer to make the existing 
`sys.excepthook` API applicable to all the exceptions: for the main thread 
(works well), for `_thread` threads (works well) and for `threading` threads 
(doesn't work).

--

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



[issue1230540] sys.excepthook doesn't work in threads

2018-08-01 Thread Andrey Vlasovskikh


Andrey Vlasovskikh  added the comment:

I've added a PR with a patch I developed during the EuroPython 2018 sprint.

I've fixed this issue in a way that is more or less consistent with how 
'_thread' threads interact with sys.excepthook, but I haven't added the log 
line they print to sys.stderr about an unhandled exception in a thread:

Unhandled exception in thread started by  at 0x108c840d0>

I can add these messages if they are needed.

I'd like to mention the issue I discussed with Victor Stinner at the sprints 
(adding Victor to the nosy list as he requested). The fix could possibly break 
the de facto contract that has been there for ages that 'theading' threads 
don't invoke sys.excepthook on uncaught exceptions.

If the fact that sys.execepthook doesn't work with threading is considered a 
feature, then an alternative solution could be a new threading-specific hook: 
threading.excepthook.

--
nosy: +vlasovskikh, vstinner

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



[issue1230540] sys.excepthook doesn't work in threads

2018-08-01 Thread Andrey Vlasovskikh


Change by Andrey Vlasovskikh :


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

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



[issue31267] threading.Timer object is affected by changes to system time: Python locks should use a monotonic clock if available

2018-07-27 Thread Andrey Ovchinnikov


Change by Andrey Ovchinnikov :


--
nosy: +anikey

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



[issue33886] SSL on aiomysql hangs on reconnection

2018-06-17 Thread Andrey


New submission from Andrey :

On reconnect from aiomysql (after the pool has recycled the old connection) by 
using ssl context it hangs forever. Interrupting gives the following Traceback:
  File "/usr/local/lib/python3.6/site-packages/aiomysql/connection.py", line 
464, in _connect
await self._request_authentication()
  File "/usr/local/lib/python3.6/site-packages/aiomysql/connection.py", line 
670, in _request_authentication
server_hostname=self._host
  File "/usr/lib/python3.6/asyncio/streams.py", line 81, in open_connection
lambda: protocol, host, port, **kwds)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 804, in 
create_connection
sock, protocol_factory, ssl, server_hostname)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 830, in 
_create_connection_transport
yield from waiter
concurrent.futures._base.CancelledError

Probably it is related with issue30698 and issue29406.

--
components: asyncio
messages: 319823
nosy: andr04, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: SSL on aiomysql hangs on reconnection
type: behavior
versions: Python 3.6

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



[issue28167] remove platform.linux_distribution()

2018-05-19 Thread Andrey Bychkov

Change by Andrey Bychkov <mrand...@gmail.com>:


--
pull_requests: +6650

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



[issue33435] incorrect detection of information of some distributions

2018-05-16 Thread Andrey Bychkov

Andrey Bychkov <mrand...@gmail.com> added the comment:

I think, at this moment, the optimal is parsing information from os-release 
file, because it's contained in majority linux distributions. Also can using 
'Lsb_release -a' command, but not all distributions support 'Linux Standard 
Base'. At final can using at first parsing the os-release and if it failed, can 
using the lsb command parse.

--

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



[issue33435] incorrect detection of information of some distributions

2018-05-15 Thread Andrey Bychkov

Andrey Bychkov <mrand...@gmail.com> added the comment:

I think that it would be good to update linux_distribution, the discussion has 
been going on for a long time, but still in some cases the information is not 
determined correctly.
It seems to me that the methods used are not entirely correct. My change more 
accurately determines information about the distribution using the modern 
standard-file os-release.
If my change seems to be good, I can continue to edit linux_distribution.

--

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



[issue33513] incorrect detection of information of some distributions python2

2018-05-15 Thread Andrey Bychkov

Change by Andrey Bychkov <mrand...@gmail.com>:


--
pull_requests: +6530
stage:  -> patch review

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



[issue33513] incorrect detection of information of some distributions python2

2018-05-15 Thread Andrey Bychkov

Change by Andrey Bychkov <mrand...@gmail.com>:


--
keywords: +patch
Added file: https://bugs.python.org/file47590/fix-issue-33513.patch

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



[issue33513] incorrect detection of information of some distributions python2

2018-05-15 Thread Andrey Bychkov

New submission from Andrey Bychkov <mrand...@gmail.com>:

In some linux distributions, the information about the distribution is 
incorrectly determined when the linux_distribution() method is called from the 
platform class. Since the information file os-release becomes a certain 
standard, I propose first of all to check its availability and if it is in the 
system - parse the information from it.

--
components: Library (Lib)
messages: 316628
nosy: mrandybu
priority: normal
severity: normal
status: open
title: incorrect detection of information of some distributions python2
type: behavior
versions: Python 2.7

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



[issue33435] incorrect detection of information of some distributions

2018-05-15 Thread Andrey Bychkov

Andrey Bychkov <mrand...@gmail.com> added the comment:

it's patch is not actual. new diff in git pull request!

--

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



[issue33435] incorrect detection of information of some distributions

2018-05-06 Thread Andrey Bychkov

New submission from Andrey Bychkov <mrand...@gmail.com>:

In some linux distributions, the information about the distribution is 
incorrectly determined when the linux_distribution() method is called from the 
platform class. Since the information file os-release becomes a certain 
standard, I propose first of all to check its availability and if it is in the 
system, then parse the information from it. I apply the patch. It will work 
well with version 2.7.

--
components: Library (Lib)
files: fixed_lib_platform_os-release.patch
keywords: patch
messages: 316232
nosy: Andrey Bychkov
priority: normal
severity: normal
status: open
title: incorrect detection of information of some distributions
type: behavior
versions: Python 3.6
Added file: 
https://bugs.python.org/file47572/fixed_lib_platform_os-release.patch

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



[issue32021] Brotli encoding is not recognized by mimetypes

2017-11-14 Thread Andrey

Andrey <andre...@google.com> added the comment:

NodeJS: https://www.npmjs.com/package/brotli
Python:
https://pypi.python.org/pypi/brotlipy
https://pypi.python.org/pypi/Brotli
Ubuntu: https://launchpad.net/ubuntu/+source/brotli

That said I don't expect an average user to compress their files as .br, but it 
is useful for site/webapp developers to have static resources as .br

--

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



[issue32021] Brotli encoding is not recognized by mimetypes

2017-11-14 Thread Andrey

Andrey <andre...@google.com> added the comment:

Currently aiohttp doesn't support Brotli. (I'm here because I would like to get 
that support)

When it gets (as a server) a request for file.html it checks if file.html.gz 
exists (and accept-encoding contains 'gzip'). It then send file.html.gz to the 
client and sets Content-Encoding to gzip.

It uses mimetypes.guess_type to set Content-Type and Content-Encoding.

--

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



[issue32021] Brotli encoding is not recognized by mimetypes

2017-11-14 Thread Andrey

Andrey <andre...@google.com> added the comment:

When "type, encoding = mimetypes.guess_type('file.js.br')" is used not only the 
"encoding" is not set to "brotli", but the type is also not recognized.
Such code is used in aiohttp for example.

My proposal is to add 'br' to mimetypes.encodings_map, not to 
mimetypes.types_map

--

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



[issue32021] Brotli encoding is not recognized by mimetypes

2017-11-14 Thread Andrey

Andrey <andre...@google.com> added the comment:

Yes, however would it make sense to add it, so mimetypes recognizes it by 
default? I will make a PR if it makes sense.

--

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



[issue32021] Brotli encoding is not recognized by mimetypes

2017-11-13 Thread Andrey Klinger

New submission from Andrey Klinger <andre...@google.com>:

Brotli (.br) encoding is not recognized by mimetypes module.
mimetypes doesn't have API for adding encodings.
The encoding is supported by most browsers: https://caniuse.com/#feat=brotli

--
components: Library (Lib)
messages: 306188
nosy: Andrey Klinger
priority: normal
severity: normal
status: open
title: Brotli encoding is not recognized by mimetypes
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue32015] Asyncio looping during simultaneously socket read/write and reconnection

2017-11-13 Thread Andrey

Change by Andrey <and...@gmail.com>:


--
title: Asyncio cycling during simultaneously socket read/write and reconnection 
-> Asyncio looping during simultaneously socket read/write and reconnection

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



[issue32015] Asyncio cycling during simultaneously socket read/write and reconnection

2017-11-13 Thread Andrey

Change by Andrey <and...@gmail.com>:


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

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



[issue32015] Asyncio cycling during simultaneously socket read/write and reconnection

2017-11-13 Thread Andrey

New submission from Andrey <and...@gmail.com>:

The bug is happened when the async reading/writing interrupted by other async 
method which reconnects the socket. The closed socket calls the appropriate 
handler in the loop due to cannot be removed due to wrong fileno of socket.

--
components: asyncio
files: raise.py
messages: 306154
nosy: andr04, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio cycling during simultaneously socket read/write and reconnection
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47262/raise.py

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



[issue737999] minor codeop fixes

2017-08-22 Thread Bienkowski Andrey

Changes by Bienkowski Andrey <abenkovs...@gmail.com>:


--
pull_requests: +3217

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



[issue11771] hashlib object cannot be pickled

2017-07-14 Thread Andrey Kislyuk

Andrey Kislyuk added the comment:

For anyone else looking for a solution to this, I wrote a library: 
https://github.com/kislyuk/rehash

--
nosy: +Andrey.Kislyuk

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



[issue28569] mock.attach_mock should work with any return value of patch()

2016-11-14 Thread Andrey Fedorov

Andrey Fedorov added the comment:

Here's the full extension of the example from documentation that doesn't
seem to handle classes and functions consistently:

  import mock

  patches = {
  'requests_get': 'requests.get',
  'mymodule_Class1': 'mymodule.Class1'
  }

  root_mock = mock.Mock()
  for name, path in patches.items():
  m = mock.patch(path, autospec=True)
  root_mock.attach_mock(m.start(), name)

  import requests
  import mymodule

  mymodule.Class1('foo')
  requests.get('bar')

  print root_mock.mock_calls
  # [call.mymodule_Class1('foo')]

Does this working as expected make sense, or is there some reason this is
an undesirable API to behave consistently regardless of what's being
patched?

--

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



[issue28569] mock.attach_mock should work with any return value of patch()

2016-11-11 Thread Andrey Fedorov

Andrey Fedorov added the comment:

To clarify, this is how I would expect these two functions to work together
"out of the box"

patches = { 'requests_get': 'requests.get', ... }

root_mock = mock.Mock()
for name, path in patches.items():
m = mock.patch(path, auto_spec=True)
root_mock.attach_mock(m, name)

This works when `path` is referring to a class, and it would be great if it
also worked with functions like `requests.get`, as well.

On Fri, Nov 11, 2016 at 5:16 PM, Andrey Fedorov <m...@anfedorov.com> wrote:

> There's some vagueness on how this is implemented, but I would prefer
> manager.attach_mock to also work with whatever the return value of patch()
> is.
>
> On Fri, Nov 11, 2016 at 12:08 PM, Syed Suhail Ahmed <
> rep...@bugs.python.org> wrote:
>
>>
>> Syed Suhail Ahmed added the comment:
>>
>> So from what I have understood, manager.attach_mock must raise an
>> Exception when it is called with a wrong attribute, since the patch is
>> called with autospec=True and you cannot call a mock with non existing
>> attributes.Is that correct?
>>
>> --
>>
>> ___
>> Python tracker <rep...@bugs.python.org>
>> <http://bugs.python.org/issue28569>
>> ___
>>
>
>

--

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



[issue28569] mock.attach_mock should work with any return value of patch()

2016-11-11 Thread Andrey Fedorov

Andrey Fedorov added the comment:

There's some vagueness on how this is implemented, but I would prefer
manager.attach_mock to also work with whatever the return value of patch()
is.

On Fri, Nov 11, 2016 at 12:08 PM, Syed Suhail Ahmed <rep...@bugs.python.org>
wrote:

>
> Syed Suhail Ahmed added the comment:
>
> So from what I have understood, manager.attach_mock must raise an
> Exception when it is called with a wrong attribute, since the patch is
> called with autospec=True and you cannot call a mock with non existing
> attributes.Is that correct?
>
> --
>
> ___
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue28569>
> ___
>

--

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



[issue28569] mock.attach_mock should work with any return value of patch()

2016-10-31 Thread Andrey Fedorov

Changes by Andrey Fedorov <and...@humblebundle.com>:


--
title: mock.attach_mock should work with return value of patch() -> 
mock.attach_mock should work with any return value of patch()

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



[issue28569] mock.attach_mock should work with return value of patch()

2016-10-31 Thread Andrey Fedorov

New submission from Andrey Fedorov:

The attach_mock in the following code sample fails silently:

>>> from mock import patch, Mock
>>> p = patch('requests.get', autospec=True)
>>> manager = Mock()
>>> manager.attach_mock(p.start(), 'requests_get')
>>> import requests
>>> requests.get('https://google.com')

>>> manager.mock_calls
[]
>>> p.stop()
>>> manager.mock_calls
[]

It seems this would be a useful use-case, especially given that this code would 
work as-expected if 'requests.get' in the second line were replaced with a path 
to a class.

--
components: Library (Lib)
messages: 279812
nosy: Andrey Fedorov, michael.foord
priority: normal
severity: normal
status: open
title: mock.attach_mock should work with return value of patch()
type: behavior
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/issue28569>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28367] Add more standard baud rate constants to "termios"

2016-10-05 Thread Andrey Smirnov

New submission from Andrey Smirnov:

Termios magic constants for the following baud rates:

  - B50
  - B576000
  - B921600
  - B100
  - B1152000
  - B150
  - B200
  - B250
  - B300
  - B350
  - B400

in Linux are different between various architectures (i. e. PowerPC and Alpha 
are different from the rest of them). And because they are defined as 
per-processor symbols the only way to access them is if they are built-in as a 
part of CPython during its compilation.

Attached is the patch implementing that

--
components: Library (Lib)
files: add-more-termios-baudrates.patch
keywords: patch
messages: 278145
nosy: Andrey Smirnov, twouters
priority: normal
severity: normal
status: open
title: Add more standard baud rate constants to "termios"
type: enhancement
Added file: http://bugs.python.org/file44977/add-more-termios-baudrates.patch

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



[issue1521950] shlex.split() does not tokenize like the shell

2016-06-01 Thread Andrey Kislyuk

Andrey Kislyuk added the comment:

Is there any chance of getting this into 3.6? We are still in a situation where 
the shlex module misleads developers into believing that it has functionality 
to parse things the way the shell does. I've had to vendor the copy of shlex 
with patches from this bug applied (thanks Vinay!)

--
nosy: +Andrey.Kislyuk

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



[issue25140] platform.platform() incorrectly identifies Windows 10 as 'Windows-8-6.2.9200'

2015-09-16 Thread Andrey Fedyashov

New submission from Andrey Fedyashov:

Here's actual OS version:
OS Name:   Microsoft Windows 10 Enterprise Insider Preview
OS Version:10.0.10534 N/A Build 10534
OS Manufacturer:   Microsoft Corporation
OS Configuration:  Standalone Workstation
OS Build Type: Multiprocessor Free

Here is bug repro with Python 3.4

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.platform()
'Windows-8-6.2.9200'

Here is bug repro with Python 2.7

Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.platform()
'Windows-8-6.2.9200'

--
components: Library (Lib), Windows
messages: 250837
nosy: Andrey Fedyashov, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: platform.platform() incorrectly identifies Windows 10 as 
'Windows-8-6.2.9200'
type: behavior
versions: Python 2.7, Python 3.4

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-26 Thread Andrey Wagin

Andrey Wagin added the comment:

There is the same behavior for python 3.4
 sks[1].send(basdfasdfsadfasdfsdfsadfsdfasdfsdfasdfsadfa)
42
 sks[0].recv(1, socket.MSG_PEEK | socket.MSG_TRUNC)
b'a\x00Nx\x94\x7f\x00\x00sadfasdfsdfsadfsdfasdfsdfasdfsadfa'


--
versions: +Python 3.4

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-26 Thread Andrey Wagin

Changes by Andrey Wagin ava...@gmail.com:


--
type:  - security

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-25 Thread Andrey Wagin

New submission from Andrey Wagin:

In [1]: import socket

In [2]: sks = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)

In [3]: sks[1].send(asdfasdfsadfasdfsdfsadfsdfasdfsdfasdfsadfa)
Out[3]: 42

In [4]: sks[0].recv(1, socket.MSG_PEEK | socket.MSG_TRUNC)
Out[4]: 
'a\x00\x00\x00\xc0\xbf8\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

recv() returns a buffer. The size of this buffer is equal to the size of 
transferred data, but only the first symbol was initialized. What is the idea 
of this behavior.

Usually recv(sk, NULL, 0, socket.MSG_PEEK | socket.MSG_TRUNC) is used to get a 
message size. What is the right way to get a message size in Python?

--
components: Library (Lib)
messages: 249114
nosy: Andrey Wagin
priority: normal
severity: normal
status: open
title: socket.recv(size, MSG_TRUNC) returns more than size bytes
versions: Python 2.7

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-25 Thread Andrey Wagin

Andrey Wagin added the comment:

sendto(4, asdfasdfsadfasdfsdfsadfsdfasdfsd..., 42, 0, NULL, 0) = 42
recvfrom(3, 
a\0n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\0\0\0\0\2\0\0\0..., 1, 
MSG_TRUNC, NULL, NULL) = 42

I think the exit code is interpreted incorrectly. In this case it isn't equal 
to the number of bytes received. Then python copies this number of bytes from 
the buffer with smaller size, so it may access memory which are not allocated 
or allocated by someone else.

valgrind detects this type of errors:
[avagin@localhost ~]$ cat sock.py 
import socket, os, sys

sks = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
pid = os.fork()
if pid == 0:
sks[1].send(\0 * 4096)
sys.exit(0)
sk = sks[0]
print sk.recv(1, socket.MSG_TRUNC )

[avagin@localhost ~]$ valgrind python sock.py
==25511== Memcheck, a memory error detector
==25511== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==25511== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==25511== Command: python sock.py
==25511== 
==25511== Syscall param write(buf) points to uninitialised byte(s)
==25511==at 0x320B4F0940: __write_nocancel (in /usr/lib64/libc-2.20.so)
==25511==by 0x320B478D2C: _IO_file_write@@GLIBC_2.2.5 (in 
/usr/lib64/libc-2.20.so)
==25511==by 0x320B4794EE: _IO_file_xsputn@@GLIBC_2.2.5 (in 
/usr/lib64/libc-2.20.so)
==25511==by 0x320B46EE68: fwrite (in /usr/lib64/libc-2.20.so)
==25511==by 0x369CC90210: ??? (in /usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CC85EAE: ??? (in /usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CC681AB: PyFile_WriteObject (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCE08F9: PyEval_EvalFrameEx (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCE340F: PyEval_EvalCodeEx (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCE3508: PyEval_EvalCode (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCFC91E: ??? (in /usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCFDB41: PyRun_FileExFlags (in 
/usr/lib64/libpython2.7.so.1.0)

--

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



[issue21142] Daily/weekly ABI scan?

2014-04-03 Thread Andrey

Andrey added the comment:

There are just three simple steps to setup ABI checker:

1. Create ABI dump of the _reference_ version (see instructions [1]) and commit 
it to the source tree (ABI-ref.dump):

$ abi-compliance-checker -l python -dump descriptor.xml -dump-path ABI-ref.dump

2. Create ABI dump of the _current_ version (ABI-cur.dump)
3. Compare these ABI dumps:

$ abi-compliance-checker -l python -old ABI-ref.dump -new ABI-cur.dump 
-report-path abi-report.html

To skip analysis of symbols with leading underscore pass this additional option 
to the tool when comparing ABI dumps: --skip-internal=\A_

For more information see [2].

[1] https://mail.python.org/pipermail/python-dev/2014-April/133754.html
[2] http://ispras.linuxbase.org/index.php/ABI_compliance_checker

--
nosy: +aponomarenko

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



[issue21120] PyArena type is used in headers from the limited API

2014-04-01 Thread Andrey

New submission from Andrey:

Hi all,

The PyArena data type is defined in the pyarena.h under the #ifndef 
Py_LIMITED_API statement, so it's not included in the limited api. But this 
type is used in Python-ast.h, ast.h and asdl.h headers that included in the 
limited api, because they don't contain any checks for Py_LIMITED_API.

May be all these header files (Python-ast.h, ast.h, asdl.h) should begin with 
#ifndef Py_LIMITED_API (excluded from the limited api)?

Thanks.

--
components: Library (Lib)
messages: 215300
nosy: aponomarenko
priority: normal
severity: normal
status: open
title: PyArena type is used in headers from the limited API
type: compile error
versions: Python 3.5

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



[issue20899] Nested namespace imports do not work inside zip archives

2014-03-12 Thread Andrey Antsut

New submission from Andrey Antsut:

Importing modules from subdirectories as implicit namespace packages (PEP 
420) inside a ZIP archive only works one level deep. Imports from within nested 
namespaces fail with ImportError: No module named 'XXX'.

I am attaching an archive with example directory/file structure. To reproduce 
the problem, run the following from where you unzipped it:

python
 import sys
 sys.path += ['project1', 'project2.zip', 'project3', 'project4.zip']
 import parent.child.hello1
Hello 1
 import parent.child.hello2
ImportError: No module named 'parent.child.hello2'
 import parent.child.hello3
Hello 3
 import parent.child.hello4
ImportError: No module named 'parent.child.hello4'
 import boo
boo!
 import parent.boo
boo!

Tested on WinXP SP3 with Python 3.3.5 and 3.4.0rc3.

--
files: reproduce.zip
messages: 213290
nosy: Andrey.Antsut
priority: normal
severity: normal
status: open
title: Nested namespace imports do not work inside zip archives
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file34380/reproduce.zip

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



[issue20852] Embedding with zipped standard library is broken in 3.3.4 (Windows)

2014-03-04 Thread Andrey Antsut

New submission from Andrey Antsut:

When embedding Python into C++, Py_Initialize() crashes with following errors 
if the standard library (python33\lib) is in a zip archive (e.g. python33.zip):

Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'

This seems to be specific to Python 3.3.4: works fine with 3.3.2 and 3.3.3, not 
tested with other versions. Tested only on Windows.

More details with code examples can be found here:

http://stackoverflow.com/questions/22174760/embedding-python-3-3-in-c-from-zipped-standard-library-on-windows-xp

--
messages: 212744
nosy: Andrey.Antsut
priority: normal
severity: normal
status: open
title: Embedding with zipped standard library is broken in 3.3.4 (Windows)
type: crash
versions: Python 3.3

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



[issue20852] Embedding with zipped standard library is broken in 3.3.4 (Windows)

2014-03-04 Thread Andrey Antsut

Andrey Antsut added the comment:

Just checked - confirming that it works with 3.3.5rc2.

--
status: pending - open

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



[issue17651] Errno checking replaced by concrete classes inherited from OSError

2013-04-11 Thread Andrey Tykhonov

Andrey Tykhonov added the comment:

Sure!

--

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



[issue17650] There is no exception correspond to errno EROFS

2013-04-07 Thread Andrey Tykhonov

Andrey Tykhonov added the comment:

Also:
errno.EXDEV in Lib/distutils/file_util.py
errno.ENOTCONN in Lib/poplib.py
errno.EINVAL in Lib/subprocess.py
errno.ENOTCONN in Lib/smtpd.py, Lib/ssl.py, Lib/imaplib.py
errno.EOPNOTSUPP, errno.ENOTSUP, errno.ENOTSUP, errno.ENODATA in Lib/shutil.py

--

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



[issue17651] Errno checking replaced by concrete classes inherited from OSError

2013-04-07 Thread Andrey Tykhonov

Changes by Andrey Tykhonov atykho...@gmail.com:


--
components: Library (Lib)
nosy: asvetlov, atykhonov
priority: normal
severity: normal
status: open
title: Errno checking replaced by concrete classes inherited from OSError
type: enhancement
versions: Python 3.4

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



[issue17651] Errno checking replaced by concrete classes inherited from OSError

2013-04-07 Thread Andrey Tykhonov

Changes by Andrey Tykhonov atykho...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file29716/issue17651.diff

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



[issue17650] There is no exception correspond to errno EROFS

2013-04-07 Thread Andrey Tykhonov

Changes by Andrey Tykhonov atykho...@gmail.com:


--
components: +Library (Lib)
type:  - enhancement
versions: +Python 3.4

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



[issue17349] wsgiref.simple_server.demo_app is not PEP-3333 compatible

2013-03-04 Thread Andrey Lebedev

New submission from Andrey Lebedev:

Under certain circumstances, wsgiref.simple_server.demo_app may return unicode 
data, but that is prohibited by PEP-.

This happens if environ with unicode key is passed to demo_app. Unicode keys 
are then written to StringIO instance, automatically making its value unicode.

Type of environ keys is not strictly mandated by PEP-, however output of 
WSGI application is:

  When called by the server, the application object must return an iterable 
yielding zero or more bytestrings., see 
http://www.python.org/dev/peps/pep-/#specification-details

Test case is attached.

--
components: Library (Lib)
files: wsgirefbug.py
messages: 183437
nosy: Andrey.Lebedev
priority: normal
severity: normal
status: open
title: wsgiref.simple_server.demo_app is not PEP- compatible
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file29303/wsgirefbug.py

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



[issue14103] argparse: add ability to create a bash completion script

2013-02-03 Thread Andrey Kislyuk

Andrey Kislyuk added the comment:

FYI: http://pypi.python.org/pypi/argcomplete

--
nosy: +Andrey.Kislyuk

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



[issue13524] critical error with import tempfile

2011-12-03 Thread Andrey Morozov

New submission from Andrey Morozov andrey.moro...@itseez.com:

run_me.py: 
import subprocess, sys
e = {'PATH_TO_MY_APPS' : path/to/my/apps}
p = subprocess.Popen(sys.executable +  test1.py 123, env=e, shell=True, 
stdout=subprocess.PIPE)
print(p.stdout.readlines())
p.wait()


test1.py:
1: import sys, os
2: #import tempfile
3: print(hello :  + sys.platform +  PATH:  + os.environ['PATH_TO_MY_APPS'])

System:
Python 2.7.2 x64, Windows x64 7 Pro + SP1

Problem:
if I run python run_me.py then I see on my stdout:
['hello : win32 PATH: path/to/my/apps\r\n']

but if I uncomment line number 2 in test1.py  and run python run_me.py then I 
see on my stdout :

C:\tmp\python_testpython run_me.py
Traceback (most recent call last):
  File test1.py, line 2, in module
import tempfile
  File C:\Python27\lib\tempfile.py, line 34, in module
from random import Random as _Random
  File C:\Python27\lib\random.py, line 883, in module
_inst = Random()
  File C:\Python27\lib\random.py, line 97, in __init__
self.seed(x)
  File C:\Python27\lib\random.py, line 111, in seed
a = long(_hexlify(_urandom(16)), 16)
WindowsError: [Error -2146893818] Invalid Signature
[]

--
files: run_me.py
messages: 148792
nosy: Andrey.Morozov
priority: normal
severity: normal
status: open
title: critical error with import tempfile
type: crash
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23838/run_me.py

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



[issue13524] critical error with import tempfile

2011-12-03 Thread Andrey Morozov

Andrey Morozov andrey.moro...@itseez.com added the comment:

WIDW ?

--
Added file: http://bugs.python.org/file23839/test1.py

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



[issue13524] critical error with import tempfile

2011-12-03 Thread Andrey Morozov

Andrey Morozov andrey.moro...@itseez.com added the comment:

it fix my problem:

e = os.environ.copy()
e['PATH_TO_MY_APPS'] = path/to/my/apps

p = subprocess.Popen(sys.executable +  test1.py 123, env=e, shell=True, 
stdout=subprocess.PIPE)

answer: need have copy of environments

--
status: open - closed

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



[issue12865] import SimpleHTTPServer

2011-08-30 Thread Andrey Men

New submission from Andrey Men menan...@gmail.com:

In russian windows seven SP1, x32, installed from 2.7.1/2.7.2 MSI installer:

 import SimpleHTTPServer

Traceback (most recent call last):
  File pyshell#0, line 1, in module
import SimpleHTTPServer
  File C:\Python\lib\SimpleHTTPServer.py, line 27, in module
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  File C:\Python\lib\SimpleHTTPServer.py, line 204, in 
SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
  File C:\Python\lib\mimetypes.py, line 355, in init
db.read_windows_registry()
  File C:\Python\lib\mimetypes.py, line 259, in read_windows_registry
for ctype in enum_types(mimedb):
  File C:\Python\lib\mimetypes.py, line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal 
not in range(128)

--
messages: 143238
nosy: Andrey.Men
priority: normal
severity: normal
status: open
title: import SimpleHTTPServer
type: resource usage
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12865
___
___
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 Andrey Popp

Andrey Popp 8may...@gmail.com added the comment:

I've also sent message[1] to web-sig about this issue.

[1]: http://mail.python.org/pipermail/web-sig/2011-January/004986.html

--

___
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 Andrey Popp

Andrey Popp 8may...@gmail.com added the comment:

 the spec says an object of type str he means 'type(x) is str' as opposed to 
 'isinstance(x, str)'

-1 Liskov substitution principle states, that every subtype S of type T can be 
used whenever type T is used.

--
nosy: +andreypopp

___
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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-08-26 Thread Andrey Vlasovskikh

Andrey Vlasovskikh andrey.vlasovsk...@gmail.com added the comment:

 On closer look your patch is also ignoring SystemExit. I think it's 
 beneficial to honor SystemExit, so a user could use this as a means to 
 replace the current process with a new one.

Yes, SystemExit should cancel all the tasks that are currently in the queue. I 
guess my patch doesn't handle this properly.

 If we keep that behavior, the real problem here is that the result handler 
 hangs if the process that reserved a job is gone, which is going to be 
 handled by #9205. Should we mark it as a duplicate?

Yes, I think that #9205 covers this issue, so #8296 may be marked as a 
duplicate.

--

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2010-08-26 Thread Andrey Vlasovskikh

Changes by Andrey Vlasovskikh andrey.vlasovsk...@gmail.com:


--
nosy: +vlasovskikh

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



[issue7504] Same name cookies

2010-08-03 Thread Andrey Chichak

Andrey Chichak c...@kit.tomsk.ru added the comment:

1. Cookie.py.diff is fix for error, very rare error.
2. Cookie_multi.diff is extention for supporting same name cookies set for 
diferent pathes.

Cookie.py contain error!

--

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



[issue5346] mailbox._singlefileMailbox.flush doesn't preserve file rights

2010-07-09 Thread Andrey Rahmatullin

Andrey Rahmatullin w...@altlinux.org added the comment:

Linux

--

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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-04-06 Thread Andrey Vlasovskikh

Andrey Vlasovskikh andrey.vlasovsk...@gmail.com added the comment:

Despite of several workarounds available on the Web, the problem persists. 
Almost any exception that is rised in `worker` function while putting or 
getting tasks from queues result in Pool hang up. Currently, `worker` is only 
aware of Exception descendants rised inside of the map function parameter.

I've written a unit test that checks if KeyboardInterrupts are handled 
normally. The source code may be included in `Lib/test/test_multiprocessing.py`.

--
Added file: http://bugs.python.org/file16784/test_map_keyboard_interrput.py

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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-04-06 Thread Andrey Vlasovskikh

Changes by Andrey Vlasovskikh andrey.vlasovsk...@gmail.com:


Removed file: http://bugs.python.org/file16743/test_pool_keyboardinterrupt.py

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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-04-06 Thread Andrey Vlasovskikh

Andrey Vlasovskikh andrey.vlasovsk...@gmail.com added the comment:

Here is a patch that fixes this problem. Basically, it catches all the 
BaseExceptions that could happen during: a) getting a task from the `inqueue`, 
b) calling a user function, c) putting a task into the `outqueue`. The 
exception handler puts the exception to the `outqueue`.

It can be cleanly applied on top of revision 78790.

--
keywords: +patch
Added file: http://bugs.python.org/file16785/fix-sigint.diff

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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-04-02 Thread Andrey Vlasovskikh

New submission from Andrey Vlasovskikh andrey.vlasovsk...@gmail.com:

multiprocessing.Pool methods map, imap, etc. are said to be able to normally 
handle exceptions. But it seems that it is true only for synchronous exceptions 
inside their first func arguments.

When (typically during a long-running parallel map) a user hits ^C, an 
asynchronous KeyboardInterrupt isn't handled properly and leads to the 
interpreter hangup. More precisely, children processes become defunct (on 
Linux), so the only way to terminate the whole program is to issue the KILL 
signal.

As stopping a program with ^C while running potentially long parallel 
computations is probably quite a common scenario, the interpreter should not 
hang up in such a case.

I'm using Python 2.6.5 (r265:79063, Mar 23 2010, 04:44:21) [GCC 4.4.3] on 
linux2. I've also tried to use the current multiprocessing.pool module from the 
current (2.7) trunk with my 2.6.5 installation, but the bug persists.

--
components: Library (Lib)
messages: 102219
nosy: vlasovskikh
severity: normal
status: open
title: multiprocessing.Pool hangs when issuing KeyboardInterrupt
type: crash
versions: Python 2.6, Python 2.7

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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-04-02 Thread Andrey Vlasovskikh

Andrey Vlasovskikh andrey.vlasovsk...@gmail.com added the comment:

Yes, here is my test case.

--
Added file: http://bugs.python.org/file16743/test_pool_keyboardinterrupt.py

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



[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

2010-04-02 Thread Andrey Vlasovskikh

Andrey Vlasovskikh andrey.vlasovsk...@gmail.com added the comment:

Yes, I've come up with the same solution by myself, but it cannot cover all the 
cases of the bug. It works only for cases when ^C is hit during a call to the 
users' function: 
http://stackoverflow.com/questions/1408356/keyboard-interrupts-with-pythons-multiprocessing-pool/2561809#2561809

If the user is lucky, he may hit ^C during getting or putting data into the 
queues in multiprocessing.pool.worker. To reproduce such a case, you may insert 
`sleep(10)` before `task = get()` or `put((job, i, result))`, for example. I've 
encountered such cases just by running test examples several times.

--

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



[issue7504] Same name cookies

2009-12-19 Thread Andrey Chichak

Andrey Chichak c...@kit.tomsk.ru added the comment:

Remake for patch due the requirements of 
http://www.python.org/dev/patches/

--
Added file: http://bugs.python.org/file15606/Cookie_multi.diff

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



[issue7504] Same name cookies

2009-12-19 Thread Andrey Chichak

Andrey Chichak c...@kit.tomsk.ru added the comment:

This is fix for rare problem. If I set 2 cookies:
sid=pub.GHoBitAWLt, path=/
sid=cab.S97jUfeihM, path=/cab
All browsers in Cookie header send for any URL '/cab*':
sid=cab.S97jUfeihM; sid=pub.GHoBitAWLt
Current implementation always returns Cookie['sid']=pub.GHoBitAWLt - wrong!
My patch resolve this problem and Cookie['sid'] returns first (nearest/deepest 
in path) cookie value, 
and also collects all same name cookies in dict Cookie._multi .

Name (_multi) may be wrong, and may be any other :o) .

Also I can update documentation, but my English is not so good ...

--

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



[issue7504] Same name cookies

2009-12-14 Thread Andrey Chichak

New submission from Andrey Chichak c...@kit.tomsk.ru:

After setting cookies with same name and different path only nearest to 
root cookie is available.

Attached patch:
1. Set Cookie to nearest value.
2. Collects all same name values in Cookie._multi['cookie name'] in 
order.

--
components: Library (Lib)
files: Cookie.py.diff
keywords: patch
messages: 96375
nosy: chch
severity: normal
status: open
title: Same name cookies
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file15554/Cookie.py.diff

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



[issue3244] multipart/form-data encoding

2009-10-06 Thread Andrey Petrov

Andrey Petrov andrey.pet...@shazow.net added the comment:

Once upon a time I wrote a library that did some of this among other things:

http://code.google.com/p/urllib3/

Or specifically:
http://code.google.com/p/urllib3/source/browse/trunk/urllib3/filepost.py

The code was borrowed from some of the recipes mentioned, but cleaned up
and adjusted a bit. Feel free to use it or borrow from it in any way you
like.

--
nosy: +shazow

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



[issue5346] mailbox._singlefileMailbox.flush doesn't preserve file rights

2009-02-22 Thread Andrey Rahmatullin

New submission from Andrey Rahmatullin w...@altlinux.org:

Mbox file is recreated during flush(), so the new file has access 
rights according to umask, which is not necessarily the same as of the 
old file.

--
components: Library (Lib)
messages: 82604
nosy: wRAR
severity: normal
status: open
title: mailbox._singlefileMailbox.flush doesn't preserve file rights
type: behavior
versions: Python 2.5

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



[issue4752] Error in SocketServer UDP documentation

2008-12-26 Thread Andrey Petrov

New submission from Andrey Petrov andrey.pet...@shazow.net:

In the SocketServer.UDPServer Example, the second last line:

server = SocketServer.UDPServer((HOST, PORT), BaseUDPRequestHandler)

Should be:

server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler)

--
assignee: georg.brandl
components: Documentation
messages: 78305
nosy: georg.brandl, shazow
severity: normal
status: open
title: Error in SocketServer UDP documentation
versions: Python 2.6, Python 3.0

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



  1   2   >