[issue40542] path environment variable not created correctly

2020-05-06 Thread Roman


New submission from Roman :

The Python 3.8 for Windows installer has an option to add the install folder to 
the path environment variable. It adds the path to the front of the list so 
that it is the first item. According to my understanding, this is bad behavior. 
It should add new path items to the end of the list because Windows searches in 
order. c:\windows\system32 should remain the first item in the list. This is a 
classic mistake of installers.

--
components: Installation
messages: 368312
nosy: Roman
priority: normal
severity: normal
status: open
title: path environment variable not created correctly
type: behavior
versions: Python 3.8

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



[issue14613] time.time can return None or NaN

2012-04-18 Thread Roman

Changes by Roman :


--
nosy: +rye

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



[issue19093] RE

2013-09-25 Thread Roman

New submission from Roman:

complete my registration

--
messages: 198412
nosy: bjimnen
priority: normal
severity: normal
status: open
title: RE

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



[issue19893] Python cApi memory problem. Py_Initialize memory leak

2013-12-05 Thread Roman

New submission from Roman:

I wrote small test program using Python cApi, and found some memory issues 
while working on it. I checked it with valgrind. (test code and valgrind output 
appended)
Maybe I'm doing something wrong, but most of the problem occurs durring 
Py_Initialize. I've checked python3.2.5 and 3.3.3 version. The latest version 
is much less confusing, but I can still see there something nasty. 
I would be grateful if you could look at this, and tell me If I'm doing 
something wrong, or if I can do something to prevent this memory issues.

--
files: pytest.tgz
messages: 205283
nosy: rstarostecki
priority: normal
severity: normal
status: open
title: Python cApi memory problem. Py_Initialize memory leak
type: resource usage
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file32983/pytest.tgz

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



[issue19893] Python cApi memory problem. Py_Initialize memory leak

2013-12-05 Thread Roman

Roman added the comment:

I didn't use --suppressions=Misc/valgrind-python.supp before . (But I've done 
it now). Nothing important has changed.
I understand that "possibly lost is not particularly informative". I'm  rather 
worried about "Invalid read of size 4" etc. Isn't it potentially dangerous? I 
thought it is some kind of memory corruption, isn't it?

--

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



[issue19893] Python cApi memory problem. Py_Initialize memory leak

2013-12-05 Thread Roman

Roman added the comment:

I've just done it. Python 3.3.3 --with-valgrind. I can't see the difference. 
Output appended.

--
Added file: http://bugs.python.org/file32986/vgrind3.3.3vc.out

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



[issue19893] Python cApi memory problem. Py_Initialize memory leak

2013-12-05 Thread Roman

Roman added the comment:

I compiled python --with-valgrind --without-pymalloc, and used valgrind with 
suppressions. 

valgrind --suppressions=../Misc/valgrind-python.supp --leak-check=full 
--show-reachable=no --show-possibly-lost=no --track-origins=yes 
--log-file=vgrindNext.out ./test

--
Added file: http://bugs.python.org/file32989/vgrindNext.out

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



[issue19893] Python cApi memory problem. Py_Initialize memory leak

2013-12-09 Thread Roman

Roman added the comment:

I've checked it one more time.
And you're right (Sorry for trouble). I left old pyconfig.h in one place, so my 
new python compilation was not just what I wanted. 

Now I belive that everything with memory is ok. 

Thank you very much for your help.

--
status: open -> closed

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



[issue12254] PEP-3107 has a wrong attribute name for function annotations

2011-06-03 Thread Roman Alexeev

New submission from Roman Alexeev :

The name of the attribute holding annotations is `__annotations__`, not 
`func_annotations` as PEP-3107 says.

--
assignee: docs@python
components: Documentation
messages: 137532
nosy: Roman.Alexeev, docs@python
priority: normal
severity: normal
status: open
title: PEP-3107 has a wrong attribute name for function annotations

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



[issue3177] Add shutil.open

2011-07-30 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue10395] new os.path function to extract common prefix based on path components

2011-07-30 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue449227] rlcompleter add "(" to callables feature

2008-06-24 Thread Roman Suzi

Roman Suzi <[EMAIL PROTECTED]> added the comment:

Thanks for the patch!

However, I do not understand if it ever gets included into Python or
remains always for those who find it? (I do not believe this small
change is somehow PEPable, but how it gets included then?)

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



[issue1432] Strange behavior of urlparse.urljoin

2008-07-17 Thread Roman Petrichev

Roman Petrichev <[EMAIL PROTECTED]> added the comment:

Senthil, please read the RFC3986 text, not only examples.
[Page 31] contains exact algorithm how to handle this case.
--cut--
if (R.path == "") then
   T.path = Base.path;
   if defined(R.query) then
  T.query = R.query;
   else
  T.query = Base.query;
   endif;
--cut--

I.e. instead of:
>>> urljoin('http://www.ya.ru/index.php', '?o=30&a=l')
'http://www.ya.ru/?o=30&a=l'
python SHOULD do:
>>> urljoin('http://www.ya.ru/index.php', '?o=30&a=l')
'http://www.ya.ru/index.php?o=30&a=l'

Look at any browser's handling this case.

--
nosy: +tier

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Roman Zeyde

New submission from Roman Zeyde :

The following code shouldn't fail without any warning at all:

>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.bind(('localhost', 7))
>>> print(s.getsockname())
('127.0.0.1', 4464)

After looking through socketmodule.c (rev. 68450), it seems that AF_INET
case casts an "int port" into a "short addr->sin_port", and does not
checks for overflows:

case AF_INET:
{
struct sockaddr_in* addr;
char *host;
int port, result;
if (!PyTuple_Check(args)) {
PyErr_Format(
PyExc_TypeError,
"getsockaddrarg: "
"AF_INET address must be tuple, not %.500s",
Py_TYPE(args)->tp_name);
return 0;
}
if (!PyArg_ParseTuple(args, "eti:getsockaddrarg",
  "idna", &host, &port))
return 0;
addr=(struct sockaddr_in*)addr_ret;
result = setipaddr(host, (struct sockaddr *)addr,
   sizeof(*addr),  AF_INET);
PyMem_Free(host);
if (result < 0)
return 0;
addr->sin_family = AF_INET;
addr->sin_port = htons((short)port);
*len_ret = sizeof *addr;
return 1;
}

