[issue10867] python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only

2011-01-08 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only -- messages: 125780 nosy: mmarkk priority: normal severity: normal status: open title: python mmap objects issue msync

[issue10867] python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only

2011-01-08 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Soory, this is dup of Issue2643 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10867

[issue10867] python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only

2011-01-08 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: i'm crazy today. sorry twice. this is not dup of 2643 :( -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10867

[issue10867] mmap.flush() issue msync() even if mapping was created with prot=mmap.PROT_READ only

2011-01-08 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: I have changed title of the bug. This is more precisely describe the problem. In my code, I do mmap.close(), so msync does not called. Generally, calling msync() on read-only mapping is not needed at all. And meven more, calling msync

[issue10944] ctypes documentation does not mention c_bool in table of standard types

2011-01-19 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: http://docs.python.org/library/ctypes.html: --- 15.16.1.4. Fundamental data types [table without c_bool] 15.16.2.7. Fundamental data types class ctypes.c_bool New in version 2.6. -- assignee

[issue10958] stat.S_ISLNK() does not wok!

2011-01-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: ipython session: In [48]: qwe=os.stat('/usr/lib/libstdc++.so.6') In [49]: qwe.st_mode Out[49]: 33188 In [50]: stat.S_ISLNK(qwe.st_mode) Out[50]: False In [51]: stat.S_IFLNK qwe.st_mode Out[51]: 32768 '/usr/lib/libstdc++.so.6' is really

[issue10960] os.stat() does not mention that it follow symlinks by default

2011-01-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Documentation should say about 'following symlink' in this function. Documentation should advice to use os.lstat() in case when it needed. -- assignee: docs@python components: Documentation messages: 126631 nosy: docs@python

[issue10960] os.stat() does not mention that it follow symlinks by default

2011-01-22 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Yes, os.stat and os.lstat should be one after next in docs. Also IMHO, they should have cross-references. See excellent php docs for example. -- ___ Python tracker rep...@bugs.python.org http

[issue11157] Use socket.accept4 syscall under linux

2011-02-08 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: socket.accept() should have optional argument flags. see 'man accept4' It should use fcntl() if accept4() not supported. This is performance issue. -- components: IO, Library (Lib) messages: 128205 nosy: mmarkk priority: normal

[issue11257] asyncore stores unnecessary object references

2011-02-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: asyncore.py: --- def add_channel(self, map=None): #self.log_info('adding channel %s' % self) if map is None: map = self._map map[self._fileno] = self - As we see, it add itself

[issue11259] asynchat

2011-02-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: asynchat does not check if terminator is negative integer. so constructions like self.ac_in_buffer[:n] will lead to misbehaviour. When that integer goes from net, attack can be crafted. For example, on Content-Length field

[issue11259] asynchat does not check if terminator is negative integer

2011-02-20 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- title: asynchat - asynchat does not check if terminator is negative integer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259

[issue11257] asyncore stores unnecessary object references

2011-02-20 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: --- asyncore.py 2010-09-15 22:18:21.0 +0600 +++ asyncore.py 2011-02-21 09:43:15.033839614 +0500 @@ -58,7 +58,7 @@ try: socket_map except NameError: -socket_map = {} +socket_map = weakref.WeakValueDictionary() def

[issue11257] asyncore stores unnecessary object references

2011-02-20 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: sorry, forgot import weakref -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11257

[issue11259] asynchat does not check if terminator is negative integer

2011-02-20 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: asynchat.py: class async_chat: handle_read(): --- elif isinstance(terminator, int) or isinstance(terminator, long): # numeric terminator n = terminator if lb n

[issue11265] asyncore does not check for EAGAIN errno

2011-02-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: According to man: -- ERRORS EAGAIN or EWOULDBLOCK The socket is marked nonblocking and no connections are present to be accepted. POSIX.1-2001 allows either error to be returned for this case, and does

[issue11265] asyncore does not check for EAGAIN errno

2011-02-20 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11265 ___ ___ Python-bugs-list

[issue11266] asyncore does not handle EINTR in recv, send, connect, accept,

