[issue22107] tempfile module misinterprets access denied error on Windows

2016-05-03 Thread Billy McCulloch

Billy McCulloch added the comment:

I've also run into this bug on Windows. In my case, the tempdir path includes 
directories on a network share, which I lack write access permissions to. 
Python tries to generate a *lot* of files, and never figures out it should move 
on to another directory. The attached patch for tempdir.py resolves my issue.

In _get_default_tempdir() and _mkstemp_inner(), you want to know if the 
filename you tried to create already exists as a directory, not whether the 
parent directory is a directory – that's handled in _get_default_tempdir().

In mkdtemp(), attempting to create a directory with the same name as an 
existing directory does not throw a PermissionError, so the code is superfluous.

--
nosy: +Billy McCulloch
Added file: http://bugs.python.org/file42704/master...bjmcculloch_patch-1.diff

___
Python tracker 

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



python chess engines

2016-05-03 Thread DFS

On 5/3/2016 8:00 PM, DFS wrote:

How far along are you in your engine development?



I can display a text-based chess board on the console (looks better
with a mono font).

8   BR BN BB BQ BK BB BN BR

7   BP BP BP BP BP BP BP BP

6   __ __ __ __ __ __ __ __

5   __ __ __ __ __ __ __ __

4   __ __ __ __ __ __ __ __

3   __ __ __ __ __ __ __ __

2   WP WP WP WP WP WP WP WP

1   WR WN WB WQ WK WB WN WR

A  B  C  D  E  F  G  H


With feedback from this list, I had to break a lot of bad Java habits
to make the code more Pythonic. Right now I'm going back and forth
between writing documentation and unit tests. Once I finalized the
code in its current state, I'll post it up on GitHub under the MIT
license. Future updates will have a fuller console interface and
moves for individual pieces implemented.




Thank you,

Chris R.



Wanted to start a new thread, rather than use the 'motivated' thread.

Can you play your game at the console?

The way I think about a chess engine is it doesn't even display a board. 
 It accepts a move as input, records the move, analyzes the positions 
after the move, and returns the next move.


Here's the UCI protocol.
http://download.shredderchess.com/div/uci.zip


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


[issue26932] android: test_posix fails

2016-05-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo

___
Python tracker 

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



[issue26932] android: test_posix fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. But needed to update pyconfig.h.in and configure.

RTLD_* constants are also used in Modules/_ctypes/_ctypes.c and 
Python/pystate.c (this can be a cause of threading and ctypes issues on 
Android).

--

___
Python tracker 

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



[issue26932] android: test_posix fails

2016-05-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue26932] android: test_posix fails

2016-05-03 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

For test_getgroups, in Android 5.1 `id` does not support -G. [1] In Android 6.x 
`id` seems to support -G. [2] I guess CPython can just skip the test on Android 
< 6.0.

[1] 
https://android.googlesource.com/platform/system/core/+/android-5.1.1_r37/toolbox/id.c
[2] 
https://android.googlesource.com/platform/external/toybox/+/master/toys/posix/id.c

--

___
Python tracker 

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



Re: How to become more motivated to learn Python

2016-05-03 Thread Christopher Reimer

On 5/3/2016 8:00 PM, DFS wrote:

How far along are you in your engine development?


I can display a text-based chess board on the console (looks better with 
a mono font).



 8   BR BN BB BQ BK BB BN BR

 7   BP BP BP BP BP BP BP BP

 6   __ __ __ __ __ __ __ __

 5   __ __ __ __ __ __ __ __

 4   __ __ __ __ __ __ __ __

 3   __ __ __ __ __ __ __ __

 2   WP WP WP WP WP WP WP WP

 1   WR WN WB WQ WK WB WN WR

 A  B  C  D  E  F  G  H


With feedback from this list, I had to break a lot of bad Java habits to 
make the code more Pythonic. Right now I'm going back and forth between 
writing documentation and unit tests. Once I finalized the code in its 
current state, I'll post it up on GitHub under the MIT license. Future 
updates will have a fuller console interface and moves for individual 
pieces implemented.


Thank you,

Chris R.
--
https://mail.python.org/mailman/listinfo/python-list


[issue26932] android: test_posix fails

2016-05-03 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Patch attached for improved RTLD_* checking.

--
keywords: +patch
Added file: http://bugs.python.org/file42703/posixmodule_rtld_constants.patch

___
Python tracker 

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



Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Steven D'Aprano
On Wed, 4 May 2016 12:49 am, Jussi Piitulainen wrote:

> DFS writes:
> 
>> On 5/3/2016 9:13 AM, Chris Angelico wrote:
> 
>>> It doesn't invert, the way numeric negation does.
>>
>> What do you mean by 'case inverted'?
>>
>> It looks like it swaps the case correctly between upper and lower.
> 
> There's letters that do not come in exact pairs of upper and lower case,

Languages with two distinct lettercases, like English, are called bicameral.
The two cases are technically called majuscule and minuscule, but
colloquially known as uppercase and lowercase since movable type printers
traditionally used to keep the majuscule letters in a drawer above the
minuscule letters.

Many alphabets are unicameral, that is, they only have a single lettercase.
Examples include Hebrew, Arabic, Hangul, and many others. Georgian is an
interesting example, as it is the only known written alphabet that started
as a bicameral script and then became unicameral.

Consequently, many letters are neither upper nor lower case, and have
Unicode category "Letter other":

py> c = u'\N{ARABIC LETTER FEH}'
py> unicodedata.category(c)
'Lo'
py> c.isalpha()
True
py> c.isupper()
False
py> c.islower()
False


Even among bicameral alphabets, there are a few anomalies. The three most
obvious ones are Greek sigma, German Eszett (or "sharp S") and Turkish I.

(1) The Greek sigma is usually written as Σ or σ in uppercase and lowercase
respectively, but at the end of a word, lowercase sigma is written as ς.

(This final sigma is sometimes called "stigma", but should not be confused
with the archaic Greek letter stigma, which has two cases Ϛ ϛ, at least
when it is not being written as digamma Ϝϝ -- and if you're confused, so
are the Greeks :-)

Python 3.3 correctly handles the sigma/final sigma when upper- and
lowercasing:

py> 'ΘΠΣΤΣ'.lower()
'θπστς'

py> 'ΘΠΣΤΣ'.lower().upper()
'ΘΠΣΤΣ'



(2) The German Eszett ß traditionally existed in only lowercase forms, but
despite the existence of an uppercase form since at least the 19th century,
when the Germans moved away from blackletter to Roman-style letters, the
uppercase form was left out. In recent years, printers in Germany have
started to reintroduce an uppercase version, and the German government have
standardized on its use for placenames, but not other words.

(Aside: in Germany, ß is not considered a distinct letter of the alphabet,
but a ligature of ss; historically it derived from a ligature of ſs, ſz or
ſʒ. The funny characters you may or may not be able to see are the long-S
and round-Z.)

Python follows common, but not universal, German practice for eszett:

py> 'ẞ'.lower()
'ß'
py> 'ß'.upper()
'SS'

Note that this is lossy: given a name like "STRASSER", it is impossible to
tell whether it should be title-cased to "Strasser" or "Straßer". It also
means that uppercasing a string can make it longer.


For more on the uppercase eszett, see:

https://typography.guru/journal/germanys-new-character/
https://typography.guru/journal/how-to-draw-a-capital-sharp-s-r18/


(3) In most Latin alphabets, the lowercase i and j have a "tittle" diacritic
on them, but not the uppercase forms I and J. Turkish and a few other
languages have both I-with-tittle and I-without-tittle.

(As far as I know, there is no language with a dotless J.)

So in Turkish, the correct uppercase to lowercase and back again should go:

Dotless I: I -> ı -> I

Dotted I: İ -> i -> İ

Python does not quite manage to handle this correctly for Turkish
applications, since it loses the dotted/dotless distinction:

py> 'ı'.upper()
'I'
py> 'İ'.lower()
'i'

and further case conversions follow the non-Turkish rules.

Note that sometimes getting this wrong can have serious consequences:

http://gizmodo.com/382026/a-cellphones-missing-dot-kills-two-people-puts-three-more-in-jail



-- 
Steven

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


[issue26922] build from fresh checkout fails

2016-05-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Even updating from remote, and then making a fresh clone in a new directory, I 
can't reproduce this one - "./configure && make -j4" works for me.

Does strace give any potentially useful hints?

For me:

$ strace -e trace=file ./python -c "pass"

the apparently relevant part of the strace output looks like:

open("/home/ncoghlan/devel/cpython-pristine/pyvenv.cfg", O_RDONLY) = -1 ENOENT 
(No such file or directory)
open("/home/ncoghlan/devel/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or 
directory)
stat("/home/ncoghlan/devel/cpython-pristine/Modules/Setup", 
{st_mode=S_IFREG|0664, st_size=15129, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/os.py", {st_mode=S_IFREG|0664, 
st_size=37715, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/pybuilddir.txt", 
{st_mode=S_IFREG|0664, st_size=26, ...}) = 0
open("/home/ncoghlan/devel/cpython-pristine/pybuilddir.txt", O_RDONLY) = 3
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
stat("/usr/local/lib/python36.zip", 0x7ffc9a2d15a0) = -1 ENOENT (No such file 
or directory)
stat("/usr/local/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/local/lib/python36.zip", 0x7ffc9a2d1120) = -1 ENOENT (No such file 
or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, 
st_size=12288, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, 
st_size=12288, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, 
st_size=12288, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, 
st_size=12288, ...}) = 0
open("/home/ncoghlan/devel/cpython-pristine/Lib/", 
O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.cpython-36m-x86_64-linux-gnu.so",
 0x7ffc9a2d1320) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.abi3.so", 
