[issue6759] zipfile.ZipExtFile.read() is missing universal newline support

2009-08-21 Thread Ryan Leslie

New submission from Ryan Leslie :

The zipfile.ZipFile.open() behavior with mode 'U' or 'rU' is not quite
as advertised in

http://docs.python.org/library/zipfile.html#zipfile.ZipFile.open

Here is an example:

$ echo -ne "This is an example\r\nWhich demonstrates a problem\r\nwith
ZipFile.open(..., 'U')\r\n" > foo.txt
$ cat -v foo.txt
This is an example^M
Which demonstrates a problem^M
with ZipFile.open(..., 'U')^M
$ zip foo.zip foo.txt
  adding: foo.txt (deflated 1%)
$ python
Python 2.6.2 (r262:71600, Aug 21 2009, 17:52:12)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> open("foo.txt", 'U').read()
"This is an example\nWhich demonstrates a problem\nwith
ZipFile.open(..., 'U')\n"
>>> from zipfile import ZipFile
>>> ZipFile("foo.zip").open("foo.txt", 'U').read()
"This is an example\r\nWhich demonstrates a problem\r\nwith
ZipFile.open(..., 'U')\r\n"
>>>

The open() method was added here:

http://bugs.python.org/issue1121142

The cause is that the universal newline implementation is specific to
readline(), which also implements readlines() and next() as well.
Support was never added for read(), which is independent.

Note that test_zipfile.UniversalNewlineTests.readTest() passes. This is
suspect because it's explicitly coded to *not* expect translation of new
line sequences.

--
components: Library (Lib)
messages: 91854
nosy: ryles
severity: normal
status: open
title: zipfile.ZipExtFile.read() is missing universal newline support
versions: Python 2.6

___
Python tracker 

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



[issue1170] shlex have problems with parsing unicode

2009-08-21 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

The patch needs tests before it can be applied. Additionally, I'm not
sure if having a "utf" option is helpful. Is there a reason not to have
unicode support by default?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue6508] expose setresuid

2009-08-21 Thread Travis H.

Travis H.  added the comment:

Where would be the best place to put these non-POSIX calls?

I looked at posixmodule.c and it's a mess; much conditional CPP logic
governing what gets compiled, not clear where I should add something
like this there - if I should at all, since these routines are not POSIX
routines.

Perhaps there should be a module called Unix or something?

Also, knowing whether the functions were avaiable at compile time would
be tricky; some Unix OSes have them and others don't.  It sounds like a
job for autoconf to define HAVE_SETRESUID and other CPP definitions like
that so we can compile cleanly and portably...

Thoughts?

--

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.

Travis H.  added the comment:

On Fri, Aug 21, 2009 at 08:42:43PM +, Martin v. L??wis wrote:
> 
> Martin v. L??wis  added the comment:
> 
> > It would still be nice to have the currently unimplemented platform
> > wrappers added to the standard library, though.  For example, as solinym
> > pointed out, getresuid and getresgid are not currently wrapped at all. 
> > There may be other low-level APIs which may be missing as well.
> 
> Ah, ok. A patch for to add these specifically would be easy to add;
> contributions are welcome.

I kind of have two bugs going for the same thing; one is 6758 the other is 6508.

I've posted code that implements the calls using ctypes to
{get,set}res{uid,gid} in issue6758.  It's not quite done.

With regard to putting these calls into the standard library, I'm not
sure where they should go.  If I put them in os, which maps to
posixmodule.c, then I'll be adding non-POSIX calls to something
seemingly only for POSIX calls.

Also the code in there has a lot of conditional CPP logic and
interactions with the configure script.  So that could be a difficult
task to just jump into, since it has been a while since I dealt with
autoconf.

I really would like these routines exposed, but I don't know the best
way to do it and coudl use some guidance.
-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | 
http://www.subspacefield.org/~travis/ 
If you are a spammer, please email j...@subspacefield.org to get blacklisted.

--
title: implement new setuid-related calls and a standard way to drop all 
privileges -> implement new setuid-related calls and a standard way to drop all 
privileges

___
Python tracker 

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



[issue6518] Enable 'with' statement in ossaudiodev module

2009-08-21 Thread Art Gillespie

Art Gillespie  added the comment:

Diff attached

* Added the __enter__ and __exit__ methods to the ossaudio object.
* Updated tests so they pass (attempt to access ossaudio.closed throws
AttributeError instead of TypeError)