--
components: None
messages: 80794
nosy: roman.zeyde
severity: normal
status: open
title: getsockaddrarg() casts port number from int to short without any warning
versions: Python 2.7

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Roman Zeyde

Changes by Roman Zeyde :


--
components: +Extension Modules -None

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-29 Thread Roman Zeyde

Changes by Roman Zeyde :


--
type:  -> behavior

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



[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-02-14 Thread Roman Zeyde

Roman Zeyde  added the comment:

I've checked Python 3.0.1 today (at
http://svn.python.org/projects/python/tags/r301/Modules/socketmodule.c)
and it seems that the bug above has been fixed there too.

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



[issue43619] convenience of using create_datagram_endpoint (and friends)

2021-03-24 Thread Roman Valov


New submission from Roman Valov :

Please check the attached source code.

I have to implement an UDP server listening on all interfaces and able to 
detect what is the local address is used to communicate with remote address. In 
order to do this I'm using a temporary socket connected to exact remote 
endpoint to retrieve it's sock name.

When I implement the solution in a pure `asyncio` fashion I faced pair of 
inconveniences:

ISSUE-1: there is no idiomatic way to sleep forever inside async function. The 
example of using `create_datagram_endpoint` in documentation uses `sleep(3600)` 
which is not so useful. I've used `loop.create_future()` but it's perceived to 
be kind of hack. Also I can't use `loop.run_forever` in this context.

Possible solutions:
 - `serve_forever` for a transport object
 - `asyncio.setup_and_run_forever(main())` -- function to setup file 
descriptors for an event loop and run forever.
 - `asyncio.sleep(None)` or `asyncio.pause()` -- special argument for sleep or 
dedicated `pause` function.


ISSUE-2: callbacks for `Protocol` class are assumed to be sync `def`s. Despite 
the class is designed to be used as a part of `asyncio`. So, in order to invoke 
async code from sync callback I have to add some boilerplate code. Compare with 
`start_server`. It's `client_connected_cb` argument maybe a plain callable or 
co-routine function. So it's proposed to let Protocol callbacks to be `async 
def`s.

--
components: asyncio
files: async.py
messages: 389488
nosy: Roman.Valov, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: convenience of using create_datagram_endpoint (and friends)
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file49912/async.py

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-26 Thread Roman Yurchak


Change by Roman Yurchak :


--
nosy: +Roman Yurchak

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-26 Thread Roman Yurchak


Roman Yurchak  added the comment:

Thanks a lot for working on this!

> _sys_shutdown is the syscall for shutdown(2) used by the socket module.

Yes, the issue with Emscripten is that a number of system calls are either not 
implemented or implemented but not tested. See a list we are using in 
https://github.com/pyodide/pyodide/blob/main/cpython/pyconfig.undefs.h (though 
things might have improved since it was created).

FYI, with Emscripten, the list of CPython unit tests that are currently skipped 
(as of Python 3.9.5) is in 
https://github.com/pyodide/pyodide/blob/main/src/tests/python_tests.txt some of 
those are due to browser VM limitations (e.g. virtual filestem by Emscripten 
that's not fully POSIX compliant, no processes, no sockets, async only via the 
browser event loop etc), others because we are not yet using threading since 
not all browsers support it, and some failures probably need more 
investigation. 

Also opened https://github.com/pyodide/pyodide/issues/2000 . Let us know if 
there is anything we can do help with this effort.

--

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



[issue45898] ctypes cfield.c defines duplicate ffi_type_* symbols

2021-11-26 Thread Roman Yurchak


Change by Roman Yurchak :


--
nosy: +Roman Yurchak

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



[issue38963] multiprocessing processes seem to "bleed" user information (GID/UID/groups)

2019-12-03 Thread Roman Joost


New submission from Roman Joost :

When running a process which changes UID/GID, some of the following processes 
will run as the user I change to per process.

In order to reproduce (see the attached reproducer):
1. Change the 'USERNAME' to an unprivileged user on your system.
2. Run the reproducer as a user with elevated privileges (e.g. root or some 
secondary user you have on your system). Mind you, I don't think the user you 
run as needs elevated privileges, but that's the user I ran as when I observed 
this behaviour.
3. The reproducer iterates over a list (It stems from a test function which was 
checking permissions on log files). Observe the print out, which prints the 
process' GID, UID and secondary groups before we're changing to the users GID, 
UID and secondary groups.
4. You should observe that at some point the process prints the user 
information of the user we want to change to not the one which initially 
started the script.

Example output when running locally as root:

('B', (0, 0, [0]))
('A', (0, 0, [0]))
('C', (0, 0, [0]))
('E', (0, 0, [0]))
('D', (0, 0, [0]))
('F', (1002, 1002, [10, 135, 1000, 1002]))
('H', (1002, 1002, [10, 135, 1000, 1002]))
('I', (1002, 1002, [10, 135, 1000, 1002]))
('J', (1002, 1002, [10, 135, 1000, 1002]))
('G', (1002, 1002, [10, 135, 1000, 1002]))
('K', (1002, 1002, [10, 135, 1000, 1002]))
('L', (1002, 1002, [10, 135, 1000, 1002]))
('M', (1002, 1002, [10, 135, 1000, 1002]))
('N', (1002, 1002, [10, 135, 1000, 1002]))

I would have expected `0` all the way through.

However, if I initialise the Pool with `maxtasksperchild=1` the isolation seems 
as expected.

I don't know whether this is a bug or I'm foolish to invoke multiprocessing 
like this. I've run out of time to investigate this further. It's certainly 
strange behaviour to me and I thought I better report it, since reproducing 
seems fairly deterministic.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: reproducer.py
messages: 357773
nosy: docs@python, romanofski
priority: normal
severity: normal
status: open
title: multiprocessing processes seem to "bleed" user information 
(GID/UID/groups)
type: behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48753/reproducer.py

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



[issue40029] test_importlib.test_zip requires zlib but not marked

2020-03-21 Thread Roman Yurchak


Change by Roman Yurchak :


--
keywords: +patch
nosy: +rth
nosy_count: 2.0 -> 3.0
pull_requests: +18465
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19105

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



[issue40607] asyncio.wait_for should reraise future exception even if timeout expires

2020-05-12 Thread Roman Skurikhin


New submission from Roman Skurikhin :

In https://bugs.python.org/issue32751 asyncio.wait_for behaviour was changed 
that when we use timeout=... and the timeout expires, it waits until task is 
canceled. However, in some cases inner task can trigger exception while it 
handles cancellation. Check the following code:


import asyncio


async def ignore_cancel_and_raise():
try:
await asyncio.sleep(20)
except asyncio.CancelledError:
raise Exception('Cancellation failed')


async def main():
try:
await asyncio.wait_for(ignore_cancel_and_raise(), timeout=1)
except asyncio.TimeoutError:
print('Timeout')

asyncio.run(main())


It will print "Timeout" and log a warning that "Task exception was never 
retrieved".

I think that in case inner task cancelation fails with some error, 
asyncio.wait_for should reraise it instead of silently losing it.

--
components: asyncio
messages: 368723
nosy: Roman Skurikhin, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for should reraise future exception even if timeout expires
type: behavior
versions: Python 3.8

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



[issue40672] asyncio.wait_for: process future result produced during cancelation

2020-05-18 Thread Roman Skurikhin


New submission from Roman Skurikhin :

In https://bugs.python.org/issue40607 asyncio.wait_for behavior was changed so 
it propagates exceptions that happened during cancellation. But it still raises 
`TimeoutError` if cancelation ends with some value being returned. In the 
following example value `42` is lost:

import asyncio


async def return_42_on_cancel():
try:
await asyncio.sleep(20)
except asyncio.CancelledError:
return 42  # `return` is useless in this block.


async def main():
try:
await asyncio.wait_for(return_42_on_cancel(), timeout=1)
except asyncio.TimeoutError:
print('Timeout')

asyncio.run(main())


I think it's better to either:

1) Return that value from `asyncio.wait_for`.

The motivation here is that if the task returns something, we shouldn't conceal 
it. I also searched through GitHub and found some places where others catch 
`CancelledError` and return value 
(https://github.com/grpc/grpc/blob/44fb37c99f2853cc23f04fba15468980d9e28e41/src/python/grpcio/grpc/experimental/aio/_interceptor.py#L328).

It can also be used with some coroutines developed to be wrapped with 
`wait_for`, for example suppose the following equation solving function:

async def solve_iteratively(initial_x, next_approximation):
result = initial_x
try:
while True:
result = next_approximation(result)
await asyncio.sleep(0)
except asyncio.CancelledError:
return result

It allows us to control its execution time using asyncio.wait_for.


2) Add some warning about the value is thrown away (in debug mode) and document 
it somewhere.

===

I am a newbie here, so sorry if it is wrong to create such "proposal" issues.

--
components: asyncio
messages: 369278
nosy: Roman Skurikhin, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for: process future result produced during cancelation
type: enhancement
versions: Python 3.9

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



[issue35409] Async generator might re-throw GeneratorExit on aclose()

2020-05-23 Thread Roman Evstifeev


Change by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue40845] idna encoding fails for Cherokee symbols

2020-06-02 Thread Roman Akopov

New submission from Roman Akopov :

For a specific Cherokee string of three symbols b'\\u13e3\\u13b3\\u13a9' 
generating punycode representation fails.

What steps will reproduce the problem?

Execute 'ꮳꮃꭹ'.encode('idna')
of even more reliable
Execute '\u13e3\u13b3\u13a9'.encode('idna')

What is the expected result?

'xn--f9dt7l'

What happens instead?

'xn--tz9ata7l'

Version affected.

Tested on Python 3.8.3 Windows and Python 3.6.8 CentOS.

Other information.

I was testing if our product supports internationalized domain names. So I had 
written a Python script which generated DNS zone file with punycode encoded 
names and JavaScript file for a browser to send requests to URLs containing 
internationalized domain names. Strings were taken from Common Locale Data 
Repository. 193 various URL, one per language.
 
When executed in Google Chrome, Mozilla Firefox and Microsoft EDGE, domain name 
'ꮳꮃꭹ.myhost.local' is converted to 'xn--f9dt7l.myhost.local', but we have 
'xn--tz9ata7l.myhost.local' in DNS zone file and this is how I had found the 
bug. For 192 other languages I have tested everything works just fine. hese are 
Afrikaans, Aghem, Akan, Amharic, Arabic, Assamese, Asu, Asturian, Azerbaijani, 
Basaa, Belarusian, Bemba, Bena, Bulgarian, Bambara, Bangla, Tibetan, Breton, 
Bodo, Bosnian, Catalan, Chakma, Chechen, Cebuano, Chiga, Czech, Church Slavic, 
Welsh, Danish, Taita, German, Zarma, Lower Sorbian, Duala, Jola-Fonyi, 
Dzongkha, Embu, Ewe, Greek, English, Esperanto, Spanish, Estonian, Basque, 
Ewondo, Persian, Fulah, Finnish, Filipino, Faroese, French, Friulian, Western 
Frisian, Irish, Scottish Gaelic, Galician, Swiss German, Gujarati, Gusii, Manx, 
Hausa, Hebrew, Hindi, Croatian, Upper Sorbian, Hungarian, Armenian, 
Interlingua, Indonesian, Sichuan Yi, Icelandic, Italian, Japanese, Ngomba, 
Machame, Javanese, Georgian, Kabyle, Kamba, Makonde, Kabuverdianu, Kikuyu, 
Kako, Kalaallisut, Kalenjin, Khmer, Kannada, Korean, Konkani, Kashmiri, 
Shambala, Bafia, Colognian, Kurdish, Cornish, Kyrgyz, Langi, Luxembourgish, 
Ganda, Lakota, Lingala, Lao, Lithuanian, Luba-Katanga, Luo, Luyia, Latvian, 
Maithili, Masai, Meru, Malagasy, Makhuwa-Meetto, Metaʼ, Maori, Macedonian, 
Malayalam, Mongolian, Manipuri, Marathi, Malay, Maltese, Mundang, Burmese, 
Mazanderani, Nama, North Ndebele, Low German, Nepali, Dutch, Kwasio, Norwegian 
Nynorsk, Nyankole, Oromo, Odia, Ossetic, Punjabi, Polish, Prussian, Pashto, 
Portuguese, Quechua, Romansh, Rundi, Romanian, Rombo, Russian, Kinyarwanda, 
Rwa, Samburu, Santali, Sangu, Sindhi, Northern Sami, Sena, Sango, Tachelhit, 
Sinhala, Slovak, Slovenian, Inari Sami, Shona, Somali, Albanian, Serbian, 
Swedish, Swahili, Tamil, Telugu, Teso, Tajik, Thai, Tigrinya, Turkish, Tatar, 
Uyghur, Ukrainian, Urdu, Uzbek, Vai, Volapük, Vunjo, Walser, Wolof, Xhosa, 
Soga, Yangben, Yiddish, Cantonese, Standard Moroccan Tamazight, Chinese, 
Traditional Chinese, Zulu.

Somehow specifically Cherokee code points trigger the bug.

On top of that, https://www.punycoder.com/ converts 'ꮳꮃꭹ' into 'xn--f9dt7l' and 
back. However 'xn--tz9ata7l' is reported as an invalid punycode.

--
components: Unicode
messages: 370615
nosy: Roman Akopov, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: idna encoding fails for Cherokee symbols
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

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



[issue40845] idna encoding fails for Cherokee symbols

2020-06-02 Thread Roman Akopov

Roman Akopov  added the comment:

This is how I extract data from Common Locale Data Repository v37
script assumes common\main working directory

from os import walk
from xml.etree import ElementTree

en_root = ElementTree.parse('en.xml')

for (dirpath, dirnames, filenames) in walk('.'):
for filename in filenames:
if filename.endswith('.xml'):
code = filename[:-4]
xx_root = ElementTree.parse(filename)
xx_lang = 
xx_root.find('localeDisplayNames/languages/language[@type=\'' + code + '\']')
en_lang = 
en_root.find('localeDisplayNames/languages/language[@type=\'' + code + '\']')

if en_lang.text == 'Cherokee':
print(en_lang.text)
print(xx_lang.text)
print(xx_lang.text.encode("unicode_escape"))
print(xx_lang.text.encode('idna'))
print(ord(xx_lang.text[0]))
print(ord(xx_lang.text[1]))
print(ord(xx_lang.text[2]))

script outputs

Cherokee
ᏣᎳᎩ
b'\\u13e3\\u13b3\\u13a9'
b'xn--tz9ata7l'
5091
5043
5033

If I change text to lower case

print(en_lang.text.lower())
print(xx_lang.text.lower())
print(xx_lang.text.lower().encode("unicode_escape"))
print(xx_lang.text.lower().encode('idna'))
print(ord(xx_lang.text.lower()[0]))
print(ord(xx_lang.text.lower()[1]))
print(ord(xx_lang.text.lower()[2]))

then script outputs

cherokee
ꮳꮃꭹ
b'\\uabb3\\uab83\\uab79'
b'xn--tz9ata7l'
43955
43907
43897

I am not sure where do you get '\u13e3\u13b3\u13a9' string. 
'\u13e3\u13b3\u13a9'.lower().encode('unicode_escape') gives 
b'\\uabb3\\uab83\\uab79'

--

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2020-08-06 Thread Roman Yurchak


New submission from Roman Yurchak :

The `_Py_Sigset_Converter` function is conditionally defined  in 
https://github.com/python/cpython/blob/777b611c8c5676b80898a429f71d28e59bddc49d/Modules/posixmodule.h#L27
 if `ifdef HAVE_SIGSET_T`

However this function is called unconditionally in 
https://github.com/python/cpython/blob/777b611c8c5676b80898a429f71d28e59bddc49d/Modules/clinic/signalmodule.c.h#L385
 (there are 4 such occurrences), which leads to a compilation error when 
`HAVE_SIGSET_T` is not set.

This is regression in 3.8+ as far as I can tell due to changes in 
https://github.com/python/cpython/pull/6720 

I imagine the solution could be to always define this function but raise an 
exception if it is called when HAVE_SIGSET_T` is undefined, as done in the 
following patch: 
https://github.com/iodide-project/pyodide/blob/fc5495ffdb54a11fd588dc60ba6b8777f90c3724/cpython/patches/0006-fix-Py_Sigset_Converter.patch
 

Would this be acceptable, or is there a better way of handling it? Thanks!

--
messages: 374963
nosy: Roman Yurchak, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set
versions: Python 3.8, Python 3.9

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2020-08-06 Thread Roman Yurchak


Change by Roman Yurchak :


--
type:  -> compile error

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



[issue35429] Incorrect use of raise NotImplemented

2018-12-06 Thread Roman Yurchak


New submission from Roman Yurchak :

In two places in stdlib, `raise NotImplemented` is used instead of `raise 
NotImplementedError`. The former is not valid and produces,

```
>>> raise NotImplemented('message')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NotImplementedType' object is not callable
```

--
components: Library (Lib)
messages: 331244
nosy: rth
priority: normal
severity: normal
status: open
title: Incorrect use of raise NotImplemented
versions: Python 3.8

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



[issue35429] Incorrect use of raise NotImplemented

2018-12-06 Thread Roman Yurchak


Change by Roman Yurchak :


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

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



[issue35430] Lib/argparse.py uses `is` for string comparison

2018-12-06 Thread Roman Yurchak


New submission from Roman Yurchak :

Lib/argparse.py uses `is` for string comparison,

`
221:if self.heading is not SUPPRESS and self.heading is not None:
247:if text is not SUPPRESS and text is not None:
251:if usage is not SUPPRESS:
256:if action.help is not SUPPRESS:
290:if part and part is not SUPPRESS])
679:if action.default is not SUPPRESS:
1130:if self.dest is not SUPPRESS:
1766:if action.dest is not SUPPRESS:
1768:if action.default is not SUPPRESS:
1851:if argument_values is not SUPPRESS:
2026: if action.help is not SUPPRESS]
`

where `SUPPRESS = '==SUPPRESS=='`. Unless I'm missing something this can 
produce false negatives if the variable that we compare against is a slice from 
another string. Using equality is probably safer in any case.

Detected with LGTM.com analysis.

--
components: Library (Lib)
messages: 331246
nosy: rth
priority: normal
severity: normal
status: open
title: Lib/argparse.py uses `is` for string comparison
versions: Python 3.8

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



[issue35430] Lib/argparse.py uses `is` for string comparison

2018-12-06 Thread Roman Yurchak


Change by Roman Yurchak :


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

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



[issue35430] Lib/argparse.py uses `is` for string comparison

2018-12-06 Thread Roman Yurchak


Roman Yurchak  added the comment:

Thanks, Alexey and Serhiy! Looking at the code more closely I would agree. I 
guess changing the value of the suppress object to something else to avoid the 
warning, has a potential of breaking code that relies on the current 
functionality and is not worth it...

--

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



[issue35429] Incorrect use of raise NotImplemented

2018-12-06 Thread Roman Yurchak


Roman Yurchak  added the comment:

Resolved in https://bugs.python.org/issue33023

--
resolution:  -> duplicate

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



[issue35549] Add partial_match: bool = False argument to unicodedata.lookup

2018-12-21 Thread Roman Inflianskas


New submission from Roman Inflianskas :

I propose to add partial_match: bool = False argument to unicodedata.lookup so 
that the programmer could search Unicode symbols using partial_names.

--
components: Unicode
messages: 332283
nosy: ezio.melotti, rominf, vstinner
priority: normal
severity: normal
status: open
title: Add partial_match: bool = False argument to unicodedata.lookup
type: enhancement
versions: Python 3.8

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



[issue35549] Add globbing to unicodedata.lookup

2018-12-21 Thread Roman Inflianskas


Roman Inflianskas  added the comment:

I like your proposal with globbing, steven.daprano.

I updated the title.

--
title: Add partial_match: bool = False argument to unicodedata.lookup -> Add 
globbing to unicodedata.lookup

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



[issue32776] asyncio SIGCHLD scalability problems

2019-04-04 Thread Roman Evstifeev


Change by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue33533] Provide an async-generator version of as_completed