0x7ffc9a2d1320) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.so", 
0x7ffc9a2d1320) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.py", 
{st_mode=S_IFREG|0664, st_size=5067, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.py", 
{st_mode=S_IFREG|0664, st_size=5067, ...}) = 0
open("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__pycache__/__init__.cpython-36.pyc",
 O_RDONLY|O_CLOEXEC) = 3

--

___
Python tracker 

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



Re: How to become more motivated to learn Python

2016-05-03 Thread DFS

On 5/3/2016 10:12 PM, Christopher Reimer wrote:



When I realized that I wasn't learning enough about the Python language
from translating BASIC games, I started coding a chess engine. If you
ever look at the academic literature for chess programming from the last
50+ years, you can spend a lifetime solving the programming challenges
from implementing the game of kings.



We can have a good thread on python chess engines some time.  I'm also 
going to write a chess engine in python - follow the UCI protocol and 
all.  You're way ahead of me, I'm sure, but I did already look into 
algebraic notation, game recording, FEN and all that.


pyChess is a nice little game: www.pychess.org

The one thing I'm not going to do is review anyone else's code until I 
put out v1.0 of my own.  My goal with v1.0 is for the pieces to make 
valid moves.  That's it.  Following that, I'll work in getting the game 
recording right.  No 'strategy' at first.  Maybe later I can load a 
library of well-known openings and try to utilize them.


How far along are you in your engine development?

Getting the code for en passant and castling right looks to be a bit of 
an obstacle.


What's nice is the strongest engine (Stockfish) is totally open source.


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


Re: How to become more motivated to learn Python

2016-05-03 Thread Cai Gengyang
Cool, I have finally summoned up enough activation energy to start on Unit 3, 
now going through the topic on Conditionals and Control Flows (stuff like this)

>>> boolthree = 200 == (50 * 5)
>>> boolthree
False

Guess it would be really cool to work on AI and games. ( I have been addicted 
to computer games for a long time lol --- To be able to design a blockbuster 
like Starcraft 2, Diablo 3 or Final Fantasy 7 would be an incredible feat !) 

Didn't know that chess programming goes back 50+ years --- I always thought 
that computer programs were a recent invention. As it turns out , Ada Lovelace 
wrote the world's first computer program in 1842 
(http://www.todayifoundout.com/index.php/2011/02/in-1842-ada-lovelace-wrote-the-worlds-first-computer-program/)
 if this piece is true 




On Wednesday, May 4, 2016 at 10:13:13 AM UTC+8, Christopher Reimer wrote:
> On 5/3/2016 4:20 AM, Cai Gengyang wrote:
> > So I have completed up to CodeAcademy's Python Unit 2 , now moving on to 
> > Unit3 : Conditionals and Control Flow.
> >
> > But I feel my motivation wavering , at times I get stuck and frustrated 
> > when trying to learn a new programming language ?
> >
> > This might not be a technical question per say, but it is a Python 
> > programming related one. How do you motivate a person (either yourself or 
> > your child) to become more interested in programming and stick with it ? Is 
> > determination in learning (especially in a tough field like software) 
> > partly genetic ?
> >
> > Related , This is a very well written essay on determination by Paul Graham 
> > http://www.paulgraham.com/determination.html
> >
> > Gengyang
> 
> I started out translating old BASIC games into Python. These are the 
> same BASIC games that I tried to program into my Commodore 64 without 
> much success when I was much younger. Many of these BASIC games are a 
> good introduction to classical programming problems like rolling dice 
> and playing cards.
> 
> http://www.atariarchives.org/basicgames/
> 
> When I realized that I wasn't learning enough about the Python language 
> from translating BASIC games, I started coding a chess engine. If you 
> ever look at the academic literature for chess programming from the last 
> 50+ years, you can spend a lifetime solving the programming challenges 
> from implementing the game of kings.
> 
> Thank you,
> 
> Chris R.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26932] android: test_posix fails

2016-05-03 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

On Android RTLD_* constants are not defined via macros but as enum values. I 
guess CPython needs to check each one in configure.ac. See [1]

[1] 
https://android.googlesource.com/platform/bionic/+/master/libc/include/dlfcn.h

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Xiang Zhang

Xiang Zhang added the comment:

I agree with you josh. Actually that's what I want to know, consistency. But I 
don't mention it in my post, so Guido only gives what to do in this case. In 
this thread, it means does Python code have to keep the invariant mentioned in 
msg75735?

--

___
Python tracker 

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



Re: How to become more motivated to learn Python

2016-05-03 Thread Christopher Reimer

On 5/3/2016 4:20 AM, Cai Gengyang wrote:

So I have completed up to CodeAcademy's Python Unit 2 , now moving on to Unit3 
: Conditionals and Control Flow.

But I feel my motivation wavering , at times I get stuck and frustrated when 
trying to learn a new programming language ?

This might not be a technical question per say, but it is a Python programming 
related one. How do you motivate a person (either yourself or your child) to 
become more interested in programming and stick with it ? Is determination in 
learning (especially in a tough field like software) partly genetic ?

Related , This is a very well written essay on determination by Paul Graham 
http://www.paulgraham.com/determination.html

Gengyang


I started out translating old BASIC games into Python. These are the 
same BASIC games that I tried to program into my Commodore 64 without 
much success when I was much younger. Many of these BASIC games are a 
good introduction to classical programming problems like rolling dice 
and playing cards.


http://www.atariarchives.org/basicgames/

When I realized that I wasn't learning enough about the Python language 
from translating BASIC games, I started coding a chess engine. If you 
ever look at the academic literature for chess programming from the last 
50+ years, you can spend a lifetime solving the programming challenges 
from implementing the game of kings.


Thank you,

Chris R.


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


Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Steven D'Aprano
On Wed, 4 May 2016 12:42 am, Jussi Piitulainen wrote:

> Ceterum censeo, the only suggested use for .swapcase I've ever heard of
> is encryption.

iF YOU'RE PROGRAMMING AN EDITOR, sWAP cASE IS REALLY USEFUL FOR THOSE LITTLE
capslock ACCIDENTS THAT PLAGUE TYPISTS.



-- 
Steven

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


Re: You gotta love a 2-line python solution

2016-05-03 Thread Steven D'Aprano
On Tue, 3 May 2016 01:56 pm, DFS wrote:

> On 5/2/2016 11:27 PM, jf...@ms4.hinet.net wrote:
>> DFS at 2016/5/3 9:12:24AM wrote:
>>> try
>>>
>>> from urllib.request import urlretrieve
>>>
>>>
http://stackoverflow.com/questions/21171718/urllib-urlretrieve-file-python-3-3
>>>
>>>
>>> I'm running python 2.7.11 (32-bit)
>>
>> Alright, it works...someway.
>>
>> I try to get a zip file. It works, the file can be unzipped correctly.
>>
> from urllib.request import urlretrieve
> urlretrieve("http://www.caprilion.com.tw/fed.zip;,
> "d:\\temp\\temp.zip")
>> ('d:\\temp\\temp.zip', )
>
>>
>> But when I try to get this forum page, it does get a html file but can't
>> be viewed normally.
>>
>
urlretrieve("https://groups.google.com/forum/#!topic/comp.lang.python/jFl3GJ
>> bmR7A", "d:\\temp\\temp.html")
>> ('d:\\temp\\temp.html', )
>
>>
>> I suppose the html is a much complex situation where more processes need
>> to be done before it can be opened by a web browser:-)
> 
> 
> Who knows what Google has done... it won't open in Opera.  The tab title
> shows up, but after 20-30 seconds the screen just stays blank and the
> cursor quits loading.


Dennis has given the answer to this, but since he has X-No-Archive=Yes, his
useful and well-written answer will be lost forever.

So I've taken the liberty of copying his answer here:

Dennis Lee Bieber says:

There's practically no HTML in that page -- just miles of
Javascript.
The one obvious item is:

-=-=-=-=-=-

        
      
-=-=-=-=-=-

which is a RELATIVE path. If you copied the file to your machine and then
load it in a browser, it will be looking for

/forum/C53652DA8B67255A46256B72F0D65A40.cache.js 

to be on your machine in a subdirectory of where you saved the main file.

You'd have to recreate most of the Google environment and fetch
anything that was referenced through a relative path first, to get the
content to display. Of course, you may find, for example, that the
Javascript at some point is doing a database lookup -- and you'd maybe have
to now duplicate the database...



-- 
Steven

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


Analytical Geometry in Python with GeoMath

2016-05-03 Thread Vinicius Mesel


Hey guys,

I'm back after some time in the darkness(lol).



So I'm here to announce my contribution for the mathematicians and physicians 
and other guys who love geometry like me!

I created a library called "GeoMath" that it's intent is to solve all 
Analytical Geometry problems in a simple way using Python.

If you want to check it out, here is the link: https://github.com/vmesel/GeoMath

And if you want to install it and start solving your problems with it, just 
run: pip install geomath!





Tnx,

Vinicius Mesel

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


Re: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Chris Angelico
On Wed, May 4, 2016 at 4:35 AM, Dan Strohl via Python-list
 wrote:
> I also have never actually used repr() to create code that could be fed back 
> to the interpreter (not saying it isn’t done, just that I haven’t run into 
> needing it), and there are so many of the libraries that do not return a 
> usable repr string that I would hesitate to even try it outside of a very 
> narrow use case.

Here's a repr that I like using with SQLAlchemy:

def __repr__(self):
return (self.__class__.__name__ + "(" +
", ".join("%s=%r" % (col.name, getattr(self, col.name)) for
col in self.__table__.columns) +
")")

That results in something that *looks* like you could eval it, but you
shouldn't ever actually do that (because it'd create a new object).
It's still an effective way to make the repr readable; imagine a list
that prints out like this:

[Person(id=3, name="Fred"), Person(id=6, name="Barney"), Person(id=8,
name="Joe")]

You can tell exactly where one starts and another ends; you can read
what's going on with these record objects. Making them
"pseudo-evalable" is worth doing, even if you should never *actually*
eval them.

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