My first patch.  Please let me know if I did anything terrifically
stupid. :-)

--
keywords: +patch
nosy: +agillesp
Added file: http://bugs.python.org/file14767/issue6518.diff

___
Python tracker 

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



[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Changing the signature of a well-used function is dangerous.
Why not add a function named pprint.print, with the exact same signature 
as __builtin__.print?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue1170] shlex have problems with parsing unicode

2009-08-21 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.

Travis H.  added the comment:

This is my first stab at creating a "privilege" module that implements
the API suggested in the second aforementioned paper.

It is syntactically correct but has some TODO items in it that must be
completed before it will work.

Any suggestions on this code would be greatly appreciated.

--
Added file: http://bugs.python.org/file14766/privilege.py

___
Python tracker 

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



[issue4010] configure options don't trickle down to distutils

2009-08-21 Thread John P. Speno

John P. Speno  added the comment:

Furthermore, there's another bug in setup.py  When extensions are built 
and CPPFLAGS (or other arguments) has multiple arguments, the order of 
the arguments are reversed. This is the wrong behavior. The specified 
directories should be used in the given order.

For example, if CPPFLAGS="-I/one -I/two -I/three", then when an 
extention is build, the order of the compile would be:

cc -I/three -I/two -I/one ...

There's this bit that seems reponsible in setup.py:

for directory in reversed(options.dirs):
add_dir_to_list(dir_list, directory)

--

___
Python tracker 

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



[issue6748] test test_telnetlib failed

2009-08-21 Thread Rüdiger Blach

Changes by Rüdiger Blach :


--
nosy: +rb09

___
Python tracker 

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Hm, I tried a modified version of your first test, and I found another 
problem with the current zlib library;
starting with the input:
x = x1 + x2 + HAMLET_SCENE# both compressed and uncompressed data

The following scenario is OK:
dco.decompress(x) # returns HAMLET_SCENE
dco.unused_data   # returns HAMLET_SCENE

But this one:
for c in x:
dco.decompress(x) # will return HAMLET_SCENE, in several pieces
dco.unused_data   # only one character, the last of (c in x)!

This is a bug IMO: unused_data should accumulate all the extra uncompressed 
data.

--

___
Python tracker 

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



