[issue985064] plistlib crashes too easily on bad files

2010-12-10 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

The attached patch fixes crashes on bad input. The patch implements validation 
for dict and array elements as well as some resource cleanup. The tests are 
included as well.

--
keywords: +patch
nosy: +mher
Added file: http://bugs.python.org/file19996/plist_validation.diff

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



[issue5879] multiprocessing - example "pool of http servers " fails on windows "socket has no attribute fromfd"

2010-12-21 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

py3k does support socket.fromfd on Windows (#1378)

--
nosy: +mher

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



[issue5162] multiprocessing cannot spawn child from a Windows service

2011-01-03 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

Attached test case demonstrates the issue.

--
nosy: +mher
Added file: http://bugs.python.org/file20240/test_issue5162.py

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



[issue5162] multiprocessing cannot spawn child from a Windows service

2011-01-03 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

Treating python services like frozen executables solves the issue. The patch is 
attached.

--
Added file: http://bugs.python.org/file20241/forking_r87679.patch

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



[issue985064] plistlib crashes too easily on bad files

2011-01-04 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

I've replaced plistlib.InvalidPlistError with ValueError

--
Added file: http://bugs.python.org/file20258/plist_validation_v2.diff

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



[issue10174] multiprocessing expects sys.stdout to have a fileno/close method.

2011-01-07 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

The reported error is only reproducible in 2.6

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import multiprocessing
>>> class A:pass
... 
>>> sys.stdin=A()
>>> p=multiprocessing.Pool(processes=2)
Process PoolWorker-1:
Traceback (most recent call last):
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py",
 line 223, in _bootstrap
Process PoolWorker-2:
Traceback (most recent call last):
os.close(sys.stdin.fileno())
AttributeError: A instance has no attribute 'fileno'
>>>   File 
>>> "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py",
>>>  line 223, in _bootstrap
os.close(sys.stdin.fileno())
AttributeError: A instance has no attribute 'fileno'

--
nosy: +mher

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



[issue10174] multiprocessing expects sys.stdout to have a fileno/close method.

2011-01-07 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

This bug was fixed in #5313

--- a/multiprocessing/process.py
+++ b/multiprocessing/process.py
@@ -225,7 +225,8 @@ class Process(object):
 self._children = set()
 self._counter = itertools.count(1)
 try:
-os.close(sys.stdin.fileno())
+sys.stdin.close()
+sys.stdin = open(os.devnull)
 except (OSError, ValueError):
 pass
 _current_process = self

--

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



[issue775321] plistlib error handling

2011-01-12 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

I don't see compelling reasons to wrap ExpatError in ValueError. ExpatError 
contains extra diagnostic information such as line and column numbers.

--

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



[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-04 Thread Mher Movsisyan

Changes by Mher Movsisyan :


--
nosy: +mher.movsisyan

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



[issue18168] plistlib output self-sorted dictionary

2013-06-08 Thread Mher Movsisyan

Mher Movsisyan added the comment:

I think this is not a bug. plistlib api accepts dict (not OrderedDict) and 
sorted output is a valid output. plistlib sorts dictionaries to be consistent 
with Apple's tools.

property list format [1] uses CFDictionary [2] with CFString keys. CFDictionary 
is unordered and the plist example in the format [1] is unordered too. But 
plutil [3] command sorts dictionaries. It is easy to observe by self-converting 
plist files with "plutil -convert xml1 test.plist" command.

1. 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html
 

2. 
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFDictionaryRef/Reference/reference.html

3. 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/plutil.1.html

--
nosy: +mher.movsisyan

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



[issue18828] urljoin behaves differently with custom and standard schemas

2013-08-25 Thread Mher Movsisyan

New submission from Mher Movsisyan:

>>> urljoin('redis://localhost:6379/0', '/1')
'/1'
>>> urljoin('http://localhost:6379/0', '/1')
'http://localhost:6379/1'

--
messages: 196125
nosy: mher.movsisyan
priority: normal
severity: normal
status: open
title: urljoin behaves differently with custom and standard schemas
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

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



[issue5586] The documentation of os.makedirs is misleading

2009-03-28 Thread Mher Movsisyan

New submission from Mher Movsisyan :

The documentation of os.makedirs (http://docs.python.org/library/os.html?
highlight=makedirs#os.makedirs) is misleading. It states that os.makedirs 
raises an 
exception if the leaf directory already exists but it doesn't.

Lib/os.py:

136 def makedirs(name, mode=0777):
137 """makedirs(path [, mode=0777])
138 
139 Super-mkdir; create a leaf directory and all intermediate ones.
140 Works like mkdir, except that any intermediate path segment (not
141 just the rightmost) will be created if it does not exist.  This is
142 recursive.
143 
144 """
145 head, tail = path.split(name)
146 if not tail:
147 head, tail = path.split(head)
148 if head and tail and not path.exists(head):
149 try:
150 makedirs(head, mode)
151 except OSError, e:
152 # be happy if someone already created the path
153 if e.errno != errno.EEXIST:
154 raise
155 if tail == curdir:   # xxx/newdir/. exists if xxx/newdir 
exists
156 return
157 mkdir(name, mode)

The attachment is a patch of the documentation (trunk, revision 70643).

--
assignee: georg.brandl
components: Documentation
files: makedirs.diff
keywords: patch
messages: 84305
nosy: georg.brandl, mher
severity: normal
status: open
title: The documentation of os.makedirs is misleading
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file13439/makedirs.diff

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



[issue5586] The documentation of os.makedirs is misleading

2009-04-05 Thread Mher Movsisyan

Mher Movsisyan  added the comment:

Sorry for confusion. I thought a "leaf directory" is an intermediate-level 
directory.

>>> import os
>>> os.makedirs("/tmp/a/b")
>>>

--

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



[issue17403] Robotparser fails to parse some robots.txt

2013-03-18 Thread Mher Movsisyan

Mher Movsisyan added the comment:

Attaching patch.

--
keywords: +patch
nosy: +mher
Added file: http://bugs.python.org/file29457/parser.patch

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



[issue17403] Robotparser fails to parse some robots.txt

2013-03-19 Thread Mher Movsisyan

Mher Movsisyan added the comment:

The second patch only normalizes the url. From 
http://www.robotstxt.org/norobots-rfc.txt it is not clear how to handle 
multiple rules with the same prefix.

--
Added file: http://bugs.python.org/file29476/parser2.patch

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



[issue17403] Robotparser fails to parse some robots.txt

2013-04-22 Thread Mher Movsisyan

Mher Movsisyan added the comment:

Can you share the link of the new robots.txt standard? I may help to implement 
it.

--

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