Re: How to call a Python Class?

2016-05-03 Thread Ben Finney
David Shi via Python-list  writes:

> I found a Python class within an Open Source software.
> I would like to use it in my own Python script.
> I tried to import it, but I got following message.

Your text is mangled in transit. Please post only plain text messages
(avoid HTML or other “rich” content), so the formatting survives.

> from intersection import *Traceback (most recent call last):  File 
> "", line 1, in     from intersection import *ImportError: 
> bad magic number in 'intersection': b'\x03\xf3\r\n'
> Can any one help?

If we can see the exact code you tried, perhaps.

-- 
 \  “Holy hole in a donut, Batman!” —Robin |
  `\   |
_o__)  |
Ben Finney

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


Re: How to call a Python Class?

2016-05-03 Thread Chris Angelico
On Wed, May 4, 2016 at 8:56 AM, David Shi via Python-list
 wrote:
> I found a Python class within an Open Source software.
> I would like to use it in my own Python script.
> I tried to import it, but I got following message.
> from intersection import *Traceback (most recent call last):  File 
> "", line 1, in from intersection import *ImportError: 
> bad magic number in 'intersection': b'\x03\xf3\r\n'
> Can any one help?
> Regards.

Did you get a .py file, or only a .pyc? Try deleting all .pyc files
that you downloaded, and try again.

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


How to call a Python Class?

2016-05-03 Thread David Shi via Python-list
I found a Python class within an Open Source software.
I would like to use it in my own Python script.
I tried to import it, but I got following message.
from intersection import *Traceback (most recent call last):  File 
"", line 1, in     from intersection import *ImportError: 
bad magic number in 'intersection': b'\x03\xf3\r\n'
Can any one help?
Regards.
David
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Terry Reedy

On 5/3/2016 4:55 PM, Sayth Renshaw wrote:

Is there something obvious to this I am doing wrong?

Sayth


Somethin happened so that I don't see what you did.  Fortunately, it did 
show up for Peter, between the '?' and name, so he could answer.


--
Terry Jan Reedy

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


RE: How to become more motivated to learn Python

2016-05-03 Thread Clayton Kirkwood
Find some thing that you really need done, but you've put off because you
didn't have the programming knowledge to do.
Program parts of some thing that you are really interested in doing. For
instance, at some point, I need to find duplicate copies of hardcopy photos
that I have. I'd love to write a program that sorts, compares, and marks as
duplicates. I think I would go about doing this similar to facial
recognition or eye recognition where I would look for 30 points on each
photo and compare them instead of scanning and comparing every bit.

crk

> -Original Message-
> From: Python-list [mailto:python-list-
> bounces+crk=godblessthe...@python.org] On Behalf Of Cai Gengyang
> Sent: Tuesday, May 03, 2016 4:21 AM
> To: python-list@python.org
> Subject: How to become more motivated to learn Python
> 
> So I have completed up to CodeAcademy's Python Unit 2 , now moving on to
> Unit3 : Conditionals and Control Flow.
> 
> But I feel my motivation wavering , at times I get stuck and frustrated
when
> trying to learn a new programming language ?
> 
> This might not be a technical question per say, but it is a Python
programming
> related one. How do you motivate a person (either yourself or your child)
to
> become more interested in programming and stick with it ? Is determination
> in learning (especially in a tough field like software) partly genetic ?
> 
> Related , This is a very well written essay on determination by Paul
Graham --
> --
> http://www.paulgraham.com/determination.html
> 
> Gengyang
> --
> https://mail.python.org/mailman/listinfo/python-list

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


[issue26932] android: test_posix fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What RTLD_* constants exist on Android?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26927] android: test_mmap fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is other manifestation of issue26926.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> android: test_io fails

___
Python tracker 

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



[issue26926] android: test_io fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks similar to issue11184.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26929] android: test_strptime fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is other bug at the last week of a year:

import datetime
for i in range(25, 32):
print(datetime.date(1906, 12, i).strftime('%Y %U %w   %G %V %u'))

for i in range(1, 10):
print(datetime.date(1907, 1, i).strftime('%Y %U %w   %G %V %u'))

--

___
Python tracker 

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



Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Peter Otten
Sayth Renshaw wrote:

> Is there something obvious to this I am doing wrong?

> parser.add_argument("path", nargs="+") 
 
The "+" implicitly turns args.path into a list

> files |= set(glob.glob(args.path + '/*' + args.extension))

so the glob() argument is evaluated as

list + str + str

Try

name_pattern = "*" + args.extension
for path in args.path:
files.update(glob.glob(os.path.join(path, name_pattern)))

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


[issue26929] android: test_strptime fails

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

GNU libc says:

 ‘%V’
  The ISO 8601:1988 week number as a decimal number (range ‘01’
  through ‘53’).  ISO weeks start with Monday and end with
  Sunday.  Week ‘01’ of a year is the first week which has the
  majority of its days in that year; this is equivalent to the
  week containing the year’s first Thursday, and it is also
  equivalent to the week containing January 4.  Week ‘01’ of a
  year can contain days from the previous year.  The week before
  week ‘01’ of a year is the last week (‘52’ or ‘53’) of the
  previous year even if it contains days from the new year.

  This format was first standardized by POSIX.2-1992 and by
  ISO C99.


So on 1905-1-1, %V should be 52 instead of 53 as printed by android; is this 
the only bug ?

A pretty good test to find such a mistake.

--

___
Python tracker 

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



Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread Tim Chase
On 2016-05-03 13:00, DFS wrote:
> On 5/3/2016 11:28 AM, Tim Chase wrote:
> > On 2016-05-03 00:24, DFS wrote:
> >> One small comparison I was able to make was VBA vs python/pyodbc
> >> to summarize an Access database.  Not quite a fair test, but
> >> interesting nonetheless.
> >>
> >> Access 2003 file
> >> Access 2003 VBA code
> >> Time: 0.18 seconds
> >>
> >> same Access 2003 file
> >> 32-bit python 2.7.11 + 32-bit pyodbc 3.0.6
> >> Time: 0.49 seconds
> >
> > Curious whether you're forcing Access VBA to talk over ODBC or
> > whether Access is using native access/file-handling (and thus
> > bypassing the ODBC overhead)?
> 
> The latter, which is why I said "not quite a fair test".

Can you try the same tests, getting Access/VBA to use ODBC instead to
see how much overhead ODBC entails?

-tkc



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


[issue26812] ExtendedInterpolation drops user-defined 'vars' during _interpolate_some() recursion

2016-05-03 Thread Yih-En Andrew Ban

Yih-En Andrew Ban added the comment:

Sure, patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file42702/issue26812.patch

___
Python tracker 

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



Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Sayth Renshaw
Is there something obvious to this I am doing wrong? 

Sayth 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23003] traceback.{print_exc, print_exception, format_exc, format_exception}: Potential AttributeError

2016-05-03 Thread Andy Edwards

Andy Edwards added the comment:

I'm seeing this issue in Python 2.7

Andys-MacBook-Pro:jcore-api-py andy$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
Andys-MacBook-Pro:jcore-api-py andy$ python setup.py test
running test
running egg_info
writing requirements to jcore_api.egg-info/requires.txt
writing jcore_api.egg-info/PKG-INFO
writing top-level names to jcore_api.egg-info/top_level.txt
writing dependency_links to jcore_api.egg-info/dependency_links.txt
reading manifest file 'jcore_api.egg-info/SOURCES.txt'
writing manifest file 'jcore_api.egg-info/SOURCES.txt'
running build_ext
.
--
Ran 21 tests in 3.423s

OK
Andys-MacBook-Pro:jcore-api-py andy$ python setup.py test
running test
running egg_info
writing requirements to jcore_api.egg-info/requires.txt
writing jcore_api.egg-info/PKG-INFO
writing top-level names to jcore_api.egg-info/top_level.txt
writing dependency_links to jcore_api.egg-info/dependency_links.txt
reading manifest file 'jcore_api.egg-info/SOURCES.txt'
writing manifest file 'jcore_api.egg-info/SOURCES.txt'
running build_ext
.
--
Ran 21 tests in 3.422s

OK
Exception in thread jcore.io receiver:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", 
line 801, in __bootstrap_inner
self.run()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", 
line 754, in run
self.__target(*self.__args, **self.__kwargs)
  File "/Users/andy/jcore-api-py/jcore_api/_connection.py", line 104, in 
_run_recv_thread
traceback.print_exc()
AttributeError: 'NoneType' object has no attribute 'print_exc'

--
nosy: +jedwards1211

___
Python tracker 

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



[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-03 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-05-03 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



Broken pipe from gevent/pywsgi.py

2016-05-03 Thread Larry Martell
I have a python server that has this in the main:

from gevent import pywsgi

try:
httpd = pywsgi.WSGIServer(('0.0.0.0', 8000), app)
httpd.serve_forever()
except KeyboardInterrupt:
pass

Recently we began getting HTTPError: 504 Server Error: Gateway
Time-out on requests to the server. Looking in the logs I saw this:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line
508, in handle_one_response
self.run_application()
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line
495, in run_application
self.process_result()
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line
486, in process_result
self.write(data)
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line
380, in write
self._write_with_headers(data)
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line
400, in _write_with_headers
self._sendall(towrite)
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line
355, in _sendall
self.socket.sendall(data)
  File "/usr/local/lib/python2.7/dist-packages/gevent/socket.py", line
460, in sendall
data_sent += self.send(_get_memory(data, data_sent), flags)
  File "/usr/local/lib/python2.7/dist-packages/gevent/socket.py", line
437, in send
return sock.send(data, flags)
error: [Errno 32] Broken pipe
{'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_CONNECTION': 'close',
 'HTTP_HOST': 'bekku.bbmsc.com',
 'HTTP_USER_AGENT': 'python-requests/2.9.1',
 'HTTP_X_FORWARDED_FOR': '192.168.10.5',
 'HTTP_X_REAL_IP': '192.168.10.5',
 'PATH_INFO': '/readings',
 'QUERY_STRING': 'target=2225217193085335062=HM',
 'REMOTE_ADDR': '172.17.42.1',
 'REMOTE_PORT': '41708',
 'REQUEST_METHOD': 'GET',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'fdffcd119506',
 'SERVER_PORT': '8000',
 'SERVER_PROTOCOL': 'HTTP/1.0',
 'SERVER_SOFTWARE': 'gevent/1.0 Python/2.7',
 'wsgi.errors': ', mode 'w' at 0x7f4c299bc1e0>,
 'wsgi.input': ,
 'wsgi.multiprocess': False,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)} failed with error

Once this occurs it seems that no further requests are served. I
googled this and found many places where people said this was
happening, and many places where people explained why it was
happening, but no place did I find a way to fix or workaround this.

Does anyone know how to get it to continue processing after this occurs?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26929] android: test_strptime fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thus there is a gap between 1904-12-31 and 1905-1-1. This is a bug in 
strftime() on Android.

--

___
Python tracker 

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



[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Josh Rosenberg

Josh Rosenberg added the comment:

At some point someone really needs to decide if the C layer behavior of 
performing an identity test before full equality checking is something that 
should be emulated at the Python layer or not. The current state seems 
ridiculous, where C containers check identity first simply by using the easier 
RichCompareBool function, while Python containers have to have the 
identity-then-equality check rewritten explicitly, which feels like a DRY 
violation.

Makes it harder for non-CPython implementations too, since they end up either 
not matching CPython behavior, or writing extra code to match the CPython 
quirks.

I have nothing against this patch, but between PyObject_RichCompareBool and the 
various slightly strange behaviors in the argument parsing format codes (which 
leads to silly workarounds like _check_int_field in #20858), I feel like the 
Python code base is getting cluttered with hacks to emulate the hacky C layer.

--
nosy: +josh.r

___
Python tracker 

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



[issue26929] android: test_strptime fails

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

>>> for i in range(25, 32):
...   print(datetime.date(1904, 12, i).strftime('%Y %U %w   %G %V %u'))
... 
1904 52 0   1904 51 7
1904 52 1   1904 52 1
1904 52 2   1904 52 2
1904 52 3   1904 52 3
1904 52 4   1904 52 4
1904 52 5   1904 52 5
1904 52 6   1904 52 6
>>>

--

___
Python tracker 

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



[issue26929] android: test_strptime fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks. And what is the output of following code?

for i in range(25, 32):
print(datetime.date(1904, 12, i).strftime('%Y %U %w   %G %V %u'))

--

___
Python tracker 

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



[issue26929] android: test_strptime fails

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

root@generic_x86:/data/local/tmp # python
Python 3.6.0a0 (default:f4c6dab59cd8+, May  3 2016, 21:59:47) 
[GCC 4.9 20140827 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> for i in range(1, 10):
...   print(datetime.date(1905, 1, i).strftime('%Y %U %w   %G %V %u'))
... 
1905 01 0   1904 53 7
1905 01 1   1905 01 1
1905 01 2   1905 01 2
1905 01 3   1905 01 3
1905 01 4   1905 01 4
1905 01 5   1905 01 5
1905 01 6   1905 01 6
1905 02 0   1905 01 7
1905 02 1   1905 02 1
>>>

--

___
Python tracker 

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



Re: Need help understanding list structure

2016-05-03 Thread MRAB

On 2016-05-03 18:54, Dan Strohl via Python-list wrote:



I added a __repr__ method at the end of the gedcom library like so:

def __repr__(self):
""" Format this element as its original string """
result = repr(self.level())
if self.pointer() != "":
result += ' ' + self.pointer()
result += ' ' + self.tag()
if self.value() != "":
result += ' ' + self.value()
return result

and now I can print myList properly.

Eric and Michael also mentioned repr above, but I guess I needed someone
to spell it out for me. Thanks for taking the time to put it in terms an old dog
could understand.



Glad to help!  (being an old dog myself, I know the feeling!)

One other point for you, if your "__repr__(self)" code is the same as the 
"__str__(self)" code (which it looks like it is, at a glance at least), you can instead 
reference the __str__ method and save having a duplicate code block...  some examples:

=
Option 1:  This is the easiest to read (IMHO) and allows for the possibility 
that str() is doing something here like formatting or whatever.  (in this case 
it shouldn't be though).  However, to call this actually is taking multiple 
steps (calling object.__repr__, whch calls str(), which calls object.__str__(). 
)

def __repr__(self):
return str(self)

=
Option 2: this isn't hard to read, and just takes two steps (calling 
object.__repr__(), which calls object.__str__().

def __repr__(self):
return self.__str__()


Option 3:  it's not that this is hard to read, but since it doesn't follow the standard 
"def blah(self):" pattern, sometimes I overlook these in the code (even when I 
put them there).  This however is the shortest since it really just tells the object to 
return object.__str__() if either object.__repr__() OR object.__str__() is called.


__repr__ = __str__


This probably doesn't matter much in this case, since it probably isn't called 
that much in normal use (though there are always exceptions), and in the end, 
Python is fast enough that unless you really need to slice off a few 
milliseconds, you will never notice the difference, but just some food for 
thought.



Option 4:

Delete the __str__ method.


If there's no __str__, Python falls back to __repr__.

If there's no __repr__, Python falls back to the somewhere> format.


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


[issue26929] android: test_strptime fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the output of following code?

import datetime
for i in range(1, 10):
print(datetime.date(1905, 1, i).strftime('%Y %U %w   %G %V %u'))

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26039] More flexibility in zipfile write interface

2016-05-03 Thread Марк Коренберг

Changes by Марк Коренберг :


--
nosy:  -mmarkk

___
Python tracker 

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



[issue17909] Autodetecting JSON encoding

2016-05-03 Thread Geoffrey Sneddon

Changes by Geoffrey Sneddon :


--
nosy: +gsnedders

___
Python tracker 

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



Re: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Random832
On Tue, May 3, 2016, at 15:24, moa47...@gmail.com wrote:
> I also wanted to understand what character set it was returning. I was
> giving it a gedcom file with ansel encoding, which is normal. My
> genealogy program can also export its database to gedcom using UTF-8 and
> Unicode. But both of those character sets caused the gedcom library to
> generate an error msg that the file violated GEDCOM format.

You haven't said where this library can be found, or what the error
message was.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: crash while using PyCharm / Python3

2016-05-03 Thread Adam

"Jonathan N. Little"  wrote in message 
news:ncqc7j$na1$1...@dont-email.me...
> Adam wrote:
>> "Adam"  wrote in message
>> news:ncprqb$tl9$1...@news.albasani.net...
>>>
>>> "Jonathan N. Little"  wrote in message
>>> news:ncpjj0$7ug$1...@dont-email.me...
 Adam wrote:
> There ought to be a way to just reinstall the graphics subsystem 
> rather
> than
> an all-or-none installation approach.

 Yes you can. Did it for a borked install of the nVidia driver. 
 reference
 this:

 
>>>
>>> Thanks, even after doing the following...
>>>
>>> Problem: Need to purge -fglrx
>>>
>>> Typically, the following manual commands will properly uninstall -fglrx:
>>>
>>>   $ sudo apt-get remove --purge xorg-driver-fglrx fglrx*
>>>   $ sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri
>>> xserver-xorg-core
>>>   $ sudo dpkg-reconfigure xserver-xorg
>>>
>>> I still get that dreaded "The system is running in low-graphics mode"
>>> error.
>>> And, recovery mode failsafeX and Ctrl+Alt+F1 hangs with the following...
>>>
>>> 
>>> Initializing built-in extension MIT-SCREEN-SAVER
>>> Initializing built-in extension DOUBLE-BUFFER
>>> Initializing built-in extension RECORD
>>> Initializing built-in extension DPMS
>>> Initializing built-in extension Present
>>> Initializing built-in extension DRI3
>>> Initializing built-in extension X-Resource
>>> Initializing built-in extension XVideo
>>> Initializing built-in extension XVideo-MotionCompensation
>>> Initializing built-in extension SELinux
>>> Initializing built-in extension XFree86-VidModeExtension
>>> Initializing built-in extension XFree86-DGA
>>> Initializing built-in extension XFree86-DRI
>>> Initializing built-in extension DRI2
>>> Loading extension GLX
>>> 
>>>
>>
>> After trying the following...
>>
>> http://askubuntu.com/questions/577093/how-to-install-gnome-desktop
>>
>> $ sudo apt-get update
>> $ sudo apt-get install gnome-shell
>>
>>
>> http://tipsonubuntu.com/2014/06/06/change-display-manager-ubuntu-14-04/
>>
>> $ sudo dpkg-reconfigure lightdm
>
> Not sure about ATI, but when you purge the nVidia driver it takes Unity 
> with it so I had to reinstall unity-desktop afterwards. If you want 
> lightdm but are now using gdm, maybe it happened because unity-desktop was 
> uninstalled and you just installed gnome-shell, your can reset:
>
> sudo dpkg-reconfigure gdm
>
> and select lightdm from the list.
>

Today, I tried to switch from gdm back to lightdm and
still encountered the "The system is running in low-graphics mode" problem 
until I found...

NumLock Key ON...
http://ubuntuforums.org/showthread.php?t=2218111

grumblebum2 provided the fix in post #9...

For NumLock key ON (in Ubuntu 14.04), add...

greeter-setup-script=/usr/bin/numlockx on

to/usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
(not/etc/lightdm/lightdm.conf, which I deleted since there were no other 
settings)


>
> -- 
> Take care,
>
> Jonathan
> ---
> LITTLE WORKS STUDIO
> http://www.LittleWorksStudio.com 


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


Re: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread moa47401
quote - (Though to be fair, I don't really know what the actual problem was, so 
I might provide a different approach with a different goal )

Originally I was trying to understand the exact structure of the list being 
returned by the gedcom library. It worked as it was, but I wanted to add 
additional functionality.

I also wanted to understand what character set it was returning. I was giving 
it a gedcom file with ansel encoding, which is normal. My genealogy program can 
also export its database to gedcom using UTF-8 and Unicode. But both of those 
character sets caused the gedcom library to generate an error msg that the file 
violated GEDCOM format.

Keep in mind the gedcom format established by the Latter-day Saints hasn't been 
updated in 20+ years.

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


[issue26940] android: test_importlib hangs on armv7

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Interestingly, all the tests (issues #26938, #26939, #26940 and #26941) that 
hang on arm use sys.setswitchinterval() aggressively.

--

___
Python tracker 

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



[issue26941] android: test_threading hangs on armv7

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Interestingly, all the tests (issues #26938, #26939, #26940 and #26941) that 
hang on arm use sys.setswitchinterval() aggressively.

--

___
Python tracker 

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



[issue26938] android: test_concurrent_futures hangs on armv7

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Interestingly, all the tests (issues #26938, #26939, #26940 and #26941) that 
hang on arm use sys.setswitchinterval() aggressively.

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The attached test_output.txt file is the corresponding gdb backtrace[1].

Interestingly, all the tests (issues #26938, #26939, #26940 and #26941) that 
hang on arm use sys.setswitchinterval() aggressively.


[1] The backtrace is interleaved with:
  * Python Exception  'utf8' codec can't 
decode byte 0xb8 in posit ion 0: invalid start byte:
that seem to come from libpython, the python that is embeded in gdb to 
pretty-print gdb output
  * ---Type  to continue, or q  to quit---
sorry, had to resort to copy/paste, gdb 'set logging' does not seem to work

--
Added file: http://bugs.python.org/file42701/test_output.txt

___
Python tracker 

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



[issue24950] FAIL: test_expanduser when $HOME=/

2016-05-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-05-03 Thread Steve Dower

Steve Dower added the comment:

I was thinking more like this:

if DISTUTILS_USE_SDK:
assume PATH is configured
execute os.getenv("CC", "cl.exe") directly
else:
find VS in the registry
execute "cl.exe" etc.

The only change here from the current situation is preferring the CC variable 
in the former case when it is set. When we look up VS in the registry, we know 
what executable we are going to find and overriding them via the environment is 
only going to cause issues/vulnerabilities.

--

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-05-03 Thread Łukasz Langa

Łukasz Langa added the comment:

Oh, my bad. Yeah, that sounds like a worthwhile change.

--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-05-03 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Łukasz, my proposal was to also update distutils (in all Python versions that 
get bugfixes) to match the Setuptools behavior and Python 2 behavior. I'd still 
like to do that to harmonize the implementations.

--

___
Python tracker 

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



RE: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Dan Strohl via Python-list
> > One other point for you, if your "__repr__(self)" code is the same as
> > the "__str__(self)" code (which it looks like it is, at a glance at
> > least), you can instead reference the __str__ method and save having a
> > duplicate code block...
> 
> Alternatively, consider: the ‘__repr__’ method is intended to return a
> *programmer's* representation of the object. Commonly, this is text which
> looks like the Python expression which would create an equal
> instance::

Definitely true per what _repr__ is supposed to do per python docs.   However, 
in this case, that might not have solved the problem if the goal was to return 
the same as a __str__.  (Though to be fair, I don’t really know what the actual 
problem was, so I might provide a different approach with a different goal 
).

I also have never actually used repr() to create code that could be fed back to 
the interpreter (not saying it isn’t done, just that I haven’t run into needing 
it), and there are so many of the libraries that do not return a usable repr 
string that I would hesitate to even try it outside of a very narrow use case.

Personally, I normally use __repr__ to give me a useful troubleshooting 
representation of the object... but that representation might not be exactly 
the same as what would recreate the object since I might show information that 
is dynamic to the current state (like, the name of the parent instead of just a 
pointer or something).

I know that isn’t per the rules, but in the end, it makes it easier for me to 
troubleshoot the code.

Having said that, Ben is totally correct in terms of the "right" way to do it, 
my earlier suggestion was not "right".

Dan

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


[issue24950] FAIL: test_expanduser when $HOME=/

2016-05-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 194b356c84f5 by Serhiy Storchaka in branch '3.5':
Issue #24950: Fixed expanduser tests when the users home directory in pwd is 
"/".
https://hg.python.org/cpython/rev/194b356c84f5

New changeset b9b99cb85a5f by Serhiy Storchaka in branch 'default':
Issue #24950: Fixed expanduser tests when the users home directory in pwd is 
"/".
https://hg.python.org/cpython/rev/b9b99cb85a5f

--
nosy: +python-dev

___
Python tracker 

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



Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Ben Finney
Dan Strohl via Python-list  writes:

> One other point for you, if your "__repr__(self)" code is the same as
> the "__str__(self)" code (which it looks like it is, at a glance at
> least), you can instead reference the __str__ method and save having a
> duplicate code block...

Alternatively, consider: the ‘__repr__’ method is intended to return a
*programmer's* representation of the object. Commonly, this is text
which looks like the Python expression which would create an equal
instance::

>>> foo = datetime.date.fromtimestamp(13012345678)
>>> print(repr(foo))
datetime.date(2382, 5, 7)

So if there is a sensible “here is the expression that could have been
used to create this instance” text, have the ‘__repr__’ method return
that text::

>>> foo = LoremIpsum(bingle, bongle, bungle)
>>> print(repr(foo))
packagename.LoremIpsum("spam", 753, frob=True)

That text is very useful because it can be fed back into the interactive
interpreter to make an equal-valued instance and experiment further.

For some types, there isn't such an expression that would evaluate to an
equal-valued instance of the type. So the conventional non-evaluating
representation is used::

>>> foo = frobnicate_the_widget(widget)
>>> print(repr(foo))


This gives the crucial information of what the type is, and also gives
other interesting (to the programmer) attributes that characterise the
specific instance.

The fallback “” is the least helpful;
it gives the type and identity of the instance, but only because that's
the lowest common information ‘object’ can guarantee. Always implement a
more informative representation for your custom type, if you can.

-- 
 \“Intellectual property is to the 21st century what the slave |
  `\  trade was to the 16th.” —David Mertz |