2019-04-05 Thread Roman Evstifeev


Change by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue35108] inspect.getmembers passes exceptions from object's properties through

2018-10-30 Thread Roman Inflianskas


New submission from Roman Inflianskas :

I use inspect.getmembers for getting members of 
splinter.webdriver.BaseWebDriver. The problem is that it has a property 
status_code raises NotImplementedError: 
https://github.com/cobrateam/splinter/blob/master/splinter/driver/webdriver/__init__.py#L191.
 This exception passes through try block in 
https://github.com/python/cpython/blob/master/Lib/inspect.py#L343 because it 
doesn't contain:
except Exception:
pass
section.
In the result, instead of members of the object, I get an exception.

I think there are two possible expected behaviors:
1. Just ignore the exceptions and return members without the members, that 
raise exceptions.
2. Instead of members, return tuple like:
...
try:
...
except Exception as e:
RAISES_EXCEPTION = object()
value = (RAISES_EXCEPTION, e)
...

--
components: Library (Lib)
messages: 328885
nosy: rominf
priority: normal
severity: normal
status: open
title: inspect.getmembers passes exceptions from object's properties through
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue18095] unable to invoke socket.connect with AF_UNSPEC

2013-05-29 Thread Roman Valov

New submission from Roman Valov:

There is a way to "disconnect" UDP socket
that was previously "connected" to specific
remote endpoint in C:

  struct sockaddr_in sin;
  memset((char *)&sin, 0, sizeof(sin));
  sin.sin_family = AF_UNSPEC;
  connect(fd, (struct sockaddr *)&sin, sizeof(sin));