[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-08-21 Thread Demur Rumed

Demur Rumed  added the comment:

I've included a patched version. I went with using a function signature
of def pprint(*object, stream=None, indent=1, width=80, depth=None)

--
nosy: +serprex
Added file: http://bugs.python.org/file14765/pprint.py

___
Python tracker 

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



[issue6508] expose setresuid

2009-08-21 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--

___
Python tracker 

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



[issue6508] expose setresuid

2009-08-21 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Would you like to work on a patch?

--
nosy: +loewis

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> It would still be nice to have the currently unimplemented platform
> wrappers added to the standard library, though.  For example, as solinym
> pointed out, getresuid and getresgid are not currently wrapped at all. 
> There may be other low-level APIs which may be missing as well.

Ah, ok. A patch for to add these specifically would be easy to add;
contributions are welcome.

--
title: implement new setuid-related calls and a standard way to drop all 
privileges -> implement new setuid-related calls and a standard way to drop all 
privileges

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

It would still be nice to have the currently unimplemented platform
wrappers added to the standard library, though.  For example, as solinym
pointed out, getresuid and getresgid are not currently wrapped at all. 
There may be other low-level APIs which may be missing as well.

--

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

If the logic is going to be built on top of the APIs that are already
there, I agree that it would be best to implement this as a separate
module, and upload it to pypi.python.org.

Closing as "won't fix".

--
nosy: +loewis
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-08-21 Thread Travis H.

Travis H.  added the comment:

Figured out how to test is_finished attribute of the zlib module properly.

--
Added file: http://bugs.python.org/file14764/test_zlib.py.diff

___
Python tracker 

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



[issue4010] configure options don't trickle down to distutils

2009-08-21 Thread John P. Speno

John P. Speno  added the comment:

Hi. We encountered this issue on a Solaris 10 while building python 2.6.2.

There's a problem with reptrov's patch from 2009-01-04. The LDFLAGS in the 
Makefile.pre.in patch need to be quoted also. Like so:

LDFLAGS='$(LDFLAGS)'

This allows for multiple flags. Other than that, it works for us.

--
nosy: +speno

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Maybe this should just be a third-party module for the time being?  That
removes the question of which stdlib module to add it to for now.  Plus,
since it's not just a straightforward platform API wrapper, it probably
merits separate distribution to see what adoption is like and what the
Python community response is.

--
nosy: +exarkun

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.

Travis H.  added the comment:

The routines necessary for implementing Wagner's API for dropping
privileges are:

sysconf function: available in os module
_SC_NGROUPS_MAX constant: unsure
abort function: available in os module
getresuid function: needs implementing[1]
getresgid function: needs implementing[1]

[1] Not POSIX but available on Linux, HP/UX, FreeBSD, OpenBSD,
DragonFlyBSD.  Not available on Solaris, AIX, NetBSD, OSX, cygwin.

Since Wagner points out that the non-standard function calls actually
have clearer/better semantics, perhaps the way to do all this is in its
own module, instead of trying to shove it into an existing module..

--

___
Python tracker 

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



[issue2516] Instance methods are misreporting the number of arguments

2009-08-21 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.

Travis H.  added the comment:

The posixmodule.c seems to have a lot of really complex CPP logic about
what chunks to compile.  If the target is to put the code there, I would
have to be guessing - next to the HAVE_GETEUID looks promising.

But wouldn't it be better to have the configure script check for the
presence of e.g. getresuid and compile it iff it finds it?  So that
sounds like some work with the autoconf script...

--

___
Python tracker 

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



[issue6758] implement new setuid-related calls and a standard way to drop all privileges

2009-08-21 Thread Travis H.

New submission from Travis H. :

It should be easier to write network servers and setuid programs in
python.  One of the troublesome issues is that the semantics of the
setuid/getuid-related calls are quite complicated.

There are two papers on this subject that form the background of this
feature request:
http://www.cs.berkeley.edu/~daw/papers/setuid-usenix02.pdf
http://www.cs.berkeley.edu/~daw/papers/setuid-login08b.pdf

In general, then, the end goal is a safe (portable, secure) way to drop
privileges either temporarily or permanently.

Wagner et. al. have proposed a decent interface, but it's unclear to me
where it should be implemented.

Furthermore, it makes use of the getresuid/setresuid calls (among many
others), which don't appear from their manpages to be standardized by
POSIX, but are available in most modern Unix OSes.  So this leaves me
with two questions; have these functions been standardized, and if not,
where should they be implemented?

I'm willing to do the coding, but need some guidance on where to put the
code.

--
messages: 91835
nosy: solinym
severity: normal
status: open
title: implement new setuid-related calls and a standard way to drop all 
privileges
type: feature request
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue6090] zipfile DeprecationWarning Python 2.6.2

2009-08-21 Thread Cédric Krier

Changes by Cédric Krier :


--
nosy: +ced

___
Python tracker 

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



[issue6757] Marshal's documentation incomplete (Bools)

2009-08-21 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

A number of other things are also missing.

types:complex,frozenset
singletons:StopIteration, Ellipsis

--
nosy: +loewis

___
Python tracker 

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-08-21 Thread Travis H.

Travis H.  added the comment:

Diff to tests

Implements all suggested changes save one:

I wasn't sure how to test that is_finished is clear one byte before the
end of the compressed section.  Instead, I test that it is clear before
I call the compression routine.

--
Added file: http://bugs.python.org/file14763/test_zlib.py.diff

___
Python tracker 

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-08-21 Thread Travis H.

Travis H.  added the comment:

zlibmodule.c.diff Implements all the suggested features, but I'm not
exactly sure whether it handles reference counts properly.

--
Added file: http://bugs.python.org/file14762/zlibmodule.c.diff

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_CONST

2009-08-21 Thread Demur Rumed

Changes by Demur Rumed :


--
title: LOAD_CONST followed by LOAD_ATTR can be optimized to justbe a 
LOAD_COST -> LOAD_CONST followed by LOAD_ATTR can be optimized to just be a 
LOAD_CONST

___
Python tracker 

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



[issue6757] Marshal's documentation incomplete (Bools)

2009-08-21 Thread Demur Rumed

Changes by Demur Rumed :


--
title: Marshal's documentation incomplete -> Marshal's documentation incomplete 
(Bools)

___
Python tracker 

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



[issue6757] Marshal's documentation incomplete

2009-08-21 Thread Demur Rumed

