[issue2522] locale.format() problems with decimal separator

2009-03-30 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi misho...@gmail.com added the comment:

Nice to see this moving forward. Your patch looks nicer than my naive
approach and I hope it's going to be applied. Thanks for investigation. :)

--

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



[issue5580] Strange error message in Python/getargs.c

2009-03-27 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi misho...@gmail.com:

I think the following message is a little bit confusing:
Python 2.7a0 (trunk, Mar 17 2009, 12:06:19)
[GCC 4.3.2] on linux2
Type help, copyright, credits or license for more information.
 open('abc\x00')
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: file() argument 1 must be (encoded string without NULL
bytes), not str

This message could be much more better if unneeded parentheses were
removed. :)
The message on line 861 in Python/getargs.c reads much better:
string without null bytes
Would it be appropriate to change the message in topic to something like
this?

--
messages: 84264
nosy: mishok13
severity: normal
status: open
title: Strange error message in Python/getargs.c
versions: Python 2.7

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



[issue4662] posix module lacks several DeprecationWarning's

2008-12-14 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi misho...@gmail.com:

posix module lacks DeprecationWarning for the functions listed below:
tempnam, tmpfile, fdopen, getcwdu, popen, tmpnam
All of these are absent in 3.0, so I think adding DeprecationWarning to
all of them would be useful.
Attaching a straight-forward patch against latest trunk checkout.

--
files: posixmodule.patch
keywords: patch
messages: 77810
nosy: mishok13
severity: normal
status: open
title: posix module lacks several DeprecationWarning's
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file12354/posixmodule.patch

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



[issue4662] posix module lacks several DeprecationWarning's

2008-12-14 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi misho...@gmail.com:


Removed file: http://bugs.python.org/file12354/posixmodule.patch

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



[issue4662] posix module lacks several DeprecationWarning's

2008-12-14 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi misho...@gmail.com added the comment:

I've missed one simple thing -- posix.getcwdu has been renamed to
posix.getcwd in 3.0, so adding Py3k deprecation warning to this function
is not really needed. Instead a fix for this should be added to the list
of 2to3 fixes.
I've also fixed the warnings according to Martin's proposal and updated
the patch.

Added file: http://bugs.python.org/file12356/posixmodule.patch

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



[issue4255] timing module refers to non-existent documentation

2008-11-03 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

Well, it's listed in Undocumented modules:
http://docs.python.org/library/undoc.html#obsolete
so I wouldn't call this a bug.

--
nosy: +mishok13

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



[issue3436] csv.DictReader inconsistency

2008-08-01 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

Oh, so this is how the process looks like...
/me removes patches
I've uploaded both py3k and trunk patches just because I'm fixing things
the other way round -- first I write a patch for 3.0 and only after that
I backport it to 2.6. Stupid me. :)

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



[issue3436] csv.DictReader inconsistency

2008-08-01 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file11016/issue3436.py3k.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-08-01 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file11017/issue3436.trunk.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-31 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file11016/issue3436.py3k.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-31 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file11017/issue3436.trunk.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-31 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

I like the idea of fieldnames attribute being a property, so i've
uploaded patches that implement them as such.
Both patches ran through make test without problems.

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



[issue3436] csv.DictReader inconsistency

2008-07-30 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file10967/trunk.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-30 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file10965/py3k.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-28 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

I'm ok with that. :)
Looks like you can close this one as won't fix.

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



[issue3436] csv.DictReader inconsistency

2008-07-24 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

I had to use csv module recently and ran into a problem with
DictReader. I had to get headers of CSV file and only after that iterate
throgh each row. But AFAIU there is no way to do it, other then
subclassing. So, basically, right now we have this:

Python 3.0b2+ (unknown, Jul 24 2008, 12:15:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
 import csv
 r = csv.DictReader(open('test.csv'))
 r.fieldnames
 next(r)
{'baz': '13', 'foo': '42', 'bar': '27'}
 r.fieldnames
['foo', 'bar', 'baz']

I think it would be much more useful, if DictReader got 'fieldnames' on
calling __init__ method, so this would look like this:
 r = csv.DictReader(open('test.csv'))
 r.fieldnames
['foo', 'bar', 'baz']

The easy way to do this is to subclass csv.DictReader.
The hard way to do this is to apply the patches I'm attaching. :)
These patches also remove redundant check for self.fieldnames being None
for each next()/__next__() call

--
files: py3k.csv.py.diff
keywords: patch
messages: 70207
nosy: mishok13
severity: normal
status: open
title: csv.DictReader inconsistency
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file10965/py3k.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-24 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file10966/trunk.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-24 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file10966/trunk.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-24 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file10967/trunk.csv.py.diff

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



[issue3436] csv.DictReader inconsistency

2008-07-24 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


--
components: +Library (Lib)
type:  - behavior

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



[issue3436] csv.DictReader inconsistency

2008-07-24 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

And how this method should look?
Something like this, I suppose:
def getheader(self):
if self.fieldnames is None:
try:
self.fieldnames = self.reader.next()
except StopIteration:
pass
 return self.fieldnames

Well, adding new API after beta2 is a no-no as I understand, so this
getheader() method can be added only in 2.7/3.1 releases. Should I post
updated patches or just live with it?

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-24 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

btw, some of the docstrings are also outdated, e.g. Pool.imap, Pool.map,
etc. Should I handle this one too?

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-24 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

OK, I'll work on this too. :) Patch should be ready by Monday.

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-23 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file10848/multiprocessing.rst.diff

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-23 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file10960/issue3256.multiprocessing.rst.diff

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-23 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

Here is the updated version of multiprocessing.rst patch. Not much has
changes, as you can see (if you've seen the previous version, of course
;) ).
I have only one question left about multiprocessing.rst, it's about
'allow_connection_pickling' function -- should documentation cover this
function or just leave it as it is?
The only issue I still have is mp_distributing.py example, which is not
properly documented.
Jesse, I think you should review both patches and leave this issue open
until mp_distributing.py is documented. If you have any questions --
ping me on #python-dev.

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



[issue3375] _multiprocessing.so build problems

2008-07-16 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

Attached the log of 'make -d' on clean checkout of py3k branch. This is
on Ubuntu 8.04.1.

--
nosy: +mishok13
Added file: http://bugs.python.org/file10907/make-d.log.bz2

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



[issue3352] Deficiencies in multiprocessing/threading API

2008-07-14 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

Actually, 'getx' - 'fget'. Sorry for the typo. :)

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



[issue3354] sort(reverse=None) prints misleading error message

2008-07-14 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


--
nosy: +mishok13

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



[issue3325] use of cPickle in multiprocessing

2008-07-09 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

There are two places in multiprocessing where cPickle (gone from py3k
already) is used.
Both of them are in try .. except, so they don't break code.
Here is a patch that removes these uses.

--
components: Library (Lib)
messages: 69463
nosy: jnoller, mishok13, roudkerk
severity: normal
status: open
title: use of cPickle in multiprocessing
versions: Python 3.0

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



[issue3325] use of cPickle in multiprocessing

2008-07-09 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

And here is the patch.

--
keywords: +patch
Added file: http://bugs.python.org/file10867/issue3325.diff

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-08 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

OK, then ignore the previous email, I'll send you a new one, with
updated questions.

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



[issue3315] abc.rst little error

2008-07-07 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

'make html' with latest py3k sources produces this warning:
WARNING: /home/mishok/doc/python/abc-doc-bug/Doc/library/abc.rst:11:
term not in glossary: abstract base classes
I've applied little patch that fixes this.

--
assignee: georg.brandl
components: Documentation
files: abc.rst.diff
keywords: patch
messages: 69390
nosy: georg.brandl, mishok13
severity: normal
status: open
title: abc.rst little error
versions: Python 3.0
Added file: http://bugs.python.org/file10844/abc.rst.diff

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-07 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

So, after 5 days of silence I present my current status on the patch.
This patch fixes Doc/includes/mp_*.py examples, except for the fact that
I couldn't make mp_distributing.py work, but I'm still working on this
issue.

--
keywords: +patch
Added file: http://bugs.python.org/file10847/examples.diff

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-07 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

And this patch is for Doc/library/multiprocessing.rst. Still, there are
lot of issues, and as you none of you (Jesse or Richard) answered my
email, I'll post them tomorrow here. Right now, the patch. :)