However in this is not available in python, since connect
accepts only (host, port) as a parameter for UDP socket.

It's possible to drop "port" connection with port=0,
however I can't find a way to drop "host" connection.

--
components: IO
messages: 190308
nosy: Roman.Valov
priority: normal
severity: normal
status: open
title: unable to invoke socket.connect with AF_UNSPEC
type: behavior
versions: Python 3.3

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



[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde

New submission from Roman Zeyde:

Reproduction:

Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.pack('!L', 0x01020304)
'\x01\x02\x03\x04'
>>> struct.pack('>L', 0x01020304)
'\x01\x02\x03\x04'
>>> struct.pack('>> struct.pack('L', 0x01020304)
'\x04\x03\x02\x01\x00\x00\x00\x00' ### WAT??? ###
>>> 

As far as I see at the source code 
(http://hg.python.org/releasing/2.7.4/file/9290822f2280/Modules/_struct.c#l703),
 sizeof(long) is used as the size of 'L', which is equal to 8 at 64bit Linux...

The problem is that the results of packing with 'L' returns 8 bytes,
instead of 4 - as was expected from the documentation...

--
components: Interpreter Core
messages: 190817
nosy: Roman.Zeyde
priority: normal
severity: normal
status: open
title: struct.pack() behaves strangely for 'L' on 64bit Linux
type: behavior
versions: Python 2.7

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



[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde

Roman Zeyde added the comment:

You are correct - the documentation is right: 
"Format characters have the following meaning; the conversion between C and 
Python values should be obvious given their types. The ‘Standard size’ column 
refers to the size of the packed value in bytes when using standard size; that 
is, when the format string starts with one of '<', '>', '!' or '='. When using 
native size, the size of the packed value is platform-dependent."

So indeed, there is no problem - just my own misinterpretation of the docs...

--
status: pending -> open
type:  -> behavior

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



[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde

Changes by Roman Zeyde :


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

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



[issue19776] Provide expanduser() on Path objects

2014-04-26 Thread Roman Inflianskas

Roman Inflianskas added the comment:

I think that `absolute` method should call `expanduser` and `expandvars` (do 
you plan to include it?) automatically. This should be optional (via default 
arguments: `expanduser=True, expandvars=True`.

--
nosy: +rominf

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



[issue21405] Allow using symbols from Unicode block "Superscripts and Subscripts" in identifiers

2014-04-30 Thread Roman Inflianskas

New submission from Roman Inflianskas:

It's really useful that python 3 allows me to use some Unicode symbols (as 
specified in 
https://docs.python.org/3.4/reference/lexical_analysis.html#identifiers), 
especially Greek symbols for mathematical programs. But when I write 
mathematical program with lots of indices I would like to use symbols from 
block "Superscripts and Subscripts" (as id_continue), for example: 

⁴₂₍₎

I don't see any problems with allowing yet another subset of Unicode symbols. 
In Julia, for example, I can use them without problems.

--
components: Unicode
messages: 217681
nosy: ezio.melotti, haypo, rominf
priority: normal
severity: normal
status: open
title: Allow using symbols from Unicode block "Superscripts and Subscripts" in 
identifiers
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue21405] Allow using symbols from Unicode block "Superscripts and Subscripts" in identifiers

2014-05-01 Thread Roman Inflianskas

Roman Inflianskas added the comment:

I'm sorry, I didn't now that bugtracker is not for features discussing. I'll 
wrote the letter to the python-ideas: 
https://groups.google.com/forum/#!topic/python-ideas/yjR7j9TSFeE

--

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



[issue21405] Allow using symbols from Unicode block "Superscripts and Subscripts" in identifiers

2014-05-04 Thread Roman Inflianskas

Roman Inflianskas added the comment:

See later discussion there: 
https://mail.python.org/pipermail/python-ideas/2014-May/027767.html

Because of https://mail.python.org/pipermail/python-ideas/2014-May/027789.html 
I'm closing this issue.

--
resolution:  -> rejected
status: open -> closed

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



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2012-12-06 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue7062] No docs for module 'IN'

2009-10-04 Thread Roman Sokolov

New submission from Roman Sokolov :

Python 2.6.3 (r263:75183, Oct  2 2009, 11:22:08)
>>> import IN
>>> help(IN)

-- contain following lines:
"MODULE DOCS
http://docs.python.org/library/IN";
, but server returns 404 error:
"The requested URL /library/IN was not found on this server."
and no docs found in source distribution:
$ cat ~/terrarium/sources/py26st/Doc/library/IN.rst
cat: /home/roma/terrarium/sources/py26st/Doc/library/IN.rst: No such 
file or directory

--
assignee: georg.brandl
components: Documentation
messages: 93576
nosy: RSokolov, georg.brandl
severity: normal
status: open
title: No docs for module 'IN'
versions: Python 2.6

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



[issue8779] utf8 codec fails to parse a character

2010-05-20 Thread Roman Gershman

New submission from Roman Gershman :

The following code fails to parse the attached file:


#!/usr/bin/python3.1

if __name__ == '__main__':
 f = open("c:\\1.txt", mode ='r', encoding='utf-8')
 for line in f:
 print (line)

--
components: Unicode
files: 1.txt
messages: 106195
nosy: Roman.Gershman
priority: normal
severity: normal
status: open
title: utf8 codec fails to parse a character
versions: Python 3.1
Added file: http://bugs.python.org/file17421/1.txt

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



[issue27151] multiprocessing.Process leaves read pipes open (Process.sentinel)

2016-05-29 Thread Roman Bolshakov

New submission from Roman Bolshakov:

There's no code that closes read pipe(Process.sentinel) when a Process is 
joined. That creates issues in long running programs as the pipe's file 
descriptors are effectively leaked.

--
components: Library (Lib)
files: leak.py
messages: 266598
nosy: Roman Bolshakov
priority: normal
severity: normal
status: open
title: multiprocessing.Process leaves read pipes open (Process.sentinel)
type: resource usage
versions: Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file43046/leak.py

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



[issue27151] multiprocessing.Process leaves read pipes open (Process.sentinel)

2016-07-06 Thread Roman Bolshakov

Roman Bolshakov added the comment:

multiprocessing.Queue._writer is affected by similar issue. _writer FD is left 
open after .close() is invoked on a Queue.

--
Added file: http://bugs.python.org/file43642/leak.py

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



[issue27151] multiprocessing.Process leaves read pipes open (Process.sentinel)

2016-07-06 Thread Roman Bolshakov

Changes by Roman Bolshakov :


Removed file: http://bugs.python.org/file43046/leak.py

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



[issue26865] Meta-issue: support of the android platform

2016-07-28 Thread Roman Evstifeev

Roman Evstifeev added the comment:

While not only android issue, there is a problem with dumbdbm module: it 
internally tries to do os.chmod() on a FAT-formatted sdcard and fails, because 
FAT does not support chmod.

--

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



[issue17680] self is lost if methods are callable objects

2013-04-09 Thread Roman Rader

New submission from Roman Rader:

Some strange behavior is observed while method in object substitutes with 
callable object.

For example:
-
class Meth(object):
def __call__(*args, **kwargs):
print (args, kwargs)

class X(object):
def some_method(*args, **kwargs):
print (args, kwargs)

x = X()
x.some_method(1)
X.some_method = Meth()
x.some_method(1)

-
Output
(<__main__.X object at 0xb72d408c>, 1) {}
(<__main__.Meth object at 0xb72d40cc>, 1) {}
-

So, second call lost caller object ("self").
I suppose second output should be
(<__main__.Meth object ...>, <__main__.X object ...>, 1) {}


Tested in Python 2.7 and Python 3.3.

--
components: Interpreter Core
messages: 186410
nosy: Roman.Rader
priority: normal
severity: normal
status: open
title: self is lost if methods are callable objects
versions: Python 2.7, Python 3.3

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



[issue9928] weird oddity with bz2 context manager

2015-09-23 Thread Roman Valls

Roman Valls added the comment:

It still seems to be failing with Python 2.7.10... or am I doing sth wrong? :/


$ ipython
Python 2.7.10 |Anaconda 2.2.0 (x86_64)| (default, May 28 2015, 17:04:42)
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import bz2
In [2]: import pandas as pd
In [3]: import numpy as np
In [4]: import matplotlib as plt
In [5]: import seaborn as sns
In [6]: import cPickle as pickle

In [7]: with open("./collectl_info.pickle.bz2", "rb") as comp:
   ...: with bz2.decompress(comp.read()) as decomp:
   ...: data, hardware, steps = pickle.load(decomp)
   ...:

---
AttributeErrorTraceback (most recent call last)
 in ()
  1 with open("./collectl_info.pickle.bz2", "rb") as comp:
> 2 with bz2.decompress(comp.read()) as decomp:
  3 data, hardware, steps = pickle.load(decomp)
  4

AttributeError: __exit__

--
nosy: +Roman Valls
versions:  -Python 3.1, Python 3.2

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



[issue9928] weird oddity with bz2 context manager

2015-09-23 Thread Roman Valls

Roman Valls added the comment:

Gotcha, sorry about that :-S

On Wed, Sep 23, 2015 at 4:43 PM, Armin Rigo  wrote:
>
> Armin Rigo added the comment:
>
> Roman: bz2.decompress(comp.read()) returns a string, so you can't use "with" 
> on it.  This bug was about using "with bz2.BZ2File(...) as f:".
>
> --
>
> ___
> Python tracker 
> <http://bugs.python.org/issue9928>
> ___

--

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



[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-16 Thread Roman Kozhemiakin

New submission from Roman Kozhemiakin:

open('.\\PHYSICALDRIVE1','rb',0)
fails since python 3.5

At the end of _io_FileIO___init___impl function 
_Py_fstat call raise OSError: [WinError 1] Incorrect function
_Py_fstat result not used on windows in this place. 

 440 self->blksize = DEFAULT_BUFFER_SIZE;
---> 441 if (_Py_fstat(self->fd, &fdfstat) < 0)
 442 goto error;
 443 #if defined(S_ISDIR) && defined(EISDIR)
 444 /* On Unix, open will succeed for directories.
 445In Python, there should be no file objects referring to
 446directories, so we need a check.  */
 447 if (S_ISDIR(fdfstat.st_mode)) {
 448 errno = EISDIR;
 449 PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, nameobj);
 450 goto error;
 451 }
 452 #endif /* defined(S_ISDIR) */
 453 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
 454 if (fdfstat.st_blksize > 1)
 455 self->blksize = fdfstat.st_blksize;
 456 #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */

--
components: Library (Lib)
messages: 254756
nosy: rokozh
priority: normal
severity: normal
status: open
title: open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: 
[WinError 1] Incorrect function
type: behavior
versions: Python 3.5

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



[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-17 Thread Roman Kozhemiakin

Roman Kozhemiakin added the comment:

>I don't know the physical disk type on Windows. Can you read and write from 
>such "file" type?

Yes this "files" can be readed and writed (with restriction - size of the data 
must be a multiple of the sector size)

in python 3.4.3 open,read,write,seek - works fine (with raw usb disk)
for python 3.5 as workaround I replaced these functions to os.

>2) get the block size
st_blksize is not implemented under windows

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2016-04-20 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue2636] Adding a new regex module (compatible with re)

2016-04-20 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-04-20 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26859] unittest fails with "Start directory is not importable"

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26865] toward the support of the android platform

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26858] setting SO_REUSEPORT fails on android

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26856] android does not have pwd.getpwall()

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26849] android does not support versioning in SONAME

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26853] missing symbols in curses and readline modules on android

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue26855] add platform.android_ver() for android