New submission from Demur Rumed :

"The following types are supported: None, integers, floating point
numbers, strings, bytes, bytearrays, tuples, lists, sets, dictionaries,
and code objects"

It fails to list bools: True and False

While it states "Not all Python object types are supported; in general,
only objects whose value is independent from a particular invocation of
Python can be written and read by this module." beforehand, it seems
proper to include bools in the list of accepted types

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 91831
nosy: georg.brandl, serprex
severity: normal
status: open
title: Marshal's documentation incomplete
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue6739] IDLE window won't start or show up after assgining new key in options v2.5.2 and 3.1.1

2009-08-21 Thread Guilherme Polo

Guilherme Polo  added the comment:

Here is a patch that changes IDLE to refuse invalid key bindings.

--
keywords: +patch
nosy: +gpolo
versions: +Python 2.6, Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14761/tcl_validation.diff

___
Python tracker 

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



[issue6556] "HOME" is not a standard environment variable on Windows

2009-08-21 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Fixed, thanks for the feedback all !

--
status: open -> closed

___
Python tracker 

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



[issue6753] Python 3.1.1 test_cmd_line fails on Fedora 11

2009-08-21 Thread Guillaume Delcourt-Petetin

Guillaume Delcourt-Petetin  added the comment:

Nope.

2009/8/21 Amaury Forgeot d'Arc 

>
> Amaury Forgeot d'Arc  added the comment:
>
> Does it happen if you build python from a directory with no accented
> letters?
>
> --
> nosy: +amaury.forgeotdarc
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: http://bugs.python.org/file14760/unnamed

___
Python tracker 

___Nope.2009/8/21 Amaury Forgeot d'Arc rep...@bugs.python.org>

Amaury Forgeot d'Arc amaur...@gmail.com> added the 
comment:

Does it happen if you build python from a directory with no accented
letters?

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org>
http://bugs.python.org/issue6753>
___

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



[issue6753] Python 3.1.1 test_cmd_line fails on Fedora 11

2009-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Does it happen if you build python from a directory with no accented
letters?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue2516] Instance methods are misreporting the number of arguments

2009-08-21 Thread gungor

gungor  added the comment:

I don't understand your message.You only send me my error message's xml
version

2009/8/21 Benjamin Peterson 

>
> Changes by Benjamin Peterson :
>
>
> Removed file: http://bugs.python.org/file14758/unnamed
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: http://bugs.python.org/file14759/unnamed

___
Python tracker 

___I don't understand your message.You only send me my error message's xml 
version2009/8/21 Benjamin Peterson rep...@bugs.python.org>

Changes by Benjamin Peterson benja...@python.org>:


Removed file: http://bugs.python.org/file14758/unnamed"; 
target="_blank">http://bugs.python.org/file14758/unnamed

___
Python tracker rep...@bugs.python.org>
http://bugs.python.org/issue2516>
___
-- http://www.ral.forumup.com";>www.ral.forumup.com
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2516] Instance methods are misreporting the number of arguments

2009-08-21 Thread Benjamin Peterson

Changes by Benjamin Peterson :


Removed file: http://bugs.python.org/file14758/unnamed

___
Python tracker 

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



[issue2516] Instance methods are misreporting the number of arguments

2009-08-21 Thread gungor

gungor  added the comment:

TypeError at /admin/rt/randevu/add/

cagir() takes exactly 1 argument (2 given)

 Request Method: GET  Request URL:
http://127.0.0.1:8000/admin/rt/randevu/add/  Exception Type: TypeError
 Exception
Value:

cagir() takes exactly 1 argument (2 given)

 Exception Location: /home/gungor/rts/../rts/rt/models.py in __init__, line
27  Python Executable: /usr/bin/python  Python Version: 2.6.2  Python
Path: ['/home/gungor/rts',
'/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/var/lib/python-support/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/var/lib/python-support/python2.6/gtk-2.0',
'/usr/local/lib/python2.6/dist-packages']  Server time: Fri, 21 Aug 2009
07:24:43 -0500
2009/8/21 Benjamin Peterson 

>
> Changes by Benjamin Peterson :
>
>
> --
> type: compile error -> feature request
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: http://bugs.python.org/file14758/unnamed

___
Python tracker 