_o__)  |
Ben Finney

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


[issue24950] FAIL: test_expanduser when $HOME=/

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yet one corner case is empty HOME value.

--

___
Python tracker 

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



RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list

> I added a __repr__ method at the end of the gedcom library like so:
> 
> def __repr__(self):
> """ Format this element as its original string """
> result = repr(self.level())
> if self.pointer() != "":
> result += ' ' + self.pointer()
> result += ' ' + self.tag()
> if self.value() != "":
> result += ' ' + self.value()
> return result
> 
> and now I can print myList properly.
> 
> Eric and Michael also mentioned repr above, but I guess I needed someone
> to spell it out for me. Thanks for taking the time to put it in terms an old 
> dog
> could understand.
> 

Glad to help!  (being an old dog myself, I know the feeling!)

One other point for you, if your "__repr__(self)" code is the same as the 
"__str__(self)" code (which it looks like it is, at a glance at least), you can 
instead reference the __str__ method and save having a duplicate code block...  
some examples:

=
Option 1:  This is the easiest to read (IMHO) and allows for the possibility 
that str() is doing something here like formatting or whatever.  (in this case 
it shouldn't be though).  However, to call this actually is taking multiple 
steps (calling object.__repr__, whch calls str(), which calls object.__str__(). 
)

def __repr__(self):
return str(self)

=
Option 2: this isn't hard to read, and just takes two steps (calling 
object.__repr__(), which calls object.__str__().

def __repr__(self):
return self.__str__()


Option 3:  it's not that this is hard to read, but since it doesn't follow the 
standard "def blah(self):" pattern, sometimes I overlook these in the code 
(even when I put them there).  This however is the shortest since it really 
just tells the object to return object.__str__() if either object.__repr__() OR 
object.__str__() is called.


__repr__ = __str__


This probably doesn't matter much in this case, since it probably isn't called 
that much in normal use (though there are always exceptions), and in the end, 
Python is fast enough that unless you really need to slice off a few 
milliseconds, you will never notice the difference, but just some food for 
thought.


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


[issue26933] android: test_posixpath fails

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

You are right. I will do that.

--

___
Python tracker 

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



Re: How to become more motivated to learn Python

2016-05-03 Thread mm0fmf

On 03/05/2016 17:50, Rob Gaddi wrote:

Cai Gengyang wrote:


So I have completed up to CodeAcademy's Python Unit 2 , now moving on to Unit3 
: Conditionals and Control Flow.

But I feel my motivation wavering , at times I get stuck and frustrated when 
trying to learn a new programming language ?

This might not be a technical question per say, but it is a Python programming 
related one. How do you motivate a person (either yourself or your child) to 
become more interested in programming and stick with it ? Is determination in 
learning (especially in a tough field like software) partly genetic ?

Related , This is a very well written essay on determination by Paul Graham 
http://www.paulgraham.com/determination.html

Gengyang


You don't.  Learning programming is dull and sloggy and inherently
unmotiving.

Now, solving a problem, on the other hand.  Solving a problem is fun.  A
real problem, an actual task that you actually need to do, not
FizzBang.  The thorny, nasty, horrible problems are great fun, and when
you beat them into submission and mount their heads on your wall, but
even the little ones like "I've got an 8GB USB stick, I want to put a
random selection of all my MP3 files onto it." are entertaining.

The Python's not the point.  It can never be the point.  Have a thing
you want to do, and not just "Get a high paying job." If the tool for
doing that thing is Python, so be it. If you need a soldering iron, or a
hammer and chisel, or a structural engineering degree instead, then go
figure out how to use one of those and Python will still be waiting when
you do need it.



+1

I learned Python because... I had a problem to solve.

First I had to recompile a Linux kernel for an oddball PPC based NAS I 
used a lowpower computer. Then I had to find the patches that fixed some 
USB issues. Then I had to make a USB GSM modem work as it was a nasty 
Windows Zero-CD system. Then I wrote a program in C/C++ to process data 
from the modem and play with the ASCII strings and then push them to a 
website. I used libcurl to do the web work. It was a nightmare to 
debug/enhance and handling raw C strings in C or C++ was a pain. And I 
thought there has to be a better way.


I kept seeing mention of Python so I thought I'll rewrite this in 
Python. But I couldn't find Python 2.7.x for PPC so I had to get the 
Python source and build that from scrath and check it worked OK.


It took about 7 days of deep hacking to be able to rewrite on a line by 
line basis the C/C++ in Python. Boy was it ugly. But it worked. Then as 
I enhanced the program it became more Pythonic and I starting using the 
language and not abusing it. And the more I used it the easier it 
became. That code is online on a cheap VM running 24/7 and has about 450 
users worldwide growing by several a week. This group was huge source of 
inspiration looking at the replies people gave to questions. It also 
motivated me to stop faffing about and convert my Python2 code to 
Python3 which again was straightforward.


So I learned Python to solve a real world problem and it took a huge 
amount of effort along the way to realise I had to get a better way to 
maintain a program that was now being relied on by others. I didn't set 
out to learn Python but I'm sure glad I did.


In 33 years of code bashing, I found a language that let me think about 
the problem not the programming language.


YMMV




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


Re: Need help understanding list structure

2016-05-03 Thread moa47401
I added a __repr__ method at the end of the gedcom library like so:

def __repr__(self):
""" Format this element as its original string """
result = repr(self.level())
if self.pointer() != "":
result += ' ' + self.pointer()
result += ' ' + self.tag()
if self.value() != "":
result += ' ' + self.value()
return result

and now I can print myList properly.

Eric and Michael also mentioned repr above, but I guess I needed someone to 
spell it out for me. Thanks for taking the time to put it in terms an old dog 
could understand.


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


[issue26933] android: test_posixpath fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'll push a patch for issue24950 in short time.

Try to search precedences for other your issues. May be they have patches, 
additional information or experienced people.

--

___
Python tracker 

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



Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread DFS

On 5/3/2016 11:28 AM, Tim Chase wrote:

On 2016-05-03 00:24, DFS wrote:

One small comparison I was able to make was VBA vs python/pyodbc to
summarize an Access database.  Not quite a fair test, but
interesting nonetheless.

Access 2003 file
Access 2003 VBA code
Time: 0.18 seconds

same Access 2003 file
32-bit python 2.7.11 + 32-bit pyodbc 3.0.6
Time: 0.49 seconds


Curious whether you're forcing Access VBA to talk over ODBC or
whether Access is using native access/file-handling (and thus
bypassing the ODBC overhead)?



The latter, which is why I said "not quite a fair test".


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


RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
Take a look at the docs for 
print() https://docs.python.org/3.5/library/functions.html#print 
str() https://docs.python.org/3.5/library/stdtypes.html#str
repr() https://docs.python.org/3.5/library/functions.html#repr 

When you do "print(object)", python will run everything through str() and 
output it.  

Str() will try to return a string representation of the object, what actually 
comes back will depend on how the objects author defined it.  If 
object.__str__() has been defined, it will use that, if __str__() is not 
defined, it will use object.__repr__().  If object.__repr__() has not been 
defined, it will something that looks like "object_name object at xxx".

So, as to your specific questions / comments:

> At the risk of coming across as a complete dunder-head, I think my confusion
> has to do with the type of data the library returns in the list. Any kind of 
> text
> or integer list I manually create, doesn't do this.
Actually, they do, but strings and integers have well defined __str__ and 
__repr__ methods, and behave pretty well.

So... think about what is actually being passed to the print() function in each 
case:

> print(type(myList))
Passing the string object of the results of type(myList)

> print(len(myList))
Passing the integer object returning from len(myList)

> print(myList[0])
Passing the gedcom ELEMENT object found at location 0 in the list

> print(myList[0:29])
Passing a list object created by copying the items from location 0 to location 
29 in the original list

> print(myList)
Passing the entire list object

> for x in myList:
> print(x)
Passing the individual gedcom ELEMENT objects from the list.

So, in each of these cases, you are passing different types of objects, and 
each one (string, integer, list, gedcom)  will behave differently depending on 
how it is coded.

> Why does printing a single item print the actual text of the object?
If you are printing a single item (print(myList[0]), you are printing the 
__str__ or __repr__ for the object stored at that location.

> Why does printing a range print the "representations" of the objects?
If you are printing a range of objects, you are printing the __str__ or 
__repr__ for the RANGE OBJECT or LIST object, not the object itself, which 
apparently only checks for a __repr__() method in the contained gedcom ELEMENT 
objects, which is not defined (see below).

> Why does iterating over the list print the actual text of the objects?
When iterating over the list, you are printing the specific items again (just 
like when you did print(myList[0])  ) 

> How can I determine what type of data is in the list?
Try print(type(myList[0])), which will give you the type of data in the first 
object in the list (though, keep in mind that the object type could be 
different in each item in the list).


If we look at the gedcom library (assuming you are talking about this one: 
https://github.com/madprime/python-gedcom/blob/master/gedcom/__init__.py) at 
the end of the file you can see they defined __str__() in the ELEMENT object,  
but there is no definition for __repr__(), which matches what we surmised above.

If you want to fix it by editing the gedcom library, you could simply add a 
line at the end like:
__repr__() = __str__()


Hope that helps.

Dan Strohl

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


[issue26696] Document collections.abc.ByteString

2016-05-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



Re: How to become more motivated to learn Python

2016-05-03 Thread Rob Gaddi
Cai Gengyang wrote:

> So I have completed up to CodeAcademy's Python Unit 2 , now moving on to 
> Unit3 : Conditionals and Control Flow. 
>
> But I feel my motivation wavering , at times I get stuck and frustrated when 
> trying to learn a new programming language ?
>
> This might not be a technical question per say, but it is a Python 
> programming related one. How do you motivate a person (either yourself or 
> your child) to become more interested in programming and stick with it ? Is 
> determination in learning (especially in a tough field like software) partly 
> genetic ?
>
> Related , This is a very well written essay on determination by Paul Graham 
> http://www.paulgraham.com/determination.html
>
> Gengyang

You don't.  Learning programming is dull and sloggy and inherently
unmotiving.

Now, solving a problem, on the other hand.  Solving a problem is fun.  A
real problem, an actual task that you actually need to do, not
FizzBang.  The thorny, nasty, horrible problems are great fun, and when
you beat them into submission and mount their heads on your wall, but
even the little ones like "I've got an 8GB USB stick, I want to put a
random selection of all my MP3 files onto it." are entertaining.

The Python's not the point.  It can never be the point.  Have a thing
you want to do, and not just "Get a high paying job." If the tool for
doing that thing is Python, so be it. If you need a soldering iron, or a
hammer and chisel, or a structural engineering degree instead, then go
figure out how to use one of those and Python will still be waiting when
you do need it.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread Tim Chase
On 2016-05-03 00:24, DFS wrote:
> One small comparison I was able to make was VBA vs python/pyodbc to 
> summarize an Access database.  Not quite a fair test, but
> interesting nonetheless.
> 
> Access 2003 file
> Access 2003 VBA code
> Time: 0.18 seconds
>
> same Access 2003 file
> 32-bit python 2.7.11 + 32-bit pyodbc 3.0.6
> Time: 0.49 seconds

Curious whether you're forcing Access VBA to talk over ODBC or
whether Access is using native access/file-handling (and thus
bypassing the ODBC overhead)?

-tkc


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


Re: Saving Consol outputs in a python script

2016-05-03 Thread Terry Reedy

On 5/3/2016 8:14 AM, drewes@gmail.com wrote:

Hello, I'm new to python and have a Question.

I'm running a c++ file with a python script like:

import os
import subprocess

subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", 
"this.caffemodel", "mean.binaryproto", "labels.txt", "Bild2.jpg"])

and it runes fine. On the console it gives me the output:

~/Desktop/Downloader/Sym+$ python Run_C.py
-- Prediction for Bild2.jpg --
0.9753 - "Class 1"
0.0247 - "Class 2"


What I need are the 2 values for the 2 classes saved in a variable in the .py 
script, so that I can write them into a text file.


pycaffe is a python interface to caffe.  You should look into it and 
probably use it.  Its functions will return python objects.  I suspect 
that is has a function that will return the result of calling the caffe 
classification function


Stackoverflow has question/answers tagged with 'caffe' and 'pycaffe'.
(There is also a caffe-users group on google groups.)

--
Terry Jan Reedy

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


Re: installing scipy

2016-05-03 Thread Heli
Yes, the python I have installed is 64bit. 

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit 
(AMD64)] on win32