2016-04-26 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-27 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue17905] Add check for locale.h

2016-04-27 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-04-27 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue16353] add function to os module for getting path to default shell

2016-04-27 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue24156] unit test

2015-05-10 Thread Roman Rader

Changes by Roman Rader :


--
nosy: Roman.Rader
priority: normal
severity: normal
status: open
title: unit test

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



[issue24156] test.test_ssl.ThreadedTests unit test failed

2015-05-10 Thread Roman Rader

New submission from Roman Rader:

==
FAIL: test_server_accept (test.test_ssl.ThreadedTests)
--
Traceback (most recent call last):
  File "/home/roma/Documents/MY/cpython/Lib/test/test_ssl.py", line 2904, in 
test_server_accept
self.assertEqual(peer, client_addr)
AssertionError: Tuples differ: ('192.168.1.103', 43446) != ('127.0.0.1', 43446)

--
components: +Tests
title: unit test -> test.test_ssl.ThreadedTests unit test failed
versions: +Python 3.5

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



[issue24156] test.test_ssl.ThreadedTests unit test failed

2015-05-12 Thread Roman Rader

Roman Rader added the comment:

You're right, it does not reproduces on any machine. I'm using Arch Linux, 
still trying to figure out the repro steps.

My hosts file doesn't contain such entries for localhost, it's pretty standard. 
If I disable my external network interface, it retrieves my second IP from 
virtual interface. And only when I disable all interfaces, I can get 127.0.0.1 
on source in IP packet.