___TypeError at /admin/rt/randevu/add/
  cagir() takes exactly 1 argument (2 given)
  

  Request Method:
  GET


  Request URL:
  http://127.0.0.1:8000/admin/rt/randevu/add/";>http://127.0.0.1:8000/admin/rt/randevu/add/


  Exception Type:
  TypeError


  Exception Value:
  cagir() takes exactly 1 argument (2 given)


  Exception Location:
  /home/gungor/rts/../rts/rt/models.py in __init__, line 27


  Python Executable:
  /usr/bin/python


  Python Version:
  2.6.2


  Python Path:
  ['/home/gungor/rts',
'/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload', 
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/var/lib/python-support/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/var/lib/python-support/python2.6/gtk-2.0',
'/usr/local/lib/python2.6/dist-packages']


  Server time:
  Fri, 21 Aug 2009 07:24:43 -05002009/8/21 Benjamin Peterson rep...@bugs.python.org>

Changes by Benjamin Peterson benja...@python.org>:


--
type: compile error -> feature request

___
Python tracker rep...@bugs.python.org>
http://bugs.python.org/issue2516>
___

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



[issue2516] Instance methods are misreporting the number of arguments

2009-08-21 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
type: compile error -> feature request

___
Python tracker 

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



[issue2516] Instance methods are misreporting the number of arguments

2009-08-21 Thread gungor

gungor  added the comment:

I am using Django with python to develope a web application.While I am
trying to syncronize and running the localserver, I get this issue(2516).
problem function is cagri()
Source Code:
from django.db import models
from datetime import datetime
from sets import ImmutableSet

class Randevu(models.Model):
def __init__(self):

saatler=(
('8',(8)),
('9',(9)),
('10',(10)),
('11',(11)),
('13',(13)),
('14',(14)),
('15',(15)),
('16',(16)),
)


ad=models.CharField(max_length=30)
soyad=models.CharField(max_length=30)
tarih=models.DateField()
saat=models.TimeField(choices=saatler)
konu=models.TextField()
email=models.EmailField()
t=cagri()
t.cagir(saat)
#r=Randevu()
class duzen():
def duz(saat):
r=Randevu()
fil=r.objects.filter(tarih__gte=datetime(2009,8,21))
for saat in fil:
if saat==fil.saat:
error() 
class cagri():
def cagir(saat):
d=duzen()
d.duz(saat)

--
components:  -Interpreter Core
nosy: +gungorbasa
type: behavior -> compile error
versions: +Python 2.6

___
Python tracker 

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



[issue6750] threading issue in __builtins__.print

2009-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The TextIOWrapper class is not thread-safe, because it calls [the
equivalent of] self.buffer.write(self.pending_bytes) before clearing
self.pending_bytes.
Of course the write() function will release the GIL, and another thread
may send the same pending_bytes again.

Patch is attached. Antoine, can you review it?

(_pyio.TextIOWrapper does no buffering.)

--
assignee:  -> pitrou
keywords: +needs review, patch
nosy: +amaury.forgeotdarc, pitrou
Added file: http://bugs.python.org/file14757/textiowrapper_write.patch

___
Python tracker 

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



[issue6756] ftplib documentation does not document what the acct parameter is used for

2009-08-21 Thread Tarjei Huse

New submission from Tarjei Huse :

Check: 
http://docs.python.org/library/ftplib.html

The ftplib package does not document what the acct parameter is and how
it should be used.

Also: few methods document their return values of exceptions they raise.

--

___
Python tracker 

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



[issue6756] ftplib documentation does not document what the acct parameter is used for

2009-08-21 Thread Tarjei Huse

Changes by Tarjei Huse :


--
assignee: georg.brandl
components: Documentation
nosy: georg.brandl, tarjei
severity: normal
status: open
title: ftplib documentation does not document what the acct parameter is used 
for
type: feature request
versions: Python 2.6

___
Python tracker 

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