2011-02-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: in spite of usage of non-blocking IO, syscalls may return EINTR if signal arrive during some syscalls. It is desirable to re-call syscall after receiving EINTR. Trivial loops should be implemented around (recv, send, connect, accept

[issue10867] mmap.flush() issue msync() even if mapping was created with prot=mmap.PROT_READ only

2011-02-20 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10867

[issue11267] asyncore does not check for POLLERR and POLLHUP if neither readable nor writable

2011-02-20 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: asyncore.py: poll2() : if flags: # Only check for exceptions if object was either readable # or writable. flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL pollster.register(fd, flags

[issue11273] asyncore creates selec (or poll) on every iteration

2011-02-21 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: select.poll() object or r,w,e arrays for select() should not be built from the start in each iteration. For performance issue, such objects should be created in loop() function and modified in add_channel/del_channel. As we do not know

[issue11274] asyncore does not support epoll

2011-02-21 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: epoll support should be added. Big performance boost on large number of sockets. -- components: Library (Lib) messages: 128966 nosy: mmarkk priority: normal severity: normal status: open title: asyncore does not support epoll type

[issue6692] asyncore kqueue support

2011-02-21 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- nosy: +mmarkk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6692 ___ ___ Python-bugs-list

[issue11259] asynchat does not check if terminator is negative integer

2011-02-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Real patch is the first hunk of attached file. Other 2 hunks are optimizations.. -- keywords: +patch Added file: http://bugs.python.org/file20912/z.patch ___ Python tracker rep...@bugs.python.org

[issue11259] asynchat does not check if terminator is negative integer

2011-02-26 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: Removed file: http://bugs.python.org/file20912/z.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259

[issue11259] asynchat does not check if terminator is negative integer

2011-02-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: only first hunk is really the patch. 2 next hunks are optimizations. -- Added file: http://bugs.python.org/file20915/z.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue11259] asynchat does not check if terminator is negative integer

2011-02-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: = ORIGINAL === $ ./qwe.py 10 read length: 10 read data: xx should read test. read: test $ ./qwe.py -10 read length: -10 read data: xx should read test. read: test = PATCHED === $ ./qwe.py 10 read

[issue11259] asynchat does not check if terminator is negative integer

2011-02-26 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: Added file: http://bugs.python.org/file20917/shorttest.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259

[issue11265] asyncore does not check for EAGAIN and EPIPE errno

2011-03-01 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: patch updated for handling EPIPE -- title: asyncore does not check for EAGAIN errno - asyncore does not check for EAGAIN and EPIPE errno Added file: http://bugs.python.org/file20964/z.patch

[issue11265] asyncore does not check for EAGAIN and EPIPE errno

2011-03-03 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: I did not catch EAGAIN in connect() as it makes hang some tests. maybe incorrect tests? which test(s) failed ? mmarkk@fad:/usr/include$ fgrep EWOULDB -r . ./asm-generic/errno.h:#define EWOULDBLOCK EAGAIN /* Operation would block

[issue11259] asynchat does not check if terminator is negative integer

2011-03-03 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: Added file: http://bugs.python.org/file20987/z31.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259

[issue11259] asynchat does not check if terminator is negative integer

2011-03-03 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: actual patch which includes tests I do not understand you. Probably I can not write that patch. Do not know how to. Sorry :( -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue11404] support /dev/null for subprocess.call() and friends

2011-03-04 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: allow to call subprocess.check_call(stderr=subprocess.DEVNULL) -- components: Library (Lib) messages: 130101 nosy: mmarkk priority: normal severity: normal status: open title: support /dev/null for subprocess.call() and friends

[issue11259] asynchat does not check if terminator is negative integer

2011-03-04 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: I've never used negative terminators in asynchat and I'm not even sure why one would want to. no one wants :), but terminator numeric value may be achieved from the net, and hackers sometimes use such technique. attached shorttest.py

[issue11266] asyncore does not handle EINTR in recv, send, connect, accept,

2011-03-04 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: When using non-blocking IO, we issue select (or poll,epoll), and after that kernel should guarantee, that recv or send will complete immediatelly, transferring data as needed. But sometimes (as Linux is buggy), such operations results

[issue11266] asyncore does not handle EINTR in recv, send, connect, accept,