and the scipy wheel I am trying to install from is :
scipy-0.17.0-cp34-none-win_amd64.whl

At Sayth: Thanks for recommending Anaconda. I already am familiar with it, but 
I was wondering why the scipy installed on my normal python gives the following 
error :

mportError: DLL load failed 

Thanks for your comments, 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Terry Reedy

On 5/3/2016 11:42 AM, Grant Edwards wrote:


Interesting. FWIW, Å and Å definitely look different with the terminal
and font I'm using (urxvt with 
-misc-fixed-medium-r-normal-*-18-120-*-*-*-90-iso10646-*)


In the fixed pitch font used by Thunderbird (Courier?), Angstrom Å has 
the circle touching the A while letter Å has the circle spaced above.


--
Terry Jan Reedy


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


[issue26933] android: test_posixpath fails

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

That was fast!
Thanks Serhiy.

--

___
Python tracker 

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



Re: You gotta love a 2-line python solution

2016-05-03 Thread Stephen Hansen
On Mon, May 2, 2016, at 08:57 PM, jf...@ms4.hinet.net wrote:
> Stephen Hansen at 2016/5/3 11:49:22AM wrote:
> > On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote:
> > > But when I try to get this forum page, it does get a html file but can't
> > > be viewed normally.
> > 
> > What does that mean?
> > 
> > -- 
> > Stephen Hansen
> >   m e @ i x o k a i . i o
> 
> The page we are looking at:-)
> https://groups.google.com/forum/#!topic/comp.lang.python/jFl3GJbmR7A