[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2009-08-21 Thread Iñigo Serna

Iñigo Serna  added the comment:

Added patch against Python v3.1.1. 
NOT TESTED!

--
versions: +Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14756/_cursesmodule.311.get_wch.patch

___
Python tracker 

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



[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-08-21 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

In that case, what needs to be done to integrate it into 3.2?

--
title: Add os.link() and os.symlink() and   os.path.islink() support for 
Windows -> Add os.link() and os.symlink() and os.path.islink() support for 
Windows

___
Python tracker 

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



[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2009-08-21 Thread Iñigo Serna

Iñigo Serna  added the comment:

Added missing file: patch against Python v2.6.2

--
Added file: http://bugs.python.org/file14755/_cursesmodule.get_wch.patch

___
Python tracker 

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



[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2009-08-21 Thread Iñigo Serna

Iñigo Serna  added the comment:

Added test example

--
Added file: http://bugs.python.org/file14754/test_get_wch.py

___
Python tracker 

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



[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2009-08-21 Thread Iñigo Serna

Iñigo Serna  added the comment:

Added patch for the documentation

--
keywords: +patch
Added file: http://bugs.python.org/file14753/curses.get_wch.patch

___
Python tracker 

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



[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2009-08-21 Thread Iñigo Serna

New submission from Iñigo Serna :

Currently,there is no a simple way in curses bindings to get the code
associated with a key press of non ascii keystroke (f.e. ç) in terminals
configured with UTF-8 encoding. 

getch returns the code for a wide character byte a byte.
But ncurses library has a proper function to do it: get_wch.

Patch against Python v2.6.2 to provide this missing get_wch method
in the ncurses bindings.

Include a test example and a patch to the documentation as well.

More info and a partial solution without patching python curses module
on this thread:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/67dce30f0a2742a6?fwc=2

--
components: Extension Modules
messages: 91816
nosy: inigoserna
severity: normal
status: open
title: Patch: new method get_wch for ncurses bindings: accept wide characters 
(unicode)
type: feature request
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue6734] Imap lib implicit conversion from bytes to string

2009-08-21 Thread Marcin Bachry

Marcin Bachry  added the comment:

Ok, it think it's good to leave internal _quote() function operating on
bytes and convert password argument in login(). The method now works
with both str and bytes as arguments.

--
keywords: +patch
Added file: http://bugs.python.org/file14752/imaplib-login.diff

___
Python tracker 

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



[issue6754] Non-existent member 'nb_inplace_divide' in PyNumberMethods

2009-08-21 Thread KAJIYAMA, Tamito

New submission from KAJIYAMA, Tamito :

In the "Python/C API Reference Manual", Section "Object Implementation 
Support", Subsection "Number Object Structures" 
(http://docs.python.org/3.1/c-api/typeobj.html#number-object-
structures), the definition of the PyNumberMethods structure has a non-
existent member 'nb_inplace_divide'.  This should be simply omitted.

--
assignee: georg.brandl
components: Documentation
messages: 91814
nosy: georg.brandl, kajiyama
severity: normal
status: open
title: Non-existent member 'nb_inplace_divide' in PyNumberMethods
versions: Python 3.1

___
Python tracker 

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



[issue6753] Python 3.1.1 test_cmd_line fails on Fedora 11

2009-08-21 Thread Guillaume Delcourt-Petetin

New submission from Guillaume Delcourt-Petetin :

Just what it says on the label :

[...]
Traceback (most recent call last):
  File "./Lib/test/regrtest.py", line 618, in runtest_inner
indirect_test()
  File
"/home/Pif/Téléchargement/Python-3.1.1/Python-3.1.1/Lib/test/test_cmd_l
test.support.run_unittest(CmdLineTest)
  File
"/home/Pif/Téléchargement/Python-3.1.1/Python-3.1.1/Lib/test/support.py
_run_suite(suite)
  File
"/home/Pif/Téléchargement/Python-3.1.1/Python-3.1.1/Lib/test/support.py
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File
"/home/Pif/Téléchargement/Python-3.1.1/Python-3.1.1/Lib/test/test_cmd_l
self.assertTrue(path1.encode('ascii') in stdout)
AssertionError: False is not True


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./Lib/test/regrtest.py", line 1222, in 
main()
  File "./Lib/test/regrtest.py", line 425, in main
testdir, huntrleaks)
  File "./Lib/test/regrtest.py", line 584, in runtest
testdir, huntrleaks)
  File "./Lib/test/regrtest.py", line 638, in runtest_inner
print("test", test, "failed --", msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in
position 54: ordinal not in range(128)
test test_cmd_line failed -- make: *** [test] Erreur 1

[...]


In my search for similar bugs, I only found a mac OSX/Python 3.0 issue
(http://bugs.python.org/issue4388)

--
components: Tests
messages: 91813
nosy: Pif
severity: normal
status: open
title: Python 3.1.1 test_cmd_line fails on Fedora 11
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue6739] IDLE window won't start or show up after assgining new key in options v2.5.2 and 3.1.1

2009-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

- find your .idlerc directory (probably in %USERPROFILE%)
- edit config-extensions.cfg
- remove the  binding

- write a patch that refuses invalid keysims.

--
nosy: +amaury.forgeotdarc
stage:  -> needs patch

___
Python tracker 

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



[issue6752] -1**2=-1

2009-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This very example is in the documentation:
http://docs.python.org/reference/expressions.html#the-power-operator

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue6752] -1**2=-1

2009-08-21 Thread rahul

rahul  added the comment:

>>>-1**2
>>>-1 

???

what is reason for this

--

___
Python tracker 

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



[issue6752] -1**2=-1

2009-08-21 Thread rahul

New submission from rahul :

what is the reason for this 

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 91809
nosy: rahul1618
severity: normal
status: open
title: -1**2=-1
type: compile error
versions: Python 2.5

___
Python tracker 

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



[issue6751] Default return value in ConfigParser

2009-08-21 Thread Juan Javier

New submission from Juan Javier :

I think it is useful, at least for me, to add an argument, default, to
[Safe,Raw]ConfigParser.get that, if present, will be returned if the
methid fails to return the value.

That is, instead of rasing an exception, return default, if present.

It could be done overriding the get method in SafeConfigParser,
something like this:

class SafeConfigParser(ConfigParser):
def get(self, section, option, raw=False, vars=None, **kwds):
try:
return super().get(section, option, raw, vars)
except Exception as exc:
if "default" in kwds:
return kwds["default"]
raise exc

--
components: Library (Lib)
messages: 91808
nosy: jjdominguezm
severity: normal
status: open
title: Default return value in ConfigParser
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue6750] threading issue in __builtins__.print

2009-08-21 Thread Jackson Yang

New submission from Jackson Yang :

# Bug Description
In a multi-threaded environment, the Win32 Python3000 built-in function
"print" may give the output several times.

# How to Reproduce:
import threading
event = threading.Event()
class Test(threading.Thread):
def __init__(self, ord):
super().__init__()
self.ord = ord
def run(self):
event.wait()
print('Hello, world!', self.ord)
threads = tuple(map(Test, range(8)))
tuple(map(lambda thread: thread.start(), threads))
event.set()
tuple(map(lambda thread: thread.join(), threads))
# EOF

# Problem Observed
[The first run, 0 is doubled]
Hello, world! 0
Hello, world! 0
Hello, world! 1
Hello, world! 2
Hello, world! 3
Hello, world! 4
Hello, world! 5
Hello, world! 6
Hello, world! 7

[the second run, 1 and 7 are doubled]
Hello, world! 1
Hello, world! 1
Hello, world! 2
Hello, world! 3
Hello, world! 4
Hello, world! 5
Hello, world! 6
Hello, world! 7
Hello, world! 7
Hello, world! 0

# Expected Result
Each thread gives ONE AND ONLY ONE output.
OR
State this as The Expected Behavior, document it and ask the user to
write something such as critical section.

--
components: IO
messages: 91807
nosy: nullnil
severity: normal
status: open
title: threading issue in __builtins__.print
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue6667] logging config - using of FileHandler's delay argument?

2009-08-21 Thread Vinay Sajip

Changes by Vinay Sajip :


--
status: pending -> closed

___
Python tracker 

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



[issue6444] multiline exception logging via syslog handler

2009-08-21 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Do you suggest to file bug report to syslog-ng maintainer?

Yes, I do. Otherwise you can't use it as a drop-in replacement, which
people would expect to be possible.

--
status: open -> closed

___
Python tracker 

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



[issue6239] c_char_p return value returns string, not bytes

2009-08-21 Thread kai zhu

kai zhu  added the comment:

i just found this bug independently, but yes its a bug, which i hope 
gets fixed for sake of extension community:

// test.c beg
char s[4] = "ab\xff";
char *foo() { return s; }
// test.c end

$ gcc -fPIC -g -c -Wall test.c
$ gcc -shared test.o -o test.so
$ python3.1 -c "import ctypes; lib = 
ctypes.cdll.LoadLibrary('./test.so'); lib.foo.restype = ctypes.c_char_p; 
lib.foo()"
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 2: 
unexpected code byte

--
nosy: +kaizhu

___
Python tracker 

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