New submission from Justin Foo:
The default access for winreg.DeleteKeyEx is winreg.KEY_WOW64_64KEY (as per the
function signature). This the documentation for Python 2.7 has this correct.
Reference: http://hg.python.org/cpython/file/2e32462e4832/PC/winreg.c#l1089
--
assignee:
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +brian.curtin, tim.golden
stage: - patch review
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20301
___
Ezio Melotti added the comment:
I think that what the note was trying to say is that urlopen in Python 3 is
equivalent to urllib2.urlopen in Python 2, so before switching to Python 3,
people might want to move from urllib.urlopen to urllib2.urlopen.
Does the attached patch sound better?
Changes by Stefan Behnel sco...@users.sourceforge.net:
--
nosy: +eli.bendersky, scoder
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9521
___
___
Stefan Behnel added the comment:
When you write XML PI, do you mean the XML declaration? At least that's what
Mark used in his original example.
ET avoids writing them out when they are not necessary, i.e. for UTF-8
compatible encodings. IMHO that's perfectly ok and definitely not an
Larry Hastings added the comment:
Here is the hopefully-final patch for this issue. I incorporated the suggested
changes from Zachary Ware. Also I fixed some cls parameters that were
leaking into the signatures. I think this is ready for checkin!
--
Added file:
Larry Hastings added the comment:
Closing. Reopen it if you get a reproducible test case with a fresh checkout
of trunk.
--
resolution: - works for me
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Martin Vignali added the comment:
New patch with formatting correction and documentation update.
I'm not sure about the place of the versionadded directive in the documentation.
--
Added file: http://bugs.python.org/file33547/img_hdr_exr_2.patch
___
Roundup Robot added the comment:
New changeset cc53c49d38c8 by Larry Hastings in branch 'default':
Issue #20300: Fix exception when setting conversion class member default
http://hg.python.org/cpython/rev/cc53c49d38c8
--
nosy: +python-dev
___
Python
Larry Hastings added the comment:
Thanks for the report. It was an easy fix.
That said, I can't say I'm excited by the idea of a custom converter with a
built-in default value. I hope you know what you're doing!
--
assignee: - larry
components: +Demos and Tools -Build
resolution:
Terry J. Reedy added the comment:
The relevant code in CallTips.py is
argspec =
if hasattr(ob, '__call__'):
...
if isinstance(fob, (types.FunctionType, types.MethodType)):
argspec = inspect.formatargspec(*inspect.getfullargspec(fob))
So I want to broaden the second condition (or
Larry Hastings added the comment:
I just want to mention, while we're all thinking about this stuff: I plan to
enhance the Signature object to reflect optional groups. Right now Signature
objects cannot express parameters that are optional but don't have a published
default. (e.g. a string
SilentGhost added the comment:
Martin, it would be better if you do the check the way it's done in test_rast:
h.startswith(b'\x76\x2f\x31\x01')
Otherwise, you need to check that that h has at least 4 elements (if it doesn't
you'll get an IndexError).
--
nosy: +SilentGhost
Roundup Robot added the comment:
New changeset d0e2437136f5 by Larry Hastings in branch 'default':
Improve fix for issue #20300.
http://hg.python.org/cpython/rev/d0e2437136f5
--
___
Python tracker rep...@bugs.python.org
Francis Moreau added the comment:
Sorry for reopening this bug, but I agree with the OP, and I can still see the
exact same behaviour on python 2.7.6 (archlinux).
At least, the documentation should clarify that doing for line in file is not
strictly equivalent to the readline way regarding to
Nick Coghlan added the comment:
Sounds reasonable - we'll need that to convert range() and slice()
anyway (I totally failed at finding time to look at the builtins this
weekend, but I'd still like to handle those before the 3rd beta).
An alternative would be to actually add ParameterGroup as a
New submission from Serhiy Storchaka:
Currently flags for optional groups are named as group_left_N and
group_right_N. It will be better if they have names use_param,
use_param1_param2, etc. E.g. following declaration:
/*[clinic input]
curses.window.addstr
self:
Serhiy Storchaka added the comment:
I just built from a new clone of trunk (last revision is d0e2437136f5), and I
still get the error.
--
resolution: works for me -
stage: committed/rejected -
status: closed - open
___
Python tracker
New submission from Serhiy Storchaka:
This is very very low priority issue. Currently Argument Clinic can't process
following declaration:
/*[clinic input]
curses.window.chgat
self: self(type=PyCursesWindowObject *)
[
y: int
Y-coordinate.
x: int
X-coordinate.
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +ezio.melotti, pitrou, rhettinger
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20298
___
Serhiy Storchaka added the comment:
I think this is just not JSON. Try to use YAML parsers.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20298
___
Vajrasky Kok added the comment:
Ah, thanks for the review, Serhiy. My bad. There is no underlying bug of tar. I
was confused by the behaviour of tar which is converting the absolute path to
relative path.
So, adding '/home/user/dir/file' to tar when you are in '/home/user/dir' then
New submission from Tal Einat:
For example, in `Object/stringlib/transmogrify.h`, the methods `ljust` and
`rjust` have an argument named `fillchar` of type char. It's Python default
value should be b' ', but the only way I've found to do that is by setting
`py_default = b' '`.
--
Vajrasky Kok added the comment:
Serhiy commented, I think we should remove targetpath in all cases. Not only
when softlink is
extracted.
I already did that in my latest patch but I am a little bit wary of this
behaviour.
--
___
Python tracker
Tal Einat added the comment:
Additionally, the char converter doesn't create valid c defaults. For example,
I got instead of ' ' for fillchar, which has type char, so I had to
manually set c_default = ' '.
--
___
Python tracker
Yury Selivanov added the comment:
Larry,
I saw your message on the tracker regarding adding support for parameters
groups to the signature object. Would you mind if I join the discussion with my
ideas of how this feature might be implemented?
Yury
On Sunday, January 19, 2014 at 5:44 AM,
Nadeem Vawda added the comment:
The patches for bz2 and lzma look good to me, aside from one nit for lzma.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20193
___
New submission from Shiz:
As a result of Android's relatively incomplete locale.h implementation[1], some
functions are not defined and some standard structs are lacking fields (e.g.
decimal_point, thousand_sep).
This prevents proper cross-compilation using the Android NDK[2] from succeeding.
Changes by Shiz h...@shiz.me:
--
title: Android's incomplete locale.h implementation prevents compilation -
Android's incomplete locale.h implementation prevents cross-compilation
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +lemburg, loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20305
___
___
New submission from Shiz:
As the title states, mkpwent() in pwdmodule.c accesses `pw_gecos`, which is not
defined for struct passwd in Bionic, Android's C library.
Attached is a patch that works around the issue by setting the field to None on
Android.
--
components: Cross-Build
New submission from Shiz:
Bionic, Android's C library, fails to expose the SYS_* constants used for the
syscall(1) interface, which causes compilation of the _posixsubprocess module
to fail as it directly attempts to call SYS_getdents64.
Attached is an experimental patch that manually defines
Marc-Andre Lemburg added the comment:
I'd be +1 on such a patch if we were to officially support Android, but we'd
need a volunteer to champion for this (which would be a good thing, IMO).
Otherwise, such changes need to be maintained externally.
--
Shiz added the comment:
I of course meant the syscall(2) interface, not syscall(1).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20307
___
___
Claudiu.Popa added the comment:
Hello. Here's a new version which uses real image files as testing data.
--
Added file: http://bugs.python.org/file33552/test_imghdr_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19990
Claudiu.Popa added the comment:
Updated patch to use real image files from issue #19990.
--
Added file: http://bugs.python.org/file33553/imghdr_bytes.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19997
Claudiu.Popa added the comment:
Yep, it sounds better. There's an additional warning in urllib.urlopen which
states a similar thing:
warnpy3k(urllib.urlopen() has been removed in Python 3.0 in
favor of urllib2.urlopen(), stacklevel=2)
--
Claudiu.Popa added the comment:
Antoine, is this feature still wanted?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
Terry J. Reedy added the comment:
Yuri, I am sure your ideas for enhancing signature objects would be welcome.
Either a new issue or a thread on pydev or python-ideas lists would be best.
When responding by email, please snip the quotation and footer, except possibly
a line of the quoted
Yury Selivanov added the comment:
Terry,
Thanks.
When responding by email, please snip the quotation and footer, except
possibly a line of the quoted message.
My email client played an evil (and a bit embarrassing) trick with me, showing
Larry's name without an actual email address,
Serhiy Storchaka added the comment:
Thank you Larry, now I can use Argument Clinic in the __init__ methods. But
there is one problem.
Docstring generated for the __init__ method contains the __init__ name in the
signature. Therefore it can't be used as class docstring. On other hand, the
Martin Vignali added the comment:
You're right, i make the correction, in a new patch.
I make other tests, with official sample files :
http://download.savannah.nongnu.org/releases/openexr/openexr-images-1.4.0.tar.gz
--
Added file: http://bugs.python.org/file33554/img_hdr_exr_3.patch
Claudiu.Popa added the comment:
Hi, Martin.
Please see issue19990, which tries to add unit tests for imghdr module. It
would be nice if you could expand on it with an exr file, for your use case.
--
nosy: +Claudiu.Popa
___
Python tracker
Kim Gräsman added the comment:
Thanks!
There's another thing I would appreciate having somebody else test: creating
and removing junctions in a non-elevated prompt. I haven't been able to, my IT
department has trouble understanding the value of least-privilege.
--
Stefan Krah added the comment:
MSG*1024 passes. I did not look at this issue: Would changing the value to 1024
invalidate the test?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20246
___
New submission from Larry Hastings:
Boy was I surprised by this:
class C: pass
...
import inspect
inspect.signature(C)
Traceback (most recent call last):
File stdin, line 1, in module
File /home/larry/src/python/clinic_c_types_hacking/Lib/inspect.py, line
1557, in signature
raise
Martin Vignali added the comment:
I made a simple exr file with the lib Exr (it's a half float ZIP16 RGBA file),
in order to add real exr file to the unit test.
When use with the patch i made here http://bugs.python.org/issue20295 ,
this sample file return 'exr'.
Sorry, i don't know how to
Yury Selivanov added the comment:
Well, the current code looks for __init__ or __new__. The only ones it can find
is the 'object.__init__' which are blacklisted, because they are in C.
The question is do (or will) 'object.__new__' or '__init__' have a signature
defined with the clinic?
Yury Selivanov added the comment:
Otherwise we run the risk of introducing unexpected exceptions into
introspection code.
That's a good catch. I'll make a new patch, keeping the old implementation of
getfullargsspec intact, and falling back to it if no signature can be found.
--
Larry Hastings added the comment:
Yury: fire away, either here or in a new issue as is best. (Sorry, brain
mildly fried, not sure what would be best issue-tracker hygiene.)
--
___
Python tracker rep...@bugs.python.org
Larry Hastings added the comment:
__new__ and __init__ methods are very special. They can't have signatures,
because the mechanism we use to store the signatures won't work. (We hide them
as a special first line of the docstring, and __new__ and __init__ can't have
custom docstrings.)
In
Yury Selivanov added the comment:
In this case it would probably be best to just special case classes that don't
have __init__ or __new__ defined to return an empty signature without
parameters.
I can also make a special case for object.__init__ and object.__new__
functions, if someone would
Yury Selivanov added the comment:
Otherwise we run the risk of introducing unexpected exceptions into
introspection code.
That's a good catch. I'll make a new patch, keeping the old implementation of
getfullargsspec intact, and falling back to it if no signature can be found.
Nick, while
Larry Hastings added the comment:
If we need a special case for user classes without __new__ or __init__, then do
that. But I wouldn't say we should special case object.__new__ and
object.__init__.
--
___
Python tracker rep...@bugs.python.org
Yury Selivanov added the comment:
Please take a look at the attached patch (signature_plain_cls_01.patch)
Now, the patch addresses two kind of classes:
class C: pass
and
class C(type): pass
For metaclasses, signature will return a signature with three positional-only
parameters - (name,
Larry Hastings added the comment:
inspect.signature(object) works fine in my (not yet posted) latest #20189 patch.
inspect.signature(type) doesn't work, because it's not clear what the signature
for type should be. There's the one-argument and three-argument approaches.
This is technically
Yury Selivanov added the comment:
Couple of thoughts:
1. (object_or_name, [bases, dict]) is a signature for the type function,
and yes, on that we need to agree how it looks like. Maybe exactly as you
proposed, as it is what it is after all.
2. For user-defined metaclasses without __init__
Larry Hastings added the comment:
Special cases aren't special enough to break the rules. If the signature of a
metaclass is (object_or_name, [bases, dict]), then we must not special-case
it to pretend that (object) works. I agree it's a bad idea to actually *do*
that, but there are
Yury Selivanov added the comment:
When in doubt, import this ;)
Agree. So the best course would be: make a patch for plain classes (not
metaclasses). Fix signatures for metaclasses without __init__/__new__ when we
have groups support for parameters, so that we can have (obj_or_name, [bases,
Yury Selivanov added the comment:
Attached is a stripped down patch that special-cases classes without
__init__/__new__. Not metaclasses, for that we can start a new issue.
--
Added file: http://bugs.python.org/file33557/signature_plain_cls_02.patch
Yury Selivanov added the comment:
Yury: fire away, either here or in a new issue as is best. (Sorry, brain
mildly fried, not sure what would be best issue-tracker hygiene.)
Larry, I ended up with a relatively big core dump of my thoughts, so I decided
to post it on python-dev. Let's
Nikolaus Rath added the comment:
No, I really mean XML processing instruction. I agree with you that the XML
declaration is a non-issue, because there is no information lost: you know that
you're going to write XML, and you manually specify the encoding. Thus it's
trivial to add the correct
Vajrasky Kok added the comment:
Attached the patch to address Ezio Melotti's concern. Thanks for the review!
--
Added file:
http://bugs.python.org/file33558/parse_non_valid_json_float_with_unit_test_v2.patch
___
Python tracker rep...@bugs.python.org
Nikolaus Rath added the comment:
(adding the documentation experts from
http://docs.python.org/devguide/experts.html to noisy in the hope to push this
forward)
--
nosy: +eric.araujo, ezio.melotti, georg.brandl
___
Python tracker
Nikolaus Rath added the comment:
(adding the documentation and ctypes experts from
http://docs.python.org/devguide/experts.html to noisy list in the hope to get
this moving again.)
--
nosy: +belopolsky, eric.araujo, ezio.melotti, georg.brandl, meador.inge
versions: -Python 2.6,
Nikolaus Rath added the comment:
Nadeem, did you have a chance to look at this again, or do you have any partial
patch already?
If not, I'd like to try working on a patch.
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset f4eade5df217 by Benjamin Peterson in branch '3.3':
document that a new Python thread context is created in ctypes callbacks
(closes #6627)
http://hg.python.org/cpython/rev/f4eade5df217
New changeset 9cd2d7a3f9f2 by Benjamin Peterson in branch
New submission from Larry Hastings:
I found something curious while experimenting with types tonight.
Everybody knows, if you access a descriptor in a class through the normal
attribute-getting methods, you actually get the result of calling its '__get__'
method. If you want to get your
Larry Hastings added the comment:
I should add, I see the same results with current trunk and with my handy
Python 3 (currently 3.3.1rc1, huh guess I'm behind).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20309
Changes by Larry Hastings la...@hastings.org:
--
title: Class method descriptors are different between builtin and user classes
- Not all descriptors are callable
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20309
New submission from Charles-Axel Dein:
I just thought that using pprint.pprint was an elegant solution to the
non-deterministic order of repr(dict) in doctest. See for instance
http://bugs.python.org/issue3332
Contrary to sorted(foo().items()):
- It provides a nice output that is exactly
Georg Brandl added the comment:
Hmm, the yield statement is now basically the same as any expression statement
-- just like a function call. The only reason it's a separate grammar symbol
is that otherwise yield expressions would have to be parenthesized.
Can the patch be updated to make
72 matches
Mail list logo