Try scraping gmane. Google Groups is one big javascript application.

-- 
Stephen Hansen
  m e @ i x o k a i . i o
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26922] build from fresh checkout fails

2016-05-03 Thread Brett Cannon

Brett Cannon added the comment:

That exception usually stems from when importlib.h has an error in it.

--
nosy: +brett.cannon

___
Python tracker 

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



Re: Need help understanding list structure

2016-05-03 Thread moa47401
At the risk of coming across as a complete dunder-head, I think my confusion 
has to do with the type of data the library returns in the list. Any kind of 
text or integer list I manually create, doesn't do this.

See my questions down below at the end.

If I run the following statements on the list returned by the gedcom library:

print(type(myList))
print(len(myList))
print(myList[0])
print(myList[0:29])
print(myList)
for x in myList:
print(x)

I get this:


29
0 HEAD
[, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , , , ]
[, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , 
, , , , ]
0 HEAD
1 SOUR AncestQuest
2 NAME Ancestral Quest
2 VERS 14.00.9
2 CORP Incline Software, LC
3 ADDR PO Box 95543
4 CONT South Jordan, UT 84095
4 CONT USA
1 DATE 3 MAY 2016
2 TIME 10:44:10
1 FILE test_gedcom.ged
1 GEDC
2 VERS 5.5
2 FORM LINEAGE-LINKED
1 CHAR ANSEL
0 @I1@ INDI
1 NAME John /Allen/
1 SEX M
1 BIRT
2 DATE 1750
2 PLAC VA
1 DEAT
2 DATE 1804
2 PLAC KY
1 _UID D6C103E6105D654B85D47DA1B36E474BC7D1
1 CHAN
2 DATE 3 MAY 2016
3 TIME 10:43:35
0 TRLR