2011-03-04 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2008-02/msg00457.html Okay, linux is not buggy :))) EINTR may occur if SA_RESTART is not specified in sigaction. -- ___ Python tracker rep

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-05 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Big dirs are really slow to read at once. If user wants to read items one by one like here: -- for i in os.listdir() use(i) -- having generator will gain performance, as big directories often very fragmented

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-05 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: also, forgot... memory usage on big directories using list is a pain. This is the same things as range() and xrange(). Why not to add os.xlistdir() ? P.S. Numerical answers will be available later

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-07 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Glibc's readdir() and readdir_r() already do caching Yes, but glibc's readdir is the C analogue of python's generator. We do not need to create cache for cached values. I think it's OK to make python's generator on top of readdir (instead

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-08 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: -1 on going back through blah/xblah all over again. Originally, I want return value of listdir to be changed from list to generator. But next, I thought about compatibility. It will break some code. For example, SimpleHTTPServer: list

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-10 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: http://lwn.net/Articles/216948/ Why kernel.org is slow To proove that readdir is bad thing on large number of items in a directory. Well, EXT4 has fixed some issues (http://ext2.sourceforge.net/2005-ols/paper-html/node3.html) But what

[issue11950] logger use dict for loggers instead of WeakValueDictionary

2011-04-28 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: logger use dict for loggers instead of WeakValueDictionary Now, when object returned by getLogger() gets unreferenced - it will not be garbage collected, as reference is stored in logging module. This will results in leaked file object

[issue11950] logger use dict for loggers instead of WeakValueDictionary

2011-04-29 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: I'm not YUM developer, I'm very sad user of YUM API. Also, I'm novice in python logging complex system. 1. There is no way to remove logger once it added via getLogger(). why? 2. When yum should close handlers? In destructor (cleanup

[issue12103] Documentation of open() does not claim 'e' support in mode string