The problem is, even if I enforce client to bind to "127.0.0.1", it substitutes 
as well (see https://gist.github.com/rrader/3e575cde56827b1f74a1).

strace is clean, Python calls all kernel functions with 127.0.0.1 IP. So, I 
suppose, the problem not in the Python code itself, but somewhere deeper 
(however it can be lack of some flags?)

--

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



[issue27400] Datetime NoneType after calling Py_Finalize and Py_Initialize

2016-09-15 Thread Roman Evstifeev

Changes by Roman Evstifeev :


--
nosy: +Roman.Evstifeev

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



[issue28472] SystemTap usage examples in docs are incorrect

2016-10-18 Thread Roman Podoliaka

New submission from Roman Podoliaka:

There are a couple of errors in SystemTap examples from "Instrumenting CPython 
with DTrace and SystemTap" page 
(https://docs.python.org/dev/howto/instrumentation.html):

1) in SystemTap double quotes are used to denote string literals. As is 
examples fail with:

parse error: expected literal string or number
saw: operator ''' at show_call.stp:1:15
 source: probe process('python').mark("function__entry") {

2) stap -c option expects a command as a single string argument, not as a list 
of strings. As is the following example:

$ stap \
  show-call-hierarchy.stp \
  -c ./python test.py

will not run a test.py script, but instead ./python without any args, thus it 
will print a
prompt (i.e. >>>) and wait for user input.

--
assignee: docs@python
components: Documentation
files: patch.diff
keywords: patch
messages: 278944
nosy: docs@python, rpodolyaka
priority: normal
severity: normal
status: open
title: SystemTap usage examples in docs are incorrect
versions: Python 3.6
Added file: http://bugs.python.org/file45138/patch.diff

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



[issue20924] openssl init 100% CPU utilization

2014-03-28 Thread Roman O. Vlasov

Roman O. Vlasov added the comment:

To reproduce the 100% CPU load problem, we used a simple python TLS client on 
separate linux PC with Traffic control utility (tc):
tc qdisc change dev eth0 root netem delay 5000ms

After in-depth analyzing, we realized that _ssl.c behaves differently depening 
on socket.timeout:

1) sock.timeout set to None, that is equivalent to s->socket_timeout==-1 in 
_ssl.c produces 100% CPU load if client works on bad long delay channel.
The problem is this case is that the do{} loop runs in PySSL_SSLdo_handshake() 
calling check_socket_and_wait_for_timeout() which immediatly returns 
SOCKET_IS_BLOCKING because s->sock_timeout==-1. 

2) sock.timeout set to 0 (non-blocking) makes _ssl.c immediatly return with 
error:
_ssl.c: The operation did not complete

3) socket.timeout set to any positive value makes _ssl.c wait socket on select 
(producing no CPU load).

By default, accept() returns blocking socket with timeout set to None (1st case)

Below are some code details:

Our server class is inherited from asyncore.dispatcher.
In __init__ it executes the following statements (ripped), 
creating listening socket, accepting client connection and then doing 
wrap_socket:

---
asyncore.py: 
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setblocking(0)
sock.setsockopt(
socket.SOL_SOCKET, 
socket.SO_REUSEADDR,
socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1
)
sock.bind(self.server_address)
sock.listen(5)
asyncore.loop(...)
select.select(...)  # wait for client connection

# Here client connects

conn, addr = sock.accept()
# conn.gettimeout() returns None which means blocking socket
ssl_sock = ssl.wrap_socket(
conn
, server_side = server_side
, certfile = certfile
, cert_reqs = cert_reqs
, ssl_version=ssl.PROTOCOL_SSLv3
)

File "C:\Python27\Lib\ssl.py", line 399, in wrap_socket
File "C:\Python27\Lib\ssl.py", line 152, in __init__
self.do_handshake()
File "C:\Python27\Lib\ssl.py", line 315, in do_handshake
self._sslobj.do_handshake()
_ssl.c:
PySSL_SSLdo_handshake():
// wants to read more data from socket
if (err == SSL_ERROR_WANT_READ) {
sockstate = 
check_socket_and_wait_for_timeout(self->Socket, 0);
...
check_socket_and_wait_for_timeout():
/* Nothing to do unless we're in timeout mode (not 
non-blocking) */
if (s->sock_timeout < 0.0)
return SOCKET_IS_BLOCKING;  // <-- this is 
1st case producing 100% CPU load
else if (s->sock_timeout == 0.0)
return SOCKET_IS_NONBLOCKING;   // <-- this is 2nd case 
returning error immediatly

We think that anyone who follows standard Python documentation 
(http://docs.python.org/2/library/ssl.html#server-side-operation) will get the 
same result if using client with delay>1000ms

--
nosy: +rv

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



[issue20924] openssl init 100% CPU utilization

2014-04-08 Thread Roman O. Vlasov

Roman O. Vlasov added the comment:

Antoine, Martin, thank you for your replies. You was right: NT socket was not 
in blocking mode (in 1st case). I didn't knew how to determine socket mode in 
NT, so I explicitly set socket mode to blocking in _ssl.c before calling 
SSL_do_handshake() for test:

_ssl.c::PySSL_SSLdo_handshake():

//  Explicitly set blocking mode
unsigned long iMode = 0UL; // If iMode = 0, blocking is enabled; 
int iResult = ioctlsocket( self->Socket->sock_fd, FIONBIO, &iMode );
if (iResult != NO_ERROR)
printf("\nioctlsocket failed with error: %ld\n", iResult);
// 
PySSL_BEGIN_ALLOW_THREADS
ret = SSL_do_handshake(self->ssl);
...

Test result: SSL_do_handshake() did not return (and no CPU load).

But in general, I think that check_socket_and_wait_for_timeout() logic is 
erroneous:
if (s->sock_timeout < 0.0)
return SOCKET_IS_BLOCKING;

By default (see case #1 in my message above), timeout in Python wrapping object 
is -1 (self->Socket->sock_timeout==-1). But underlying NT socket is really 
non-blocking. This leads to 100% CPU load: PySSL_SSLdo_handshake() loop is 
calling check_socket_and_wait_for_timeout() which immediately returns.

NB. I use Python 2.7.6 and openssl-0.9.8y for my build and never tried Python 3.

--

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