Questions:

Why does printing a single item print the actual text of the object?
Why does printing a range print the "representations" of the objects?
Why does iterating over the list print the actual text of the objects?
How can I determine what type of data is in the list?

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


[issue26865] Meta-issue: support of the android platform

2016-05-03 Thread Xavier de Gaye

Xavier de Gaye added the comment:

All the dependencies of this issue are tagged with Components:Cross-Build and a 
title starting with 'android'.

Tests that fail on an android emulator running an x86 system image at API level 
21:

  issue #26918: android: test_pipes fails
  issue #26919: android: test_cmd_line fails
  issue #26920: android: test_sys fails
  issue #26924: android: test_concurrent_futures fails
  issue #26925: android: test_multiprocessing_main_handling fails
  issue #26926: android: test_io fails
  issue #26927: android: test_mmap fails
  issue #26928: android: test_site fails
  issue #26929: android: test_strptime fails
  issue #26931: android: test_distutils fails
  issue #26932: android: test_posix fails
  issue #26933: android: test_posixpath fails
  issue #26934: android: test_faulthandler fails
  issue #26935: android: test_os fails
  issue #26936: android: test_socket fails
  issue #26937: android: test_tarfile fails

Tests that fail on an android emulator running an armv7 system image (but not 
fail on x86) at API level 21:

  issue #26938: android: test_concurrent_futures hangs on armv7
  issue #26939: android: test_functools hangs on armv7
  issue #26940: android: test_importlib hangs on armv7
  issue #26941: android: test_threading hangs on armv7
  issue #26942: android: test_ctypes crashes on armv7

--

___
Python tracker 

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



[issue26537] ConfigParser has optionxform, but not sectionxform

2016-05-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26942] android: test_ctypes crashes on armv7

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_ctypes crashes on an android emulator running an armv7 system image (but 
not on x86) at API level 21.


143|root@generic:/data/local/tmp # python -m test -v test_ctypes
   
== CPython 3.6.0a0 (default:f4c6dab59cd8+, May 3 2016, 17:24:17) [GCC 4.9 
20140827 (prerelease)]
==   Linux-3.4.67-01422-gd3ffcc7-dirty-armv7l-with-libc little-endian
==   hash algorithm: fnv 32bit
==   /data/local/tmp/test_python_2301
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, 
no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, 
quiet=0, hash_randomiza
tion=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_ctypes
test_anon (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonmember (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonseq (ctypes.test.test_anon.AnonTest) ... ok
test_nested (ctypes.test.test_anon.AnonTest) ... ok
test (ctypes.test.test_array_in_pointer.Test) ... ok
test_2 (ctypes.test.test_array_in_pointer.Test) ... ok
test_bad_subclass (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_cache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_classcache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_address (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_addressW (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_numeric_arrays (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_simple (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_subclass (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_byval (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) 
... Fatal Python error
: Segmentation fault

Current thread 0xb6f2eec8 (most recent call first):
  File 
"/sdcard/org.bitbucket.pyona/lib/python3.6/ctypes/test/test_as_parameter.py", 
line 85 in test
_callbacks
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/case.py", line 600 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/case.py", line 648 
in __call__
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 122 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 84 
in __call__
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 122 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 84 
in __call__
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 122 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 84 
in __call__
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 122 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 84 
in __call__
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 122 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/suite.py", line 84 
in __call__
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/runner.py", line 176 
in run
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/support/__init__.py", 
line 1802 in _run_suite
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/support/__init__.py", 
line 1836 in run_unitte
st
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/runtest.py", 
line 166 in test_run
ner
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/runtest.py", 
line 167 in runtest_
inner
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/runtest.py", 
line 131 in runtest
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/main.py", 
line 332 in run_tests_s
equential
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/main.py", 
line 402 in run_tests
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/main.py", 
line 462 in _main
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/main.py", 
line 442 in main
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/libregrtest/main.py", 
line 504 in main
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/__main__.py", line 2 in 

  File "/sdcard/org.bitbucket.pyona/lib/python3.6/runpy.py", line 85 in 
_run_code
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/runpy.py", line 184 in 
_run_module_as_main
Segmentation fault

--
components: Cross-Build, Library (Lib)
messages: 264745
nosy: Alex.Willmer, amaury.forgeotdarc, belopolsky, meador.inge, xdegaye
priority: normal
severity: normal
status: open
title: android: test_ctypes crashes on armv7
type: crash
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

Re: Saving Consol outputs in a python script

2016-05-03 Thread Stephen Hansen
On Tue, May 3, 2016, at 05:14 AM, drewes@gmail.com wrote:
> What I need are the 2 values for the 2 classes saved in a variable in the
> .py script, so that I can write them into a text file.
> 
> Would be super nice if someone could help me!

You shouldn't use the call() convienence function, but instead create a
process using the Popen constructor, passing PIPE to stdout. Then use
communicate() to get the output.

This should get you started:

process = subprocess.Popen(["commandline"], stdout=subprocess.PIPE)
output, error = process.communicate()

Output will be a string, string has a splitlines method, etc.

-- 
Stephen Hansen
  m e @ i x o k a i . i o
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26941] android: test_threading hangs on armv7

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_threading hangs on an android emulator running an armv7 system image (but 
not on x86) at API level 21. The test suite hangs at

test_is_alive_after_fork (test.test_threading.ThreadTests) ...

A cause of this problem may be related to the fact that the android arm 
emulator runs very, very slowly.

--
components: Cross-Build, Library (Lib)
messages: 264744
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: android: test_threading hangs on armv7
type: behavior
versions: Python 3.6

___
Python tracker 

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



Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Grant Edwards
On 2016-05-03, Jussi Piitulainen  wrote:

>> Does that mean:
>>
>> lower(Å) != å ?
>>
>> and
>>
>> upper(å) != Å ?
>
> It means "\N{ANGSTROM SIGN}" != "Å", yet both lower to "å", which then
> uppers back to "Å" (U+00c5).
>
> The Ångström sign (U+212b) looks like this: Å. Indistinguishable from Å
> in the font that I'm seeing - for all I know, it's the same glyph.

Interesting. FWIW, Å and Å definitely look different with the terminal
and font I'm using (urxvt with 
-misc-fixed-medium-r-normal-*-18-120-*-*-*-90-iso10646-*)

Expecting upper/lower operations to be 100% invertible is probably a
ASCII-centric mindset that will falls over as soon as you start
dealing with non-ASCII encodings.

-- 
Grant Edwards   grant.b.edwardsYow! Xerox your lunch
  at   and file it under "sex
  gmail.comoffenders"!

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


[issue26940] android: test_importlib hangs on armv7

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_importlib hangs on an android emulator running an armv7 system image (but 
not on x86) at API level 21. The test suite hangs at

test_deadlock (test.test_importlib.test_locks.Frozen_DeadlockAvoidanceTests) ...

A cause of this problem may be related to the fact that the android arm 
emulator runs very, very slowly.

--
components: Cross-Build, Library (Lib)
messages: 264743
nosy: Alex.Willmer, brett.cannon, xdegaye
priority: normal
severity: normal
status: open
title: android: test_importlib hangs on armv7
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26938] android: test_concurrent_futures hangs on armv7

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_concurrent_futures hangs on an android emulator running an armv7 system 
image (but not on x86) at API level 21. The test suite hangs at:

test_pending_calls_race (test.test_concurrent_futures.ThreadPoolWaitTests) ...

A cause of this problem may be related to the fact that the android arm 
emulator runs very, very slowly.

--
components: Cross-Build, Library (Lib)
messages: 264740
nosy: Alex.Willmer, bquinlan, xdegaye
priority: normal
severity: normal
status: open
title: android: test_concurrent_futures hangs on armv7
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_functools hangs on an android emulator running an armv7 system image (but 
not on x86) at API level 21. The test suite hangs at

test_lru_cache_threaded (test.test_functools.TestLRUC) ...

A cause of this problem may be related to the fact that the android arm 
emulator runs very, very slowly.

--
components: Cross-Build, Library (Lib)
messages: 264742
nosy: Alex.Willmer, ncoghlan, rhettinger, xdegaye
priority: normal
severity: normal
status: open
title: android: test_functools hangs on armv7
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26922] build from fresh checkout fails

2016-05-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note this is a data point of how obscure and hard to debug the current early 
startup phase is :-)

--
nosy: +ncoghlan

___
Python tracker 

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



Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Jussi Piitulainen
DFS writes:

> On 5/3/2016 10:49 AM, Jussi Piitulainen wrote:
>> DFS writes:
>>
>>> On 5/3/2016 9:13 AM, Chris Angelico wrote:
>>
 It doesn't invert, the way numeric negation does.
>>>
>>> What do you mean by 'case inverted'?
>>>
>>> It looks like it swaps the case correctly between upper and lower.
>>
>> There's letters that do not come in exact pairs of upper and lower case,
>> so _some_ swaps are not invertible: you swap twice and end up somewhere
>> else than your starting point.
>>
>> The "\N{ANSGTROM SIGN}" looks like the Swedish upper-case
>> a-with-ring-above but isn't the same character, yet Python swaps its
>> case to the actual lower-case a-with-ring above. It can't go back to
>> _both_ the Angstrom sign and the actual upper case letter.
>>
>> (Not sure why the sign is considered a cased letter at all.)
>
>
> Thanks for the explanation.
>
> Does that mean:
>
> lower(Å) != å ?
>
> and
>
> upper(å) != Å ?

It means "\N{ANGSTROM SIGN}" != "Å", yet both lower to "å", which then
uppers back to "Å" (U+00c5).

The Ångström sign (U+212b) looks like this: Å. Indistinguishable from Å
in the font that I'm seeing - for all I know, it's the same glyph.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24950] FAIL: test_expanduser when $HOME=/

2016-05-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue26933] android: test_posixpath fails

2016-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue24950.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> FAIL: test_expanduser when $HOME=/

___
Python tracker 

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



Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread DFS

On 5/3/2016 10:49 AM, Jussi Piitulainen wrote:

DFS writes:


On 5/3/2016 9:13 AM, Chris Angelico wrote:



It doesn't invert, the way numeric negation does.


What do you mean by 'case inverted'?

It looks like it swaps the case correctly between upper and lower.


There's letters that do not come in exact pairs of upper and lower case,
so _some_ swaps are not invertible: you swap twice and end up somewhere
else than your starting point.

The "\N{ANSGTROM SIGN}" looks like the Swedish upper-case
a-with-ring-above but isn't the same character, yet Python swaps its
case to the actual lower-case a-with-ring above. It can't go back to
_both_ the Angstrom sign and the actual upper case letter.

(Not sure why the sign is considered a cased letter at all.)



Thanks for the explanation.

Does that mean:

lower(Å) != å ?

and

upper(å) != Å ?


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


[issue26936] android: test_socket fails

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_socket fails on an android emulator running an x86 system image at API 
level 21.


==
ERROR: testGetServBy (test.test_socket.GeneralModuleTests)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_socket.py", line 
913, in testGetServBy
port2 = socket.getservbyname(service)
OSError: service/proto not found

==
ERROR: testGetaddrinfo (test.test_socket.GeneralModuleTests)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_socket.py", line 
1240, in testGetaddrinfo
socket.getaddrinfo(HOST, "http")
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/socket.py", line 732, in 
getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 9] servname not supported for ai_socktype