2011-05-18 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: open() and friends (like temporaryfile) does not document 'e' letter in second arguement. At least on Linux, it opens file with O_CLOEXEC. Not sure under Windows. Also, there are other interesting letters (man -a fopen), like: c (since

[issue12103] Documentation of open() does not claim 'e' support in mode string

2011-05-18 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12103 ___ ___ Python-bugs-list

[issue12104] os.path.join('/some/path', '') adds extra slash at end of result

2011-05-18 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: os.path.join('/some/path', '') adds extra slash at end of result. I expect in that case return value should be '/some/path' but not '/some/path/' -- components: Library (Lib) messages: 136258 nosy: mmarkk priority: normal

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-18 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: In Python3 I'm not able to use open('xxx', 're') as it does not call fopen() anymore. What about extra flags like 'e'=O_CLOEXEC? P.S. see issue12103 for list of needed flags P.P.S does 2to3 tool properly detect such cases

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-18 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- components: +Library (Lib) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12105 ___ ___ Python

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-19 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why not to implement 'e' letter in py3k ? In systems where O_CLOEXEC is not supported in open(), flag should be set non-atomically using fcntl. To exclude races (in concurrent threads), this two ops should be done under lock (GIL

[issue12183] Python does not support lutime() function

2011-05-25 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: see http://www.linuxquestions.org/questions/programming-9/utime-on-a-symbolic-link-743085/: -- Hello, The API utime() is not available for symbolic links. However, with kernel 2.6.22 lutimes() API allowed setting times on atime

[issue12251] subprocess(..., stdout=sys.stderr) closes stderr for child

2011-06-03 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: How to test: #! /usr/bin/python import subprocess, sys # will print err to sys.stderr subprocess.call(['rmdir', '/no_such_dir']) # will NOT print err to sys.stderr subprocess.call(['rmdir', '/no_such_dir'], stdout

[issue12251] subprocess(..., stdout=sys.stderr) closes stderr for child

2011-06-03 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: patch (was not tested) attached -- keywords: +patch Added file: http://bugs.python.org/file7/z.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12251

[issue12251] subprocess(..., stdout=sys.stderr) closes stderr for child

2011-06-03 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why not to backport to python 2.6 ? this is the bug, not a feature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12251

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-10-31 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why it is closed as duplicate? nothing said about CLOEXEC in issue12797 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12105

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-11-01 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Well, I understand. So why not to add 'e' (and 'N', which is the same meaning) character, which: * use O_CLOEXEC in modern Linux * generate Exception if O_CLOEXEC is not supported (or does not work) on platform. Also, implement

[issue12939] Add new io.FileIO using the native Windows API

2011-11-01 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: why not use _open_osfhandle? Because it is wrapper for other CRT functions for Windows, like close(). In other words it is an emulation. I think Python should not create wrapper around wrapper around wrapper... For example, in Python3

[issue12939] Add new io.FileIO using the native Windows API

2011-11-01 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why do you think it makes a difference? Because adding one more dependency on unneeded libraries add the pain. Also it limit us on very restricted API of that wrapper. Windows native API is stable. So it's OK to rely on it's documented

[issue12939] Add new io.FileIO using the native Windows API

2011-11-01 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: The good example of implemetation is QT. I think we can get some things from this library. (Like using \\?\ for long paths (or always, as in QT)). -- ___ Python tracker rep...@bugs.python.org

[issue13769] json.dump(ensure_ascii=False) return str instead of unicode

2012-01-11 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: $ ipython In [1]: type(json.dumps({'a':'b'}, ensure_ascii=False)) Out[1]: type 'str' In [2]: type(json.dumps({'a':u'b'}, ensure_ascii=False)) Out[2]: type 'unicode' --- Documentation: If ensure_ascii is False

[issue13770] python3 json: add ensure_ascii documentation

2012-01-11 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Please fix documentation about ensure_ascii. Does it have any meaning in python3? -- assignee: docs@python components: Documentation messages: 151067 nosy: docs@python, mmarkk priority: normal severity: normal status: open title

[issue13770] python3 json: add ensure_ascii documentation

2012-01-11 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13770 ___ ___ Python-bugs

[issue12939] Add new io.FileIO using the native Windows API

2013-01-03 Thread Марк Коренберг
Марк Коренберг added the comment: Yes, re-writing windows IO to direct API, without intemediate layer is still needed. Please don't close bug. Maybe someone will implement this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14810] tarfile does not support timestamp older 1970-01-01

2013-01-03 Thread Марк Коренберг
Марк Коренберг added the comment: Yes, bug exists in python 2.7. The same problem - negative timestamp in mtime field. It prepresented in binary value as '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\xfc' in my case. -- nosy: +mmarkk ___ Python

[issue14810] tarfile does not support timestamp older 1970-01-01

2013-01-03 Thread Марк Коренберг
Марк Коренберг added the comment: And yes, bug does not appear in python3.2 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14810 ___ ___ Python

[issue16858] tarfile silently hides errors

2013-01-03 Thread Марк Коренберг
New submission from Марк Коренберг: TarFile.next() silently drop error of one of - EOFHeaderError - InvalidHeaderError occur. So, extracting corrupted .tar file will not raise error. -- components: Library (Lib) messages: 179005 nosy: mmarkk priority: normal severity: normal status

[issue16859] tarfile.TarInfo.fromtarfile does not check read() return value

2013-01-03 Thread Марк Коренберг
New submission from Марк Коренберг: tarfile.TarInfo.fromtarfile does not check read() return value. read() may return less than requested size, so, buf = tarfile.fileobj.read(BLOCKSIZE) ... obj.offset = tarfile.fileobj.tell() - BLOCKSIZE may do something nasty. -- messages: 179006

[issue16858] tarfile silently hides errors

2013-01-04 Thread Марк Коренберг
Марк Коренберг added the comment: Ups. hiding EOFHeaderError is not an error. But handilng of other errors is not perfect. Please review TarFile.next() for cases where .tar file is corrupted. For example, TruncatedHeaderError is re-raised only if problem at the start of the file. Really

[issue12460] SocketServer.shutdown() does not have timeout=None parameter

2011-07-01 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Suppose i'm trying to correctly terminate thread with socketserver during application termination. I do not want to wait too long (also do not want to hang), I want to protect against long-lived operations in SimpleServer so something

[issue12461] it's not clear how the shutil.copystat() should work on symlinks

2011-07-01 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: According to http://hg.python.org/cpython/file/588fe0fc7160/Lib/shutil.py it uses utimes(), stat() ans so on, For some people, it's preferable to use lutimes() and lstat(),but for some people it's not. For example, in old implementation

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-01 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Why not to call self.__is_shut_down.set() in constructor ? In reality, if event loop was not started, it mean that server is shut down. -- components: Library (Lib) messages: 139565 nosy: mmarkk priority: normal severity: normal

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-25 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Yes, this is what I want. Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12463

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: In my case, exception occured in separate thread between the begginig of the thread and starting loop. Main thread has a code that correctly stops that separate thread. It just calls loop_thread.server.server_close() and after that, calls

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why you create variable mirror? -- self.__running = False self.__is_shut_down.set() -- You other code is racy. exception may occur at any time. Why not to test state of __is_shut_down

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-07-26 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: class ThreadedRPC(Thread, SimpleXMLRPCServer): def __init__(self): Thread.__init__(self) SimpleXMLRPCServer.__init__(self) # python bug workaround, which eliminate hang on test_exception self

[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

2011-08-08 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Why do you say it hangs? It doesn't hang, it just waits for you to call serve_forever(): it's not a bug, it's actually a feature. Okay, for my case, How I should correctly terminate thread? Conditions: 1. signal may appear at any time 2

[issue12715] Add symlink support to shutil functions

2011-08-21 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- nosy: +mmarkk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12715 ___ ___ Python-bugs-list

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: O_CLOEXEC is not linux-only. Windows has the same flag. In file-opening functions there is lpSecurityAttributes argument. And there is bInheritHandle member of corresponding structure. http://msdn.microsoft.com/en-us/library/aa379560(v=VS

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Some times ago, Python has used fopen() for open() implementation. Now, it uses OS-kernel native function to open files. AFAIK, open() in Windows is a wrapper around CreateFile, created to support some POSIX programs in Windows. Why

[issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Consider code: for (root, dirs, nondirs) in os.walk(path, followlinks=False): print (nondirs) This code will not print symlinks that refer to some dir. I think it is the bug. In other words: If followlinks is True, we should

[issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Also, there is some mis-optimisation for followlinks=False: stat() and then lstat() will be called. Instead of one lstat(). Code may be rewritten as (but I don't know about cross-platform issues

[issue12971] os.isdir() should contain skiplinks=False in arguments

2011-09-13 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: When skiplinks is False (by default), it should as in current implementation, i.e. using stat(). if skiplinks is True, isidr() should use lstat() and same logick. If one will be implemented, os.walk() should be patched (see issue12970

[issue12970] os.walk() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- title: os.wlak() consider some symlinks as dirs instead of non-dirs - os.walk() consider some symlinks as dirs instead of non-dirs ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14886] json C vs pure-python implementation difference

2012-05-23 Thread Марк Коренберг
New submission from Марк Коренберг socketp...@gmail.com: Pure-python implementation: if isinstance(o, (list, tuple)): C implementation: if (PyList_Check(obj) || PyTuple_Check(obj)) This make real difference (!) in my code. So, please change pure-python implementation to: if type(o

[issue14886] json C vs pure-python implementation difference

2012-05-23 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14886 ___ ___ Python-bugs-list

[issue14886] json C vs pure-python implementation difference

2012-05-23 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: #!/usr/bin/python2.7 import json class pseudo_list(object): __class__ = list # fake isinstance def __init__(self, iterator): self._saved_iterator = iterator def __iter__(self): return self._saved_iterator

[issue14886] json C vs pure-python implementation difference

2012-05-24 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Well, __class_ = list is my problem, but python's problem is that it uses different approaches in C and python implementation. P.S. I don't want to subclass list, as I don't want things like this: x = pseudo_list(iter(xrange(10)) x.append

[issue14886] json C vs pure-python implementation difference

2012-05-24 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Inconsistency is bother me. If I specify indent in dumps(), I will have one semantics, else other ones. Why not to fix pure-python implementation using type(o) in (list, tuple) ? This is faster too (as I think

[issue12971] os.isdir() should contain skiplinks=False in arguments

2012-06-27 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Отправлено с iPad 27.06.2012, в 6:03, Larry Hastings rep...@bugs.python.org написал(а): No, follow symlinks is not the same. Skiplinks mean returning true or false depending on fact that last path element is symlink. Checking If symlink

[issue211481] os.stat() doesn't return st_rdev

2012-03-09 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Okay, it returns that field, but still not print one in repr(). Please fix. -- nosy: +mmarkk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue211481

[issue18006] Set thread nema in linux kernel

2013-05-18 Thread Марк Коренберг
New submission from Марк Коренберг: In linux (Since 2.6.9) we can use syscall prctl(PR_SET_NAME, Some thread name) to set thread name to the kernel. This thread is seen under this name in some process tool (like top, ps, pstree (have bug reported connected with this) and others

[issue18006] Set thread name in linux kernel

2013-05-18 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: -- title: Set thread nema in linux kernel - Set thread name in linux kernel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18006

[issue18161] call fchdir if subprocess.Popen(cwd=integer|fileobject)

2013-06-07 Thread Марк Коренберг
New submission from Марк Коренберг: Today, subprocess allow to change directory only by using its name. What if I have only file descriptor referring to that dir? It will be nice if such feture will be implemented. Now, I use preexc_fn to call os.fchdir() by hand. We should handle close_fds

[issue18329] for line in socket.makefile() speed degradation

2013-06-29 Thread Марк Коренберг
New submission from Марк Коренберг: Results or running attached program: $ python2.7 qwe.py TCP mode, makefile method. 198807.2 lines per second (189.6 MB/s). Delay is 5.03 seconds TCP mode, fdopen method. 1041666.7 lines per second (993.4 MB/s). Delay is 0.96 seconds UNIX mode, makefile

[issue18329] for line in socket.makefile() speed degradation

2013-06-29 Thread Марк Коренберг
Марк Коренберг added the comment: Yes, results are repeatable, and for python 2.7 I have roughly same timings for UNIX socket. Also, I have straced all variants and see that in all 4 cases (and for both python versions) IO is done using 8192 blocks in size, so buffering is not cause

[issue18329] for line in socket.makefile() speed degradation

2013-06-29 Thread Марк Коренберг
Марк Коренберг added the comment: Well, python 3.3 is slightly faster: $ python3.3 qwe.py TCP mode, makefile method. 380228.1 lines per second (362.6 MB/s). Delay is 2.63 seconds TCP mode, fdopen method. 877193.0 lines per second (836.6 MB/s). Delay is 1.14 seconds UNIX mode, makefile

[issue18329] for line in socket.makefile() speed degradation

2013-06-29 Thread Марк Коренберг
Changes by Марк Коренберг socketp...@gmail.com: Removed file: http://bugs.python.org/file30731/qwe.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18329

[issue18329] for line in socket.makefile() speed degradation

2013-06-29 Thread Марк Коренберг
Марк Коренберг added the comment: Eliminate unicode conversion for python3, but results still the same $ python2.7 qwe.py TCP mode, makefile method. 211416.5 lines per second (201.6 MB/s). Delay is 4.73 seconds TCP mode, fdopen method. 1041666.7 lines per second (993.4 MB/s). Delay

[issue18329] for line in socket.makefile() speed degradation

2013-06-29 Thread Марк Коренберг
Марк Коренберг added the comment: Can anyone test in python 3.4 ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18329 ___ ___ Python-bugs-list

[issue8052] subprocess close_fds behavior should only close open fds

2014-03-19 Thread Марк Коренберг
Марк Коренберг added the comment: Calling getdents()/readdir64() repeatedly while closing descriptors provides unexpected behaviour. Reading directory while it modified is not safe by default. For example: http://en.it-usenet.org/thread/18514/15719/. So, we should re-open directory if we

[issue8052] subprocess close_fds behavior should only close open fds

2014-03-19 Thread Марк Коренберг
Марк Коренберг added the comment: Also, it is not said in manual if getdents() may be interrupted by signal. Assuming current code, error is not checked, so some (or all) descriptors will be skipped in case of error. -- ___ Python tracker rep

  1   2   3   4   >