Added file: http://bugs.python.org/file10848/multiprocessing.rst.diff

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



[issue3283] multiprocessing.connection doesn't import AuthenticationError, while using it

2008-07-04 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

Lib/multiprocessing/connection.py contains two uses of
AuthenticationError, while it's not imported from multiprocessing
package. This exception is used in deliver_challenge() and
answer_challenge() functions. I've attached a small patch that fixes
possible NameError while calling any of these two functions.

--
components: Library (Lib)
files: multiprocessing.connection.py.diff
keywords: patch
messages: 69255
nosy: jnoller, mishok13, roudkerk
severity: normal
status: open
title: multiprocessing.connection doesn't import AuthenticationError, while 
using it
versions: Python 3.0
Added file: http://bugs.python.org/file10809/multiprocessing.connection.py.diff

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



[issue3273] multiprocessing and meaningful errors

2008-07-03 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

multiprocessing uses a lot of `assert` statements all over the code. I
propose to change this way to a more readable and understandable. For
example:
Lib/multiprocessing/managers.py, line 136:
assert isinstance(authkey, bytes)
From my point of view, raising an AssertionError is not enough in this
case. I propose changing this one to more intuitive:
if not isinstance(authkey, bytes):
   raise TypeError('authkey' argument should be an instance of 'bytes')
(Well, maybe message could be more descriptive. :) )

And this goes for all of the multiprocessing code base.
Should I consider writing a patch for this?

--
components: Library (Lib)
messages: 69208
nosy: jnoller, mishok13, roudkerk
severity: normal
status: open
title: multiprocessing and meaningful errors
type: feature request
versions: Python 2.6, Python 3.0

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



[issue3256] Multiprocessing docs are not 3.0-ready

2008-07-02 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

Multiprocessing docs contain examples, that are not valid py3k code,
mostly because of print used as a statement. Example (taken from
multiprocessing.rst):

from multiprocessing import Process

def f(name):
print 'hello', name

if __name__ == '__main__':
p = Process(target=f, args=('bob',))
p.start()
p.join()

If no one is working on this already, than I'll start fixing this and
will present a patch in 2 or 3 days.

--
assignee: georg.brandl
components: Documentation
messages: 69090
nosy: georg.brandl, jnoller, mishok13, roudkerk
severity: normal
status: open
title: Multiprocessing docs are not 3.0-ready
versions: Python 3.0

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



[issue3204] operator module docs are not updated to 3.0

2008-06-26 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

__*slice__() methods of sequence-like objects are removed in Python 3.0,
but operator.rst has sections on *slice()/__*slice__() functions.
Attached patch removes this functions from documentation.

--
assignee: georg.brandl
components: Documentation
files: operator.rst.diff
keywords: patch
messages: 68766
nosy: georg.brandl, mishok13
severity: normal
status: open
title: operator module docs are not updated to 3.0
versions: Python 3.0
Added file: http://bugs.python.org/file10739/operator.rst.diff

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