--
Ran 530 tests in 26.702s

FAILED (errors=2, skipped=75)
test test_socket failed
1 test failed:
test_socket
Total duration: 0:00:27

--
components: Cross-Build, Library (Lib)
messages: 264737
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: android: test_socket fails
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26937] android: test_tarfile fails

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_tarfile fails on an android emulator running an x86 system image at API 
level 21.


==  
[0/9481]
FAIL: test_extract_with_numeric_owner (test.test_tarfile.NumericOwnerTest)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/mock.py", line 1175, 
in patched
return func(*args, **keywargs)
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_tarfile.py", line 
2483, in test_extract_
with_numeric_owner
any_order=True)
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/mock.py", line 856, 
in assert_has_calls
) from cause
AssertionError: 
(call('/data/local/tmp/test_python_2938/@test_2938_tmp-tardir/numeric-owner-testfile
', 99, 98), 
call('/data/local/tmp/test_python_2938/@test_2938_tmp-tardir/dir/numeric-owner-testfile'
, 88, 87)) not all found in call list

==
FAIL: test_extractall_with_numeric_owner (test.test_tarfile.NumericOwnerTest)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/mock.py", line 1175, 
in patched
return func(*args, **keywargs)
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_tarfile.py", line 
2503, in test_extracta
ll_with_numeric_owner
any_order=True)
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/unittest/mock.py", line 856, 
in assert_has_calls
) from cause
AssertionError: 
(call('/data/local/tmp/test_python_2938/@test_2938_tmp-tardir/numeric-owner-testfile
', 99, 98), call('/data/local/tmp/test_python_2938/@test_2938_tmp-tardir/dir', 
77, 76), call('/data/
local/tmp/test_python_2938/@test_2938_tmp-tardir/dir/numeric-owner-testfile', 
88, 87)) not all found
 in call list

--
Ran 426 tests in 5.549s

FAILED (failures=2, skipped=80)
test test_tarfile failed
1 test failed:
test_tarfile
Total duration: 0:00:06

--
components: Cross-Build, Library (Lib)
messages: 264738
nosy: Alex.Willmer, lars.gustaebel, xdegaye
priority: normal
severity: normal
status: open
title: android: test_tarfile fails
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26935] android: test_os fails

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

One test of test_os fails on an android emulator running an x86 system image at 
API level 21.

See the attached test_output.txt file.

--
components: Cross-Build, Library (Lib)
files: test_output.txt
messages: 264736
nosy: Alex.Willmer, loewis, xdegaye
priority: normal
severity: normal
status: open
title: android: test_os fails
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42700/test_output.txt

___
Python tracker 

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



[issue26934] android: test_faulthandler fails

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_faulthandler fails on an android emulator running an x86 system image at 
API level 21.

See the attached test_output.txt file.

--
components: Cross-Build, Library (Lib)
files: test_output.txt
messages: 264735
nosy: Alex.Willmer, haypo, xdegaye
priority: normal
severity: normal
status: open
title: android: test_faulthandler fails
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42699/test_output.txt

___
Python tracker 

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



Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Jussi Piitulainen
DFS writes:

> On 5/3/2016 9:13 AM, Chris Angelico wrote:

>> It doesn't invert, the way numeric negation does.
>
> What do you mean by 'case inverted'?
>
> It looks like it swaps the case correctly between upper and lower.

There's letters that do not come in exact pairs of upper and lower case,
so _some_ swaps are not invertible: you swap twice and end up somewhere
else than your starting point.

The "\N{ANSGTROM SIGN}" looks like the Swedish upper-case
a-with-ring-above but isn't the same character, yet Python swaps its
case to the actual lower-case a-with-ring above. It can't go back to
_both_ the Angstrom sign and the actual upper case letter.

(Not sure why the sign is considered a cased letter at all.)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26932] android: test_posix fails

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_posix fails on an android emulator running an x86 system image at API 
level 21.

For the first ERROR, on android we have instead of a list of group IDs:
root@generic_x86:/data/local/tmp # id -G
uid=0(root) gid=0(root) 
groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
 context=u:r:su:s0


==
ERROR: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
815, in test_getgroups
set([int(x) for x in groups.split()]),
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
815, in 
set([int(x) for x in groups.split()]),
ValueError: invalid literal for int() with base 10: 'uid=0(root)'

==
ERROR: test_rtld_constants (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
1128, in test_rtld_constants
posix.RTLD_LAZY
AttributeError: module 'posix' has no attribute 'RTLD_LAZY'

--
Ran 83 tests in 0.114s

FAILED (errors=2, skipped=11)
test test_posix failed
1 test failed:
test_posix
Total duration: 0:00:01

--
components: Cross-Build, Library (Lib)
messages: 264733
nosy: Alex.Willmer, larry, xdegaye
priority: normal
severity: normal
status: open
title: android: test_posix fails
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26933] android: test_posixpath fails

2016-05-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

test_posixpath fails on an android emulator running an x86 system image at API 
level 21.

On android we have:
root@generic_x86:/data/local/tmp # python
Python 3.6.0a0 (default:f4c6dab59cd8+, May  3 2016, 10:42:45) 
[GCC 4.9 20140827 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import posixpath, pwd, os
>>> posixpath.expanduser("~")
'/data'
>>> pwd.getpwuid(os.getuid()).pw_dir
'/'
>>>


Test results:

==
FAIL: test_expanduser (test.test_posixpath.PosixPathTest)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posixpath.py", line 
247, in test_expanduser
self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
AssertionError: '/' != ''
- /
+ 


--
Ran 54 tests in 0.046s

FAILED (failures=1)
test test_posixpath failed
1 test failed:
test_posixpath
Total duration: 0:00:01

--
components: Cross-Build, Library (Lib)
messages: 264734
nosy: Alex.Willmer, larry, xdegaye
priority: normal
severity: normal
status: open
title: android: test_posixpath fails
type: behavior
versions: Python 3.6

___
Python tracker 

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



  1   2   >