Re: CPython 2.7: Weakset data changing size during internal iteration

2012-06-02 Thread Terry Reedy

On 6/1/2012 7:40 PM, Temia Eszteri wrote:


Given that len(weakset) is defined (sensibly) as the number of currently
active members, it must count. weakset should really have .__bool__
method that uses any() instead of sum(). That might reduce, but not
necessarily eliminate your problem.


Think it might be worth looking into submitting a patch for the next
minor releases for Python if it turns out to solve the problem?


I think a patch would be worthwhile even if this is not the source of 
your problem. If bool is defined as 'if any ...', that should be the code.



I can think of two reasons:

1. You are using multiple threads and another thread does something to
change the size of the set during the iteration. Solution? put a lock
around the if-statement so no other thread can change self.data during
the iteration.

2. Weakset members remove themselves from the set before returning None.
(Just a thought, in case you are not using threads).


In other words, it is possible that weakset.__len__ is buggy. Since you 
are sure that 1) is not your problem, that seems more likely now.



If the weak references removing themselves is the case, it seems like
a kind of silly problem - one would imagine they'd wrap the data check
in _IterationGuard in the _weakrefset.py file like they do for calls
to __iter__(). Very strange.


While looking into the weakset code, you might check the tracker for 
weakset issues. And also check the test code. I have *no* idea how well 
that class has been exercised and tested. Please do submit a patch if 
you can if one is needed.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: DBF records API

2012-06-02 Thread MRAB

On 02/06/2012 06:16, Ethan Furman wrote:

Tim Chase wrote:

 On 06/01/12 19:05, Jon Clements wrote:

 On 01/06/12 23:13, Tim Chase wrote:

dbf.scatter_fields

 *always* trump and refer to the method.

 I did think about *trumping* one way or the other, but both *ugh*.


 For the record, it sounded like the OP wanted to be able to use the
 dot-notation for accessing fields by name, and I think it's a pretty
 non-pythonic way to do it.  I'd much rather just stick to purely
 using __getitem__ for the fields and attributes/methods for non-fields.


It can't be *that* non-Pythonic -- we now have namedtuples which pretty
much behave just like my record class (although its indexes are only
numbers, not strings as well).


namedtuple prefixes its methods with _, so you could just have:

record.name

and:

record._deleted
--
http://mail.python.org/mailman/listinfo/python-list


Re: DBF records API

2012-06-02 Thread Tim Chase
On 06/02/12 00:16, Ethan Furman wrote:
 Tim Chase wrote:
 On 06/01/12 19:05, Jon Clements wrote:
 On 01/06/12 23:13, Tim Chase wrote:
dbf.scatter_fields

 *always* trump and refer to the method.
 I did think about *trumping* one way or the other, but both *ugh*.

 For the record, it sounded like the OP wanted to be able to use the
 dot-notation for accessing fields by name, and I think it's a pretty
 non-pythonic way to do it.  I'd much rather just stick to purely
 using __getitem__ for the fields and attributes/methods for non-fields.
 
 It can't be *that* non-Pythonic -- we now have namedtuples which pretty 
 much behave just like my record class (although its indexes are only 
 numbers, not strings as well).

Right, but the contents of the named-tuple are usually static in
relation to the code itself, rather than dependent on external
factors (such as user-supplied DBF files).  In addition, I believe
namedtuple has methods prefixed by an underscore to stave off
clashing names.

-tkc



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter deadlock on graceful exit

2012-06-02 Thread Matteo Landi
On Jun/01, Matteo Landi wrote:
 On Thu, May 31, 2012 at 3:02 PM, Matteo Landi mat...@matteolandi.net wrote:
  On Thu, May 31, 2012 at 3:42 AM, Terry Reedy tjre...@udel.edu wrote:
  On 5/30/2012 6:19 PM, Matteo Landi wrote:
 
  On May/28, Matteo Landi wrote:
 
  Hi list,
  recently I started to work on an application [1] which makes use of the
  Tkinter
  module to handle interaction with the user.  Simply put, the app is a
  text
  widget displaying a file filtered by given criteria, with a handy feature
  that
  the window is raised each time a new line is added to the widget.
 
  The application mainly consists of three threads:  the first one, the
  file
  processor, reads the file, filters the lines of interest, and pushes them
  into
  a shared queue (henceforth `lines_queue`);  the second one, the
  gui_updater,
  pops elements from `lines_queue`, and schedule GUI updates using the
  `after_idle` method of the Tkinter module;  finally the last one, the
  worker
  spawner, receives commands by the gui (by means of a shared queue,
  `filters_queue`), and drives the application, terminating or spawning new
  threads.
 
  For example, let's see what happens when you start the application, fill
  the
  filter entry and press Enter button:
  1 the associated even handler is scheduled (we should be inside the
  Tkinter
    mainloop thread), and the filter is pushed into `filters_queue`;
  2 the worker spawner receives the new filter, terminate a possibly
  running
    working thread, and once done, create a new file processor;
  3 the file processor actually processes the file and fills the
  `lines_queue`
    with the lines matching given filter;
  4 the gui updater schedules GUI updates as soon as items are pushed into
    `lines_queue`
  5 Tkinter mainloop thread updates the gui when idle
 
  What happens when the main window is closed?  Here is how I implemented
  the
  graceful shutdown of the app:
  1 a quit event is scheduled and a _special_ message is pushed into both
    `filter_queue` and `lines_queue`
  2 the gui updater threads receives the _special_ message, and terminates
  3 the worker spawner receives the message, terminates the working thread
  and
    interrupts her execution.
  4 Tk.quit() is called after the quit event handler, and we finally quit
  the
    mainloop
 
  Honestly speaking, I see no issues with the algorithm presented above;
   however,
  if I close the window in the middle of updates of the text widget, the
  applications hangs indefinitely.  On the other hand, everything works as
  expected if I close the app when the file processor, for example, is
  waiting for
  new content to filter.
 
  I put some logging messages to analyze the deadlock (?!), and noticed
  that both
  the worker spawner and the file processor are terminated correctly.  The
  only
  thread still active for some strange reasons, is the gui updater.
 
  Do you see anything wrong with the description presented above?  Please
  say so,
  because I can't figure it out!
 
 
  Since no-one else answered, I will ask some questions based on little
  tkinter experience, no thread experience, and a bit of python-list reading.
 
  1. Are you only using tkinter in one thread? (It seems like so from the
  above)?
 
  Yes, provided that `after_idle` queues a job for the gui thread
 
 
  2. Is root.destroy getting called, as in 24.1.2.2. A Simple Hello World
  Program in the most recent docs? (I specify 'most recent' because that
  example has been recently revised because the previous version sometimes
  left tkinter hanging for one of the code paths, perhaps similar to what you
  describe.
 
  No, I'm not calling the destroy method of the main window but, why
  that only happens while doing gui updates?
 
 
  3. Have you tried making the gui thread the master thread? (I somehow 
  expect
  that the gui thread should be the last to shut down.)
 
  No but, same question as above.
 
  I'm not home right now, so I will try those solutions as soon as
  possible.  Thanks.
 
 
  Cheers,
  Matteo
 
 
  --
  Terry Jan Reedy
 
  --
  http://mail.python.org/mailman/listinfo/python-list
 
 
 
  --
  http://www.matteolandi.net/
 
 Doing further investigation, I found this post [1] dated 2005, which
 probably explains why I'm gatting this strange deadlock.
 
 Quoting the linked article:
 
 All Tkinter access must be from the main thread (or, more precisely,
 the thread that called mainloop). Violating this is likely to cause
 nasty and mysterious symptoms such as freezes or core dumps. Yes this
 makes combining multi-threading and Tkinter very difficult. The only
 fully safe technique I have found is polling (e.g. use after from the
 main loop to poll a threading Queue that your thread writes). I have
 seen it suggested that a thread can safely use event_create to
 communicate with the main thread, but have found this is not safe.
 
 Well, if this still applies, then I'm invoking `after_idle` from a
 thread different from the 

how to typecast a ctypes pointer to another one

2012-06-02 Thread Gelonida N

Hi,

I have a result from a call to a ctypes function of type c_void_p.

Now I'd like to convert it to a pointer to one of the structures, that I 
defined.



result = library.c_function(params)

class MyStruct(ctypes.Structure):
_fields_ = [
('fourbytes', ctypes.c_char * 4)
]



I know I could (prior to calling) specify what datatype the function 
should return)


However as depending on some other conditions I have to interpret the 
return value either as pointer to one or another data type or another one.


Id' like to perform the casting after having received the value.


Thanks in advance for any pointers.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7.3, C++ embed memory leak?

2012-06-02 Thread Diez B. Roggisch
Qi n...@no.com writes:

 Hi guys,

 Is there any known memory leak problems, when embed Python 2.7.3
 in C++?
 I Googled but only found some old posts.

 I tried to only call Py_Initialize() and Py_Finalize(), nothing else
 between those functions, Valgrind still reports memory leaks
 on Ubuntu?

 Is that a know problem? Did Python 3.x solve it?

 I want some confirmation.

Python does some special things that confuse valgrind. Don't bother.

http://svn.python.org/projects/python/trunk/Misc/README.valgrind

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ctypes callback with char array

2012-06-02 Thread Diez B. Roggisch
ohlfsen ohlf...@gmail.com writes:

 Hello.

 Hoping that someone can shed some light on a tiny challenge of mine.

 Through ctypes I'm calling a c DLL which requires me to implement a callback 
 in Python/ctypes.

 The signature of the callback is something like

 void foo(int NoOfElements, char Elements[][100])

 How do I possible implement/process char Elements[][100] in Python/ctypes 
 code?

I'd try it like this:

$ python
Python 2.7 (r27:82500, May  2 2011, 22:50:11) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type help, copyright, credits or license for more information.
oWelcome to rlcompleter2 0.98
for nice experiences hit tab multiple times
 from ctypes import *
 callback_type = CFUNCTYPE(None, c_int, POINTER(c_char_p))
 def my_callback(int, elements):
... pass
... 
 c_callback = callback_type(my_callback)
 c_callback
CFunctionType object at 0x100697940


No need to know that it's a pointer to char[100] pointers - you can cast
that if you want to.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7.3, C++ embed memory leak?

2012-06-02 Thread Qi

On 2012-6-2 18:53, Diez B. Roggisch wrote:

Python does some special things that confuse valgrind. Don't bother.

http://svn.python.org/projects/python/trunk/Misc/README.valgrind


Thanks for the link.
It clears a lot of my confusing, such as uninitialized reading...


--
WQ
--
http://mail.python.org/mailman/listinfo/python-list


WHAT DO MUSLIMS THINK ABOUT JESUS ?????????

2012-06-02 Thread BV BV
WHAT DO MUSLIMS THINK ABOUT JESUS?
 I know that my article is not related to this group ,but it might be
useful.
PLEASE read it
What do Muslims think about Jesus?
Muslims respect and revere Jesus (SAW) and await his Second Coming.
They consider him one of the greatest of God’s messengers to mankind.
A Muslim never refers to him simply as ‘Jesus’, but always adds the
phrase ‘upon him be peace’. The Quran confirms his virgin birth (a
chapter of the Quran is entitled ‘Mary’), and Mary is considered the
purest woman in all creation. The Quran describes the Annunciation as
follows:
‘Behold!’ the Angel said, ‘God has chosen you, and purified you, and
chosen you above the women of all nations. O Mary, God gives you good
news of a word from Him, whose name shall be the Messiah, Jesus son of
Mary, honored in this world and the Hereafter, and one of those
brought near to God. He shall speak to the people from his cradle and
in maturity, and shall be of the righteous.’ She said: ‘O my Lord! How
shall I have a son when no man has touched me?’ He said: ‘Even so; God
creates what He will. When He decrees a thing He says to it, Be! and
it is.’ (Quran, 3.42-7)
Jesus (SAW) was born miraculously through the same power which had
brought Adam (SAW) into being without a father:
Truly, the likeness of Jesus with God is as the likeness of Adam. He
created him of dust, and then said to him, ‘Be!’ and he was. (3.59)
During his prophetic mission Jesus (SAW) performed many miracles. The
Quran tells us that he said:
‘I have come to you with a sign from your Lord: I make for you out of
clay, as it were, the figure of a bird, and breathe into it and it
becomes a bird by God’s leave. And I heal the blind, and the lepers,
and I raise the dead by God’s leave.’ (3.49)
Neither Muhammad (SAW) nor Jesus (SAW) came to change the basic
doctrine of the belief in One God, brought by earlier prophets, but to
confirm and renew it. In the Quran Jesus (SAW) is reported as saying
that he came:
‘To attest the law which was before me. And to make lawful to you paff
of what was forbidden you; I have come to you with a sign from your
Lord, so fear God and obey Me.’ (3:5O)
The Prophet Muhammad (SAW) said:
‘Whoever believes there is no god but God, alone without partner, that
Muhammad (SAW) is His messenger, that Jesus is the servant and
messenger of God, His word breathed into Mary and a spirit emanating
from Him, and that Paradise and Hell are true, shall be received by
God into Heaven.’ (Hadith from Bukhari)
—-
For more information about Islam

http://www.islam-guide.com

http://www.islamhouse.com/s/9661

http://www.thisistruth.org

http://www.quran-m.com/firas/en1

http://kaheel7.com/eng

http://www.knowmuhammad.com

http://www.rasoulallah.net/v2/index.aspx?lang=e

 http://imanway1.com/eng

http://www.todayislam.com

http://www.thekeytoislam.com

http://www.islamland.com

http://www.discoverislam.com

http://www.thetruereligion.org

http://www.beconvinced.com

http://islamtomorrow.com

http://www.quranforall.org

http://www.quranexplorer.com/quran

http://www.prophetmuhammed.org

http://chatislamonline.org/en/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread boj
There is a 3rd party programmer for the LaunchPad
that lets you program it in Python, but I forgot what 
they were called. It has an m somewhere in it and it's
3 letters. I saw it at MakerFaire. I got their card, but 
lost it. If I remember the name, I'll post it here.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread MRAB

On 02/06/2012 21:47, boj wrote:

There is a 3rd party programmer for the LaunchPad
that lets you program it in Python, but I forgot what
they were called. It has an m somewhere in it and it's
3 letters. I saw it at MakerFaire. I got their card, but
lost it. If I remember the name, I'll post it here.


Putting LaunchPad, Python and MakerFaire into Google, plus the
It has an m somewhere in it and it's 3 letters, quickly led me to:

http://www.mpyprojects.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread Chris Angelico
On Sun, Jun 3, 2012 at 7:18 AM, MRAB pyt...@mrabarnett.plus.com wrote:
 Putting LaunchPad, Python and MakerFaire into Google, plus the
 It has an m somewhere in it and it's 3 letters, quickly led me to:

 http://www.mpyprojects.com
 --

Heh, Google's awesome :) I was just thinking Hm, three letters with
an M? That gives you about two thousand possibilities, not too many to
brute-force...

That looks rather cool, but I'm minorly concerned by a heading in
http://www.mpyprojects.com/mpy-language/ that hints that the mpy
language isn't Python exactly, but doesn't have a link to the actual
page on which the differences are detailed. It might be trivial
differences like the lack of most of the standard library, but then
again, it might be more than that.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread MRAB

On 02/06/2012 22:25, Chris Angelico wrote:

On Sun, Jun 3, 2012 at 7:18 AM, MRABpyt...@mrabarnett.plus.com  wrote:

 Putting LaunchPad, Python and MakerFaire into Google, plus the
 It has an m somewhere in it and it's 3 letters, quickly led me to:

 http://www.mpyprojects.com
 --


Heh, Google's awesome :) I was just thinking Hm, three letters with
an M? That gives you about two thousand possibilities, not too many to
brute-force...


Well, if it's something to do with Python, there wouldn't been a good
chance that 2 of the letters would be Py. That reduces the number of
possibilities somewhat! :-)


That looks rather cool, but I'm minorly concerned by a heading in
http://www.mpyprojects.com/mpy-language/ that hints that the mpy
language isn't Python exactly, but doesn't have a link to the actual
page on which the differences are detailed. It might be trivial
differences like the lack of most of the standard library, but then
again, it might be more than that.


Look at the Software page:

We use the mpy language to program the MSP430 microcontroller. MPY is 
short for Microcontroller PYthon.   mpy is based on the Python computer 
language. In fact to keep things simple it is only a small subset of the 
Python language.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Smallest/cheapest possible Python platform?

2012-06-02 Thread Chris Angelico
On Sun, Jun 3, 2012 at 8:09 AM, MRAB pyt...@mrabarnett.plus.com wrote:
 Look at the Software page:

 We use the mpy language to program the MSP430 microcontroller. MPY is
 short for Microcontroller PYthon.   mpy is based on the Python computer
 language. In fact to keep things simple it is only a small subset of the
 Python language.

Ah, yes I missed that.

Seems it's  Python-like language implemented in Python, which is I
think a smart way to do it (assuming that this code isn't going to
have trust issues).

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue14982] pkgutil.walk_packages seems to not work properly on Python 3.3a

2012-06-02 Thread Marc Abramowitz

Marc Abramowitz msabr...@gmail.com added the comment:

[last: 0] marca@scml-marca:~/dev/git-repos/pip$ python3.3
Python 3.3.0a4 (v3.3.0a4:7c51388a3aa7, May 30 2012, 16:58:42) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
 from pip import vcs
 from pkgutil import walk_packages, iter_modules
 print(list(iter_modules(path=vcs.__path__, prefix=vcs.__name__+'.')))
[]
 print(list(iter_modules(path=vcs.__path__)))
[]
 import pip.vcs.git
 pip.vcs.git
module 'pip.vcs.git' from './pip/vcs/git.py'
 import pip.vcs.mercurial
 pip.vcs.mercurial
module 'pip.vcs.mercurial' from './pip/vcs/mercurial.py'
 print(list(iter_modules(path=vcs.__path__, prefix=vcs.__name__+'.')))
[]
 print(list(iter_modules(path=vcs.__path__)))
[]

--

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



[issue14673] add sys.implementation

2012-06-02 Thread Eric Snow

Eric Snow ericsnowcurren...@gmail.com added the comment:

I've ironed out all 3 of my new tests that were still failing.

--
Added file: http://bugs.python.org/file25797/issue14673_full_3.diff

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



[issue14983] [patch] email.generator should always add newlines after closing boundaries

2012-06-02 Thread Dmitry Shachnev

New submission from Dmitry Shachnev mity...@gmail.com:

Trying to write a email-sending script with PGP-signing functionality, I 
stumbled upon a problem (see [1]): it was impossible to sign mutlipart emails 
(actually the signing was performed, but the verifying programs thought that 
the signature is bad).

After comparing messages produced by email.generator and popular mail clients 
(Evolution, KMail), I've found out that the mail clients always add line breaks 
after ending boundaries.

The attached patch makes email.generator behave like all email clients. After 
applying it, it's possible to sign even complicated mails like 
multipart/alternate with attachments.

An illustration:

 --1== # Part 1 (base message) begin
 ...
 --2== # Part 1.1 begin
 ...
 --2== # Part 1.2 begin
 ...
 --2==--   # Part 1 end
   # There should be empty line here
 --1== # Part 2 (signature) begin
 ...
 --1==--   # End of the message

[1]: 
http://stackoverflow.com/questions/10496902/pgp-signing-multipart-e-mails-with-python

--
components: email
files: always_add_newlines.patch
keywords: patch
messages: 162126
nosy: barry, mitya57, r.david.murray
priority: normal
severity: normal
status: open
title: [patch] email.generator should always add newlines after closing 
boundaries
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file25798/always_add_newlines.patch

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



[issue14673] add sys.implementation

2012-06-02 Thread Amaury Forgeot d'Arc

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

Some remarks:

- From the docs, I could not understand the difference between 
sys.implementation.version and sys.version_info.  When can they differ?

- _PyNamespace_New should be a public API function.  From Python code, 
SimpleNamespace is public.

- I agree that _PyNamespace_Type could stay private (it's an implementation 
detail), in this case PyAPI_DATA is not necessary.

- SimpleNamespace should support weak references.

--
nosy: +amaury.forgeotdarc

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-06-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Responding to a comment from Serhiy on Rietveld:

 Modules/_randommodule.c:442: mt[0] = 0x8000UL;
 mt[0] |= 0x8000UL (according to the comment)?

The = 0x8000UL was intentional.  The low-order 31 bits of mt[0] don't form 
part of the state of the Mersenne Twister:  the resulting random stream isn't 
affected by their values.  So all we have to do is make sure that bit 31 is 
set.  It's the same code that's used in init_by_array earlier in 
_randommodule.c.

--

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