[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation

2008-06-26 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

multiprocessing.sharedctypes.Array and
multiprocessing.sharedctypes.Value if used according to documentation
fail with AssertionError.

Python 3.0b1+ (py3k:64518, Jun 25 2008, 12:52:38)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
 from multiprocessing import sharedctypes
 sharedctypes.Array('i', 1, lock=True)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python3.0/multiprocessing/sharedctypes.py, line
88, in Array
assert hasattr(lock, 'acquire')
AssertionError
 sharedctypes.Array('i', 1, lock=False)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python3.0/multiprocessing/sharedctypes.py, line
88, in Array
assert hasattr(lock, 'acquire')
AssertionError
 sharedctypes.Array('i', 1, lock=None)
SynchronizedArray wrapper for
multiprocessing.sharedctypes.c_long_Array_1 object at 0x83214f4
 Value('i', lock=True)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python3.0/multiprocessing/__init__.py, line 246,
in Value
return Value(typecode_or_type, *args, **kwds)
  File /usr/local/lib/python3.0/multiprocessing/sharedctypes.py, line
75, in Value
assert hasattr(lock, 'acquire')
AssertionError

The same goes for multiprocessing.Array and multiprocessing.Value.

Comparing code to documentation it's obvious that lock argument can be
one of Lock, RLock or None objects (or any object with acquire
attribute), but not True or False. Also, looking at the code it seems
strange to me that 'lock' is a keyword-only argument. Why not use simple
default argument lock=None for Array() function?
Proposed patch tries to address these issues.

--
components: Library (Lib)
messages: 68771
nosy: jnoller, mishok13, roudkerk
severity: normal
status: open
title: Multiprocessing Array and sharedctypes.Array error in docs/implementation
versions: Python 3.0

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



[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation

2008-06-26 Thread Andrii V. Mishkovskyi

Changes by Andrii V. Mishkovskyi [EMAIL PROTECTED]:


--
assignee:  - georg.brandl
components: +Documentation
nosy: +georg.brandl

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



[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation

2008-06-26 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

And here is the patch itself. :)

--
keywords: +patch
Added file: http://bugs.python.org/file10741/multiprocessing.diff

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



[issue3211] warnings.warn_explicit raises SystemError

2008-06-26 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

Even more, Python 3.0 crashes from following code:
Python 3.0b1+ (py3k:64528M, Jun 26 2008, 11:40:20)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
 from warnings import warn_explicit
 warn_explicit(None, UserWarning, None, 0, None, None)
Traceback (most recent call last):
  File stdin, line 1, in module
SystemError: Objects/dictobject.c:709: bad argument to internal function
 warn_explicit(None, UserWarning, None, 0, None, {})
Segmentation fault

--
nosy: +mishok13
type:  - crash
versions: +Python 3.0

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



[issue3195] invalid conversion xml.etree.ElementTree.Element object to boolean

2008-06-25 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

To quote Python Library Reference, paragraph 3.1:
Any object can be tested for truth value, for use in an if or while
condition or as operand of the Boolean operations below. The following
values are considered false: 
[skipped]
 - instances of user-defined classes, if the class defines a
__nonzero__() or __len__() method, when that method returns the integer
zero or bool value False.

And back to python console:
In [112]: from xml.etree.ElementTree import Element

In [113]: e = Element('foo', {'key': 'value'})

In [114]: len(e)
Out[114]: 0

In [115]: not e
Out[115]: True

This is because Element is just a container and acts more like a list.
So, if you actually append items to this list-like structure, you'll get
this:

In [116]: e.append(Element('bar', {42: 1337}))

In [117]: e.append(Element('baz', {'whatever': 'wherever'}))

In [118]: len(e)
Out[118]: 2

In [119]: not e
Out[119]: False

In conclusion, this just doesn't look like a bug to me. You could try
using if e is not None form.

--
nosy: +mishok13

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



[issue3178] __radd__(self, other) isn't called if self and other are of the same class

2008-06-23 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

This is covered in section 3.4.7 of Python Reference Manual:
__radd__(self, other)
[skipped]
These methods are called to implement the binary arithmetic
operations (+, -, *, /, %, divmod(), pow(), **, , , , ^, |) with
reflected (swapped) operands. These functions are only called if the
left operand does not support the corresponding operation and the
operands are of different types.[3.3] For instance, to evaluate the
expression x-y, where y is an instance of a class that has an __rsub__()
method, y.__rsub__(x) is called if x.__sub__(y) returns NotImplemented. 
[3.3] For operands of the same type, it is assumed that if the
non-reflected method (such as __add__()) fails the operation is not
supported, which is why the reflected method is not called.

--
nosy: +mishok13

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



[issue2890] O_ASYNC and FASYNC should be defined for *nix systems

2008-05-16 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

These flags are non-posix, linux-specific constants. Python 'os' module
uses 'posix' module for all *nix systems, including those, that do not
support O_ASYNC and FASYNC flags. I think your feature request should be
rejected.

--
nosy: +mishok13

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



[issue2890] O_ASYNC and FASYNC should be defined for *nix systems

2008-05-16 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

I think they at least should be supported on Linux then. 

And what happens if some Unix flavor (i.e. Solaris) adds new flag, say
O_NONLINUXSYNC and it has the same value as linux's O_ASYNC? And then
FreeBSD adds O_BSDSYNC flag with the same number and so on. Then Python
will have to have separate system-specific module for each *nix system
that uses Python. Why do you think Python maintainers would want that?

It does work if you use the value itself anyway.

It's the way fcntl works -- it's just a thin layer on top of fcntl() and
ioctl() calls. But that's not a good reason for including non-posix
flags to 'posix' module

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



[issue2782] datetime/date strftime() method and time.strftime() inconsistency

2008-05-07 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

datetime and date strftime() method does additional check on input
format, thus being completely different from time's module
time.strftime() method behavior.
There are two ways to fix this:
1. Add an explicit note about this behavior (e.g., only 'str' objects
are allowed for format strings) in docs (section 5.1.7).
2. Allow 'unicode' objects for format strings (backport time.strftime()
from 3.0?).

Here is a traceback for a more complete overview:

Python 2.6a2+ (trunk:62762, May  6 2008, 14:37:27)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
 from datetime import datetime, date
 import time
 uformat = u'%Y-%m-%D %H-%M-%S'
 format = '%Y-%m-%D %H-%M-%S'
 datetime.today().strftime(uformat)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: strftime() argument 1 must be str, not unicode
 datetime.today().strftime(format)
'2008-05-05/07/08 17-19-03'
 time.strftime(uformat)
'2008-05-05/07/08 17-19-10'
 time.strftime(format)
'2008-05-05/07/08 17-19-16'
 date.today()
datetime.date(2008, 5, 7)
 date.today().strftime(format)
'2008-05-05/07/08 00-00-00'
 date.today().strftime(uformat)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: strftime() argument 1 must be str, not unicode

--
components: Library (Lib)
messages: 66360
nosy: mishok13
severity: normal
status: open
title: datetime/date strftime() method and time.strftime() inconsistency
type: behavior
versions: Python 2.5, Python 2.6

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



[issue2522] locale.format() problems with decimal separator

2008-04-01 Thread Andrii V. Mishkovskyi

Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment:

I've uploaded a patch that fixes this concrete issue, though
locale.format() continues to silently ignore other types of malformed
strings (e.g. locale.format('%fSPAMf')).
I don't think this is correct behavior. Maybe there should be reg-exp
that locale.format() will use to avoid such issues.

--
components: +Library (Lib)
keywords: +patch
Added file: http://bugs.python.org/file9918/locale.diff

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



[issue2522] locale.format() problems with decimal separator

2008-03-31 Thread Andrii V. Mishkovskyi

New submission from Andrii V. Mishkovskyi [EMAIL PROTECTED]:

locale.format() doesn't insert correct decimal separator to string
representation when 'format' argument has '\r' or '\n' symbols in it.
This bug has been reproduced on Python 2.5.2 and svn-trunk.

Python 2.4.5 (#2, Mar 12 2008, 14:42:24)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2
Type help, copyright, credits or license for more information.
 import locale
 locale.setlocale(locale.LC_ALL, ru_RU.UTF-8)
'ru_RU.UTF-8'
 a = 1.234
 print locale.format(%f, a)
1,234000
 print locale.format(%f\n, a)
1,234000

 print locale.format(%f\r, a)
1,234000


Python 2.6a1+ (trunk:62083, Mar 31 2008, 19:24:56)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu6)] on linux2
Type help, copyright, credits or license for more information.
 import locale
 locale.setlocale(locale.LC_ALL, ru_RU.UTF-8)
'ru_RU.UTF-8'
 a = 1.234
 print locale.format(%f, a)
1,234000
 print locale.format(%f\n, a)
1.234000

 print locale.format(%f\r, a)
1.234000
Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2
Type help, copyright, credits or license for more information.
 import locale
 locale.setlocale(locale.LC_ALL, ru_RU.UTF-8)
'ru_RU.UTF-8'
 a = 1.234
 print locale.format(%f, a)
1,234000
 print locale.format(%f\n, a)
1.234000

 print locale.format(%f\r, a)
1.234000

--
messages: 64787
nosy: mishok13
severity: normal
status: open
title: locale.format() problems with decimal separator
type: behavior
versions: Python 2.5, Python 2.6

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