[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-06-02 Thread alon horev

alon horev alo...@gmail.com added the comment:

after #14969 has closed, can this be closed? any more action items?

--

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



[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-06-02 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

It *was* closed - I inadvertently reopened it with my comment. Fixed :)

--
resolution:  - fixed
stage: test needed - committed/rejected
status: open - closed

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



[issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII

2012-06-02 Thread Dmitry Shachnev

Dmitry Shachnev mity...@gmail.com added the comment:

Maybe it'll be better to use 'latin-1' charset for latin-1 texts?

Something like this:

if _charset == 'us-ascii':
try:
_text.encode(_charset)
except UnicodeEncodeError:
try:
_text.encode('latin-1')
except UnicodeEncodeError:
_charset = 'utf-8'
else:
_charset = 'latin-1'

This will make messages in most latin languages use quoted-printable encoding.

--
components: +email -Library (Lib)
nosy: +barry

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



[issue14984] netrc module alows read of non-secured .netrc file

2012-06-02 Thread bruno Piguet

New submission from bruno Piguet bruno.pig...@gmail.com:

Most FTP clients require that the .netrc file be owned by the user and 
readable/writable by nobody other than the user (ie. permissions set to 0400 or 
0600).
The netrc module doesn't do this kind of checking, allowing the use a .netrc 
file written or modified by somebody else.

--
messages: 162132
nosy: bruno.Piguet
priority: normal
severity: normal
status: open
title: netrc module alows read of non-secured .netrc file
versions: Python 2.6

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



[issue14984] netrc module allows read of non-secured .netrc file

2012-06-02 Thread bruno Piguet

Changes by bruno Piguet bruno.pig...@gmail.com:


--
title: netrc module alows read of non-secured .netrc file - netrc module 
allows read of non-secured .netrc file

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



[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

2012-06-02 Thread Adrian Bastholm

New submission from Adrian Bastholm javahax...@gmail.com:

os.path.isfile doesn't reckognize a .picasa.ini file as a file
and os.path.isdir doesn't reckognize a directory as a directory

code:

def traverse (targetDir):
currentDir = targetDir
dirs = os.listdir(targetDir)
#dirs = [x for x in os.listdir('.') if x.endswith('.JPG')]
for entry in dirs:
if os.path.isdir(entry):
print(Traversing  + entry)
traverse(entry)
else:
print(Not dir:  + entry)
if os.path.isfile(entry):
print(Processing  +   + currentDir +   + entry)
else:
print(Not file:  + entry)
print(\n)
return True

The test directory contains jpg files and a folder with some other jpgs and a 
subfolder containing jpgs

--
assignee: ronaldoussoren
components: Macintosh
messages: 162133
nosy: javahaxxor, ronaldoussoren
priority: normal
severity: normal
status: open
title: os.path.isfile and os.path.isdir  inconsistent on OSX Lion
type: behavior
versions: Python 3.2

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Adrian Bastholm

New submission from Adrian Bastholm javahax...@gmail.com:

print(listentry) fails on folder name with swedish (latin1) characters
Error:

 File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/mac_roman.py,
 line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u030a' in position 
33: character maps to undefined

--
assignee: ronaldoussoren
components: Macintosh
messages: 162134
nosy: javahaxxor, ronaldoussoren
priority: normal
severity: normal
status: open
title: print() fails on latin1 characters on OSX
versions: Python 3.2

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



[issue6721] Locks in python standard library should be sanitized on fork

2012-06-02 Thread Tomaž Šolc

Changes by Tomaž Šolc tomaz.s...@tablix.org:


--
nosy:  -avian

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

A mac expert can confirm, but I think that just means that the default 
mac_roman encoding (which is made the default by the OS, if I understand 
correctly) can't handle that character.  I believe it will work if you use 
utf-8.  And no, I don't know how to do that, not be being a Mac person.

--
assignee: ronaldoussoren - 
nosy: +hynek, ned.deily, r.david.murray

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



[issue14983] [patch] email.generator should always add newlines after closing boundaries

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Then either the signer or the verifier (or both) are broken per RFC 2046 
(unless there has been an update that isn't referenced from the RFC).  Section 
http://tools.ietf.org/html/rfc2046#section-5.1.1 clearly indicates that the 
ending delimiter ends at the trailing --.  In particular, *transports* are 
allowed to add whitespace before the trailing CRLF, and receivers are to handle 
this case.

You might want to report bugs about that to the appropriate projects.

That said, there seems to be little harm in adding a CRLF, and some argument in 
its favor, since the RFC also says that the CRLF before the next boundary is 
conceptually part of it, and by that interpretation a CRLF could be considered 
missing (though I think technically it isn't...the reason for the rule is to 
disambiguate preceding *body* parts that end or don't end in a CRLF, and here 
we are dealing with an unambiguous ending boundary delimiter).

We'll need some tests for this.

--
stage:  - needs patch

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



[issue14983] [patch] email.generator should always add newlines after closing boundaries

2012-06-02 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
versions: +Python 2.7, Python 3.3

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



[issue6721] Locks in python standard library should be sanitized on fork

2012-06-02 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

  Use file locks in logging, whenever possible.

Logging doesn't just log to files, and moreover, also has locks to serialise 
access to internal data structures (nothing to do with files). Hence, using 
file locks in logging is not going to magically solve problems caused in 
threading+forking scenarios.

Apart from logging a commonly used part of the stdlib library which uses locks, 
I don't think this issue is to do with logging, specifically; logging uses 
locks in an unexceptional, conventional way, much as any other code might. 
Whatever solution is come up with for this thorny issue, it needs to be 
generic, in my view; otherwise we might just be papering over the cracks.

--

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



[issue14983] [patch] email.generator should always add newlines after closing boundaries

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Looking at your stackoverflow post, you might be able to fix this by doing an 
rstrip on the string body before signing it.  But then if we add a CRLF between 
the boundaries, the verifiers might start failing again.  What do you think?  
Probably adding the CRLF is the way to go, but I wonder, what are the 
controlling RFCs for signing/verifying and what do they say?

--

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



[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
title: [patch] email.generator should always add newlines after closing 
boundaries - email.generator should always add newlines after closing 
boundaries

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



[issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I do plan to add something like that at some point.  You could open a new issue 
for it if you like, and propose a formal patch.

--

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset facdca62aa68 by Sandro Tosi in branch 'default':
Issue #14814: minor spelling fixes
http://hg.python.org/cpython/rev/facdca62aa68

New changeset 4b4044292d09 by Sandro Tosi in branch 'default':
Issue #14814: use print() function
http://hg.python.org/cpython/rev/4b4044292d09

--

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



[issue14446] Remove deprecated tkinter functions

2012-06-02 Thread Michael Driscoll

Michael Driscoll m...@pythonlibrary.org added the comment:

Here's the doc patch. The local repo I was using yesterday is on a different 
computer that I don't have access to today. Hopefully applying two patches is 
okay. If not, I can redo the other patch and add it to this one.

--
Added file: http://bugs.python.org/file25799/tkinter_doc.patch

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



[issue14957] Improve docs for str.splitlines

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 4d9b3a58e208 by R David Murray in branch '3.2':
#14957: fix doc typo.
http://hg.python.org/cpython/rev/4d9b3a58e208

New changeset 3bb35ad5d9da by R David Murray in branch 'default':
#14957: fix doc typo.
http://hg.python.org/cpython/rev/3bb35ad5d9da

New changeset 48564362b687 by R David Murray in branch '2.7':
#14957: fix doc typo.
http://hg.python.org/cpython/rev/48564362b687

--

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

'\u030a' can’t be latin1 as 0x030a = 778 which is waaay beyond 255. :) That's 
gonna be utf-8 and indeed that maps to  ̊.

My best guess is that your LC_CTYPE is set to Mac Roman. You can check it using 
import os;os.environ.get('LC_CTYPE').

Try running python as LC_CTYPE=sv_SE.UTF-8 python3 and do a print('\u030a') 
to try if it helps.

Otherwise a more complete (but minimal) example demonstrating the problem would 
be helpful.

--

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-02 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Attached is a draft of the module documentation. I didn't commit yet cause we 
might want to rework it deeply. Else we can just commit the patch and let the 
comments coming as additional diffs.

--
stage: needs patch - patch review

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-02 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

and the patch...

--
Added file: http://bugs.python.org/file25800/ipaddress_module_doc.diff

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



[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

2012-06-02 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I think your problem is a different one: os.listdir() doesn't return full paths 
and os.path.isfile()/isdir() return False if the supplied path doesn't exist.

For example if you have this directory structure:

foo/
foo/bar/
foo/bar/baz

Calling os.listdir('foo') will return [bar]. Calling os.isdir('bar') will 
return False because it can't find the file.

Have a look at os.walk() which was written with your use case in mind.

--
nosy: +hynek
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-02 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

As discussed on IRC, please:

- add a link to the tutorial
- add some typical use cases to the header of the api
- change the name of the tutorial from Howto to HOWTO or a more descriptive 
title that doesn't contain the word how to at all.

--

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



[issue14982] pkgutil.walk_packages seems to not work properly on Python 3.3a

2012-06-02 Thread Ronan Lamy

Changes by Ronan Lamy ronan.l...@gmail.com:


--
nosy: +Ronan.Lamy

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



[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread Dmitry Shachnev

Dmitry Shachnev mity...@gmail.com added the comment:

 Looking at your stackoverflow post, you might be able to fix this by doing an 
 rstrip on the string body before signing it.

My body doesn't end with \n, so that doesn't help. If you suggest me any (easy) 
way to fix this on the level of my script, I will be happy.

 Probably adding the CRLF is the way to go, but I wonder, what are the 
 controlling RFCs for signing/verifying and what do they say?

The standard is RFC 1847, it doesn't say anything about multipart emails. I've 
just looked at what other mail clients do, it works, but I can't say anything 
about its correctness. Also, looking at some multipart signed emails in my 
inbox, they *all* have the blank line before the signature part.

--

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



[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Sorry, I wasn't clear.  By 'body' I actually meant the multipart part you are 
signing.  I haven't looked at your script really, but I was thinking of 
something along the lines of make_sig(str(fullmsg.get_payload(0)).rstrip()).  
But like I said I didn't actually look at your script, so that may not be 
applicable.

--

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

mac_roman is an obsolete encoding from Mac OS 9 days; it is seldom seen on 
modern OS X systems. But it is often the fallback encoding set in 
~/.CFUserTextEncoding if the LANG or a LC_* environment variable is not set 
(see, for example, 
http://superuser.com/questions/82123/mac-whats-cfusertextencoding-for).  If you 
run a terminal session using Terminal.app, the LANG environment variable is 
usually set for you to an appropriate modern value, like 'en_US.UTF-8' in the 
US locale; this is controlled by a Terminal.app preference; other terminal apps 
like iTerm2 have something similar.  But if you are using xterm with X11, xterm 
does not inject a LANG env variable.  So, something like:

   python3.2 -c 'print(\u030a)'

may fail running under xterm with UnicodeEncodeError but will print the 
expected character when run under Terminal.app.  I avoid those kinds of issues 
by explicitly setting LANG in my shell profile.

Let us know if that helps or, if not, how to reproduce your issue.

--

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



[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread Dmitry Shachnev

Dmitry Shachnev mity...@gmail.com added the comment:

 By 'body' I actually meant the multipart part you are signing.

Yes, I've understood you, and I mean the same :) The signature is created 
against the not-ending-with-newline string, in any case.

--

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



[issue14938] 'import my_pkg.__init__' creates duplicate modules

2012-06-02 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Thanks for the patch, Ronan! The fix seems fine and I will have a more thorough 
look at the test later and figure out where it should go (probably only going 
to worry about testing is_package() directly since that was the semantic 
disconnect). I will also update the docs when I commit the patch.

And as a matter of procedure, Ronan, can you submit a contributor agreement? 
http://python.org/psf/contrib/

--
stage: test needed - patch review

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



[issue14982] pkgutil.walk_packages seems to not work properly on Python 3.3a

2012-06-02 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Basically pkgutil kind of handles importers properly, kind of doesn't. So if a 
module defined a __loader__ it will use it, but all the rest of its code 
assumes it uses only the loaders defined in pkgutil.

The problem here is that pkgutil.walk_packages() ends up calling 
iter_importer_modules() which only returns anything of consequence if the 
loader has iter_modules() defined which is a non-standard API requirement that 
only pkgutil loaders has implemented. Basically the docs for pkgutil were 
incorrect in not specifying that the walk only works for loaders that define 
iter_modules().

--

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



[issue14926] random.seed docstring needs edit of *a *is

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset e2739145657d by Sandro Tosi in branch '3.2':
Issue #14926: fix docstring highlight
http://hg.python.org/cpython/rev/e2739145657d

New changeset 29148c027986 by Sandro Tosi in branch 'default':
Issue #14926: merge with 3.2
http://hg.python.org/cpython/rev/29148c027986

--
nosy: +python-dev

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



[issue14926] random.seed docstring needs edit of *a *is

2012-06-02 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Thanks Christopher!

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions:  -Python 2.7

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Adrian Bastholm

Adrian Bastholm javahax...@gmail.com added the comment:

The char in question: 'å'. It is a folder with this character in the name. My 
encoding is UTF-8. Running print(\u030a) gives a blank line

U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
General Character Properties
In Unicode since: 1.1
Unicode category: Letter, Uppercase
Canonical decomposition: U+0041 LATIN CAPITAL LETTER A + U+030A COMBINING RING 
ABOVE
Various Useful Representations
UTF-8: 0xC3 0x85
UTF-16: 0x00C5
C octal escaped UTF-8: \303\205
XML decimal entity: #197;
Annotations and Cross References
See also:
 • U+212B ANGSTROM SIGN
Equivalents:
 • U+0041 LATIN CAPITAL LETTER A U+030A COMBINING RING ABOVE

The code:

def traverse (targetDir):
currentDir = targetDir
dirs = os.listdir(targetDir)
for entry in dirs:
if os.path.isdir(entry):
print(Traversing  + entry)
traverse(entry)
else:
print(Not dir:  + entry)
if os.path.isfile(entry):
print(Processing  +   + currentDir +   + entry)
else:
print(Not file:  + entry)
print(\n)

--

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



[issue1521950] shlex.split() does not tokenize like the shell

2012-06-02 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I've updated the patch following comments by RDM - it probably could do with a 
code review (now that I've addressed RDM's comments on the docs).

--

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Adrian Bastholm

Adrian Bastholm javahax...@gmail.com added the comment:

The last post is the CAPITAL Å. The following is the small letter å

U+00E5 LATIN SMALL LETTER A WITH RING ABOVE
General Character Properties
In Unicode since: 1.1
Unicode category: Letter, Lowercase
Canonical decomposition: U+0061 LATIN SMALL LETTER A + U+030A COMBINING RING 
ABOVE
Various Useful Representations
UTF-8: 0xC3 0xA5
UTF-16: 0x00E5
C octal escaped UTF-8: \303\245
XML decimal entity: #229;
Annotations and Cross References
Notes:
 • Danish, Norwegian, Swedish, Walloon
Equivalents:
 • U+0061 LATIN SMALL LETTER A U+030A COMBINING RING ABOVE

--

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



[issue14955] hmac.secure_compare() is not time-independent for unicode strings

2012-06-02 Thread Jon Oberheide

Jon Oberheide j...@oberheide.org added the comment:

Thanks for the feedback, haypo. I've updated the patch to use unicode-internal. 
As long as the encode() of the expected non-attacker-controlled digest is not 
dependent on the actual contents of the digest, we should be good.

--
Added file: http://bugs.python.org/file25801/secure-compare-fix-v2.patch

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



[issue6721] Locks in python standard library should be sanitized on fork

2012-06-02 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

Lesha, the problems about magical __del__ methods you are worried about 
actually have nothing to do with threading and locks.  Even in a single 
threaded program using fork, exactly the same issues of potential corruption 
would be present because the object might be finalized at the same in multiple 
processes.

The idea that protecting the object with a thread lock will help you is 
seriously misguided UNLESS you also make sure you acquire them all before the 
fork -- and then you need to worry about the order in which you acquire all 
these locks.  There are much easier and more direct ways to deal with the issue 
than wrapping all objects with locks and trying to acquire them all before 
forking.

You could of course use multiprocessing.Lock() if you want a lock shared 
between processes.  But even then, depending on what the __del__ method does, 
it is likely that you will not want the object to be finalized in both 
processes.

However, the suggestion that locked-before-fork-locks should by default raise 
an error is reasonable enough.

--

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



[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

2012-06-02 Thread Adrian Bastholm

Adrian Bastholm javahax...@gmail.com added the comment:

You're right, my code was shite. Strange though it seemed to work on some 
files. The following updated version does everything as intended with the help 
of os.path.join:

def traverse (targetDir):
currentDir = targetDir
dirs = os.listdir(targetDir)
for entry in dirs:
if os.path.isdir(os.path.join(currentDir,entry)):
print(Traversing  + os.path.join(targetDir,entry))
traverse(os.path.join(targetDir,entry))
else:
if os.path.isfile(os.path.join(targetDir,entry)):
print(Processing +   + os.path.join(currentDir,entry))
else:
print(Not file:  + entry)
print(\n)

--

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



[issue14901] Python Windows FAQ is Very Outdated

2012-06-02 Thread Daniel Swanson

Daniel Swanson popcorn.tomato.d...@gmail.com added the comment:

 1a) Update all Windows references to Windows 7 or Vista/7. We can include 
 XP, but I think Microsoft is dropping support next year.

According to wikipedia Windows XP is the second most popular operating system, 
probably better not to drop it all together. 
http://en.wikipedia.org/wiki/Usage_share_of_operating_systems

Of course there are people who have 5 or 6 computers and use the same windows 
disk on all of them which might skew the data.

--

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



[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Hmm.  So that means the verifiers are not paying attention to the MIME RFC?  
That's unfortunate.

--

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

The character in question is not the problem and the code snippet you provide 
looks fine.  The problem is almost certainly that you are running the code in 
an execution environment where the LANG environment variable is either not set 
or is set to an encoding that doesn't support higher-order Unicode characters. 
The fallback 'mac_roman' is such an encoding.  The default encodings used by 
the Python 3 interpreter are influenced by the value of these environment 
variables.  So the questions are: how are you running your code and what are 
the values of the environment variables that your Python program inherits, and, 
by any chance, is your program using the 'locale' module, and if so, exactly 
what functions from it?

Please try adding the following in the environment you are seeing the problem:

import sys
print(sys.stdout)
import os
print([(k, os.environ[k]) for k in os.environ if k.startswith('LC')])
print([(k, os.environ[k]) for k in os.environ if k.startswith('LANG')])
import locale
print(locale.getlocale())
print('\u00e5')
print('\u0061\u030a')

If I paste the above into a Python3.2 interactive terminal session using the 
python.org 64-/32-bit Python 3.2.3, I see the following:

$ python3.2
Python 3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:25:50) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
 import sys
 print(sys.stdout)
_io.TextIOWrapper name='stdout' mode='w' encoding='UTF-8'
 import os
 print([(k, os.environ[k]) for k in os.environ if k.startswith('LC')])
[]
 print([(k, os.environ[k]) for k in os.environ if k.startswith('LANG')])
[('LANG', 'en_US.UTF-8')]
 import locale
 print(locale.getlocale())
('en_US', 'UTF-8')
 print('\u00e5')
å
 print('\u0061\u030a')
å

But, if I explicitly remove the LANG environment variable:

$ unset LANG
$ python3.2
Python 3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:25:50) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
 import sys
 print(sys.stdout)
_io.TextIOWrapper name='stdout' mode='w' encoding='US-ASCII'
 import os
 print([(k, os.environ[k]) for k in os.environ if k.startswith('LC')])
[]
 print([(k, os.environ[k]) for k in os.environ if k.startswith('LANG')])
[]
 import locale
 print(locale.getlocale())
(None, None)
 print('\u00e5')
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 0: 
ordinal not in range(128)
 print('\u0061\u030a')
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeEncodeError: 'ascii' codec can't encode character '\u030a' in position 
1: ordinal not in range(128)


--

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



[issue14984] netrc module allows read of non-secured .netrc file

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

This seems like something we should fix for the default file read.  There is a 
backward compatibility concern, but I think the security aspect overrides that.

--
components: +Library (Lib)
nosy: +r.david.murray
priority: normal - high
type:  - security
versions: +Python 2.7, Python 3.2, Python 3.3

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



[issue14974] rename packaging.pypi to packaging.index

2012-06-02 Thread Westley Martínez

Westley Martínez aniko...@gmail.com added the comment:

-1
index is too generic to convey any kind of meaning and can be confused--atleast 
for me--with list.index. Sometimes it is better for a name to be specific.

--
nosy: +anikom15

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Westley Martínez

Westley Martínez aniko...@gmail.com added the comment:

I think a better technique would be to expand FILENAME_CHARS to include more 
characters.

--
nosy: +anikom15

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Westley Martínez

Westley Martínez aniko...@gmail.com added the comment:

Also, shouldn't the space character ' ' be included?

--

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Westley Martínez

Westley Martínez aniko...@gmail.com added the comment:

Ahh okay, sorry for the triple post, I have an idea.  On UNIX, the function 
should accept any character except: \0 /, and on Windows should accept any 
character except: \0 \ / : * ?|  On classic Macintosh, : is invalid.  
However, I do not know what characters are valid on other systems.  (I believe 
Mac OS X is the same as UNIX, but am not sure.)

Included is a patch with FILENAME_CHARS left in in case anything still needs it.

--
Added file: http://bugs.python.org/file25802/cpython-14937.patch

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



[issue1521950] shlex.split() does not tokenize like the shell

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Review, including a code-but-not-algorithm review :), posted.

--

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

I agree that chr(32) should be included in FILENAME_CHARS. 

The algorithm for backward searching checks that each character is contained in 
FILENAME_CHARS. I'm concerned about running time, as expanding FILENAME_CHARS 
to include all valid Unicode would be a large set to search. Do you know a 
better algorithm for determining when to perform a file-system completion when 
in a string?

Also, are there any Unicode code points above 127 that are not valid in a 
filename? I appreciate that different file systems can have different 
constraints but I don't know all these subtle points.

--

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

Westley, I was responding to msg162168 and didn't see msg162169 yet. 

PEP11 mentions MacOS 9 support was removed in 2.4. Is : still invalid in OSX?

I'll need to think about the approach of using an INVALID_CHARS list. It 
looks like it might be a better way to do this. However, here are some issues 
with the patch.

I received this error:

AttributeError: 'str' object has no attribute 'relpace'

I fixed this minor mistype, but noticed that file auto-completion no longer 
works for the following:

 /

Pressing tab after the forward slash should show a drop-down with the root 
filesystem. Changing INVALID_CHARS to be:

   if os.name == 'posix':
   INVALID_CHARS = '\0'

allows the root filesystem to show.

--

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Adrian Bastholm

Adrian Bastholm javahax...@gmail.com added the comment:

Output in console:

Python 3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:25:50) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
 import sys
 print(sys.stdout)
_io.TextIOWrapper name='stdout' mode='w' encoding='UTF-8'
 import os
 print([(k, os.environ[k]) for k in os.environ if k.startswith('LC')])
[('LC_CTYPE', 'UTF-8')]
 print([(k, os.environ[k]) for k in os.environ if k.startswith('LANG')])
[]
 import locale
 print(locale.getlocale())
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/locale.py, 
line 524, in getlocale
return _parse_localename(localename)
  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/locale.py, 
line 433, in _parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
 print('\u00e5')
å
 print('\u0061\u030a')
å
**

Output from Eclipse:

_io.TextIOWrapper name='stdout' mode='w' encoding='MacRoman'
[]
[]
(None, None)
å
Traceback (most recent call last):
  File 
/Users/adyhasch/Documents/PythonWorkspace/PatternRenamer/src/prenamer.py, 
line 70, in module
print('\u0061\u030a')
  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/mac_roman.py,
 line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u030a' in position 
1: character maps to undefined


I'm running PyDev ..

--

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Adrian Bastholm

Adrian Bastholm javahax...@gmail.com added the comment:

my code runs fine in a console window, so it's some kind of configuration 
error. Sorry for wasting your time guys .. It would be nice to know why PyDev 
is not setting the right environment vars though ..

 traverse(.)
Processing ./.DS_Store
Traversing ./2011-10-03--Sebi_o_costi_ny_frisyr
Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/.DS_Store
Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/.picasa.ini
Traversing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år
Processing 
./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/.DS_Store
Processing 
./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/.picasa.ini
Processing 
./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/DSC_5467.JPG
Processing 
./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/DSC_5468.JPG
Processing 
./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/DSC_5472.JPG

Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/DSC_5440.JPG
Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/DSC_5441.JPG

Processing ./__init__.py
Processing ./DSC_5440.JPG
Processing ./DSC_5453.JPG
Processing ./prenamer.py

--

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Francisco Gracia

Francisco Gracia fgragu...@gmail.com added the comment:

Is there any necessity at all for the IDLE to test the validity of the 
filenames? 

I mean: the file specification is provided by the underlying operating system, 
so by definition it has to be taken as valid. Testing for its validity is 
superfluous and, in my opinion, a fault in the general conception of the 
procedure. IDLE's only role should be to present the data it receives in the 
best possible form and silently integrate the election made by the user.

Excuse me if I speak nonsense, but I got this idea from studying 
*Autocomplete.py* and its dependencies. It seems to me that the difficulty 
resides in submitting natural language strings to the judgement of *PyParse* 
and *Hyperparser*, which are not competent for it because its purpose is to 
check the validity of Python code and Python *identifiers*. This confussion is 
what in my opinion causes this bug (and probably others related to the 
treatment of natural language text files by the IDLE, as it could also happen 
with issue 14929).

--

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



[issue14971] (unittest) loadTestsFromName does not work on method with a decorator

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Here's a patch.

--
components: +Library (Lib) -Documentation
keywords: +patch
Added file: 
http://bugs.python.org/file25803/unittest_method_name_difference.patch

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Glad we could help. I suspected it was running under special circumstances.

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue14986] print() fails on latin1 characters on OSX

2012-06-02 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I'm neither a PyDev nor an Eclipse user but there should be some way to set 
environment variables in it.  Undoubtedly, Eclipse is launched as an app so a 
shell is not involved and shell profile files are not processed.  However, the 
Environment section of this tutorial may help:

http://pydev.org/manual_101_interpreter.html

Try adding a definition for LANG or LC_CTYPE, as you prefer.  And you should 
use a valid localized definition, like LANG=en_US.UTF-8 for US English UTF-8.  
The list of definitions is in Lib/locale.py.  Good luck!

--

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



[issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

This is causing buildbot failures on some of the buildbots:

http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%203.x/builds/2529/steps/test/logs/stdio

http://www.python.org/dev/buildbot/all/builders/x86%20Windows7%203.x/builds/5082/steps/test/logs/stdio

--
nosy: +r.david.murray
status: closed - open

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



[issue14959] ttk.Scrollbar in Notebook widget freezes

2012-06-02 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

One final data point: I was unable to reproduce the failure when using a Python 
3.2.3 when linked with a current ActiveState Tcl/Tk 8.4, which uses an older 
Aqua Carbon Tk.  The python.org 32-bit-only Pythons use Tcl/Tk 8.4 like this; 
see http://www.python.org/download/mac/tcltk/ for more info.  No guarantee that 
the problem won't show up there for you or that there won't be other issues 
(for instance, the Aqua Carbon Tcl/Tk is only available in 32-bit mode) but it 
*might* be worth a try.  Given Kevin's response to your enquiry on the Mac Tcl 
list, the consensus seems to be that the problem here is indeed in the Cocoa 
port of Tcl/Tk and is unlikely to be addressed there soon.  Sorry!

http://permalink.gmane.org/gmane.comp.lang.tcl.mac/7029

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue1079] decode_header does not follow RFC 2047

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 8c03fe231877 by R David Murray in branch 'default':
#1079: Fix parsing of encoded words.
http://hg.python.org/cpython/rev/8c03fe231877

--
nosy: +python-dev

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



[issue14982] pkgutil.walk_packages seems to not work properly on Python 3.3a

2012-06-02 Thread Paul Nasrat

Paul Nasrat pnas...@gmail.com added the comment:

Ok so it seems I can't just use sys.meta_path in pip to work with ImpImporter 
due to according to the pydoc:

Note that ImpImporter does not currently support being used by placement on 
sys.meta_path.

I guess I can write a custom importer in pip for handling the vcs plugins or 
possibly change how we do that. Another option is to grossly hack around ala:

i = ImpImporter(path=vcs.__path__[0])
sys.path_importer_cache.setdefault(vcs.__path__[0], i)

Found another bug doing this though which I'll follow up with a patch.

--

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



[issue1079] decode_header does not follow RFC 2047

2012-06-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I've applied this to 3.3.  Because the preservation of spaces around the ascii 
parts is a visible behavior change that could cause working programs to break, 
I don't think I can backport it.  I'm going to leave this open until I can 
consult with Barry to see if he thinks a backport is justified.  Anyone else 
can feel free to chime in with an opinion as well :)

--

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



[issue14987] inspect missing warnings import

2012-06-02 Thread Paul Nasrat

New submission from Paul Nasrat pnas...@gmail.com:

Whilst looking for workarounds to http://bugs.python.org/issue14982 I came 
across this, which is due to inspect using warnings without having importing it.

Fix is trivial but can upload a patch

Traceback (most recent call last):
  File t.py, line 7, in module
print(list(iter_modules(path=vcs.__path__, prefix=vcs.__name__+'.')))
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/pkgutil.py, 
line 144, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/pkgutil.py, 
line 202, in iter_modules
modname = inspect.getmodulename(fn)
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py, 
line 448, in getmodulename
info = getmoduleinfo(path)
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py, 
line 436, in getmoduleinfo
warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning,
NameError: global name 'warnings' is not defined

--
components: Library (Lib)
messages: 162184
nosy: pnasrat
priority: normal
severity: normal
status: open
title: inspect missing warnings import
versions: Python 3.3

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



[issue11954] 3.3 - 'make test' fails

2012-06-02 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
status: pending - closed

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



[issue2401] Solaris: ctypes tests being skipped despite following #1516

2012-06-02 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

This seems really out of date now. Closing.

--
status: pending - closed

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



[issue14987] inspect missing warnings import

2012-06-02 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +brett.cannon

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



[issue14673] add sys.implementation

2012-06-02 Thread Eric Snow

Eric Snow ericsnowcurren...@gmail.com added the comment:

 - From the docs, I could not understand the difference between
 sys.implementation.version and sys.version_info.  When can they differ?

I'll make an update.  As an example, PyPy is at version 1.8 which implements 
the Python 2.7 language.  In that case sys.version_info would be (2, 7, 3, 
'final', 0) while sys.implementation.version might be (1, 8, 0, 'final', 0).

One confusing part is that for CPython they are exactly the same.  I think 
there's room for improvement with the versioning of the language specification 
itself, but one thing at a time!  :)

 - _PyNamespace_New should be a public API function.  From Python code,
 SimpleNamespace is public.
 - I agree that _PyNamespace_Type could stay private (it's an
 implementation detail), in this case PyAPI_DATA is not necessary.

Agreed, though I'd like to see sys.implementation go in first and take action 
on the PyNamespace type/API in a separate issue.

 - SimpleNamespace should support weak references.

I'll admit that I haven't used weakrefs a ton and am not familiar with the use 
cases.  However, the fact that most of the builtin types do not support weak 
references gives me pause to simply adding it.

I'd like more discussion on this, but in a separate issue so that it doesn't 
hold up sys.implementation.

--

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



[issue14673] add sys.implementation

2012-06-02 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Added file: http://bugs.python.org/file25804/issue14673_full_4.diff

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



[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5b267381eea0 by Terry Jan Reedy in branch '2.7':
Issue 10365: Add and replace comments; condense defaulted attribute access.
http://hg.python.org/cpython/rev/5b267381eea0

New changeset 4f3d4ce8ac9f by Terry Jan Reedy in branch '3.2':
Issue 10365: Add and replace comments; condense defaulted attribute access.
http://hg.python.org/cpython/rev/4f3d4ce8ac9f

New changeset d9b7399d9e45 by Terry Jan Reedy in branch 'default':
Merge with 3.2 #10365
http://hg.python.org/cpython/rev/d9b7399d9e45

--

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



[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2012-06-02 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue14987] inspect missing warnings import

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 3de5b053d924 by Brett Cannon in branch 'default':
Issue #14987: Add a missing import statement
http://hg.python.org/cpython/rev/3de5b053d924

--
nosy: +python-dev

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



[issue14987] inspect missing warnings import

2012-06-02 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
assignee:  - brett.cannon
resolution:  - fixed
status: open - closed

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



[issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing

2012-06-02 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Thanks. Fixed in changeset eb1d633fe307.

I'll watch the bots to see no problems remain.

--
status: open - closed

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2012-06-02 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Thanks.  It looks like the issue with the latest patch is caused by side 
effects of calling importlib.import_module().

Working from the patch, I got it to the point where inserting the following 
four lines somewhere in the code--

try:
importlib.import_module('foo__doesnotexist')
except:
pass

caused the exception raised by the following line--

module = importlib.import_module('package_foo2.subpackage.no_exist')

to change from this--

  ...
  File frozen importlib._bootstrap, line 1250, in _find_and_load_unlocked
ImportError: No module named 'package_foo2.subpackage.no_exist'

to this--

  ...
  File /Lib/importlib/_bootstrap.py, line 1257, in _find_and_load_unlocked
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'package_foo2'

It looks like this issue is cropping up in the tests because the test code 
dynamically adds packages to directories that importlib may already have 
examined.

In the reduced test case I was creating to examine the issue, I found that 
inserting a call to importlib.invalidate_caches() at an appropriate location 
resolved the issue.

Should loadTestsFromName() call importlib.invalidate_caches() in the new patch 
implementation, or should the test code be aware of that aspect of 
loadTestsFromName()'s behavior and be adjusted accordingly (e.g. by creating 
the dynamically-added packages in more isolated directories)?  For backwards 
compatibility reasons, how does loadTestsFromName() currently behave in this 
regard (i.e. does importlib.import_module() behave the same as __import__ with 
respect to caching)?

--

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



[issue14424] document PyType_GenericAlloc

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 3c43be281196 by Eli Bendersky in branch 'default':
Issue #14424: Document PyType_GenericAlloc, and fix the documentation of 
PyType_GenericNew
http://hg.python.org/cpython/rev/3c43be281196

--
nosy: +python-dev

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



[issue14424] document PyType_GenericAlloc

2012-06-02 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue14424] document PyType_GenericAlloc

2012-06-02 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
versions:  -Python 3.2

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



[issue12510] IDLE get_the_calltip mishandles raw strings

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 477508efe4ab by Terry Jan Reedy in branch '2.7':
Issue 12510: Expand 2 bare excepts. Improve comments. Change deceptive name
http://hg.python.org/cpython/rev/477508efe4ab

New changeset f927a5c6e4be by Terry Jan Reedy in branch '3.2':
Issue 12510: Expand 2 bare excepts. Improve comments. Change deceptive name
http://hg.python.org/cpython/rev/f927a5c6e4be

New changeset a7501ddf74ac by Terry Jan Reedy in branch 'default':
Merge with 3.2 #12510
http://hg.python.org/cpython/rev/a7501ddf74ac

--

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



[issue14090] Bus error on test_big_buffer() of test_zlib, buildbot AMD64 debian bigmem 3.x

2012-06-02 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 90f0dd118aa4 by Eli Bendersky in branch 'default':
Issue #14090: fix some minor C API problems in default branch (3.3)
http://hg.python.org/cpython/rev/90f0dd118aa4

--
nosy: +python-dev

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



[issue14190] Minor C API documentation bugs

2012-06-02 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Fixed what was relevant for default (3.3) in 90f0dd118aa4 (the commit message 
there has a typo in the issue number).

Since 3.3 is going to be out soon, I see no real reason to backport to 3.2

If anyone is willing to create a complete patch for 2.7 that fixes the relevant 
issues, I will review it. Ejaj, are your diffs for 2.7? Can you create a single 
patch?

--

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



[issue12510] IDLE: calltips mishandle raw strings and other examples

2012-06-02 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

CallTips.py has a 'main' test at the end. Currently, test TC fails in 3.x but 
not 2.7. So either the test became invalid or get_argspec was not completely 
and correctly converted from get_arg_text. This should be fixed.

int.append( does not bring up a tip on either version, but should if possible.

The failing examples in previous messages should be added to the tests to 
ensure that all pass now and continue to pass in the future. So I am not 
closing this yet, and a new patch is needed.

--
resolution: fixed - 
stage: committed/rejected - needs patch
title: IDLE get_the_calltip mishandles raw strings - IDLE: calltips mishandle 
raw strings and other examples

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



[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)

2012-06-02 Thread Westley Martínez

Westley Martínez aniko...@gmail.com added the comment:

You're right.  The code shouldn't *have* to check if the name is valid.  It 
should just accept that the name is already valid.  This would simplify things.

Here's the problem: the code needs to find the index of where the string with 
the filename starts.  The way the code does it now by checking for a quote in a 
rather obfuscated way (while i and curline[i-1] in FILENAME_CHARS + SEPS:).  
So, changing that line to say curline[i-1] != ' or curline[i-1] != '' would 
work (in theory) but I'm really hoping there's a better way.

--

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