[issue26743] Unable to import random with python2.7 on power pc based machine

2018-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

@csabella: Agreed. Let's close. Thanks!

--
resolution:  -> third party
stage:  -> 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



[issue26743] Unable to import random with python2.7 on power pc based machine

2018-02-13 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Since there hasn't been activity on this for nearly 2 years, should it be 
closed as third party?  Stefan seemed to conclude that it was a WindRiver 
issue.  Thanks!

--
nosy: +csabella

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Raghu

Raghu added the comment:

Thank you skrah. I raised a support request from WR. I will keep my fingers 
crossed.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Stefan Krah

Stefan Krah added the comment:

My conclusion is:  The error in msg263292 should have been
caught by the test suite.

I'd ask the WindRiver support if they actually run the test suite
before shipping the binaries.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Raghu

Raghu added the comment:

Yes, it is a WindRiver linux. I will check if Commercial WindRiver team can 
help me.

Host details:
Linux fpc0 3.10.62-ltsi-WR6.0.0.18_standard #1 SMP PREEMPT Sun Apr 3 23:17:02 
PDT 2016 ppc64 ppc64 ppc64 GNU/Linux



Also is there a protocol followed in this website? If I have done something 
wrong it's because I didn't know I was doing it incorrectly. I ask because, a 
new person replies everyday and they don't even completely tell me the solution 
or what conclusions they have made. I am lost.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Stefan Krah

Stefan Krah added the comment:

Also, I don't understand how the test suite could pass with
these kinds of errors. Are you sure this is the Wind-River
system Python?  Did they run the test suite?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Stefan Krah

Stefan Krah added the comment:

An option would be to use the support of the probably commercial

  http://www.windriver.com/products/linux/

and ask them why they're still on Python 2.7.3.  They'll also
have gcc installed and can run the test case proposed in this
issue.

--
nosy: +skrah

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Raghu

Raghu added the comment:

Hey Guys/Gals, are you still debugging the issue? Do you need more info?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

@stinner, my host doesn't have internet connection and it doesn't have gcc 
installed.

I don't know how to install gcc in windriverlinux.
In famous linux distributions like ubuntu and centos, i install gcc using 'yum 
install gcc' or 'apt-get install gcc' commands.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

Couple more outputs:


/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
#  define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
#  define WORDS_BIGENDIAN 1
# endif
#endif


Math works in some cases.

>>> import math
>>> math.sqrt(2)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: math domain error
>>> math.floor(2.5)
2.0
>>>



Also, could you please let me know the train of thought and ask for all the 
outputs as much as possible in one go? because I feel like I am delaying your 
debugging.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

Here is one output:

root@fpc0:~# grep IEEE /usr/include/python2.7/pyconfig-32.h
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
/* #undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 */
/* #undef HAVE_IEEEFP_H */
/* #undef HAVE_LIBIEEE */
/* Define to activate features from IEEE Stds 1003.1-2001 */
root@fpc0:~#

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

I guess that Serhiy is looking for these variables defined in pyconfig.h:
---
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
   mixed-endian order (byte order 45670123) */
#undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754

/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
   significant byte first */
#undef DOUBLE_IS_BIG_ENDIAN_IEEE754

/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
   least significant byte first */
#undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
---

On Fedora, pyconfig.h is installed into /usr/include/python2.7/pyconfig.h. This 
file doesn't contain any sensitive information, it is the configuration used to 
build Python.

On Fedora, this file only dispatches between pyconfig-32.h and pyconfig-64.h:
---
$ cat /usr/include/python2.7/pyconfig.h 
#include 

#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif
---

My system is 64-bit, so I can use pyconfig-64.h:
---
$ grep IEEE /usr/include/python2.7/pyconfig-64.h 
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
/* #undef HAVE_IEEEFP_H */
/* #undef HAVE_LIBIEEE */
/* Define to activate features from IEEE Stds 1003.1-2001 */
---

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

The keys ENDIAN and IEEE are not available.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fields with ENDIAN or IEEE in key.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

Hi, This is my work system and I don't know if I am allowed to send out the 
complete output of "print sysconfig.get_config_vars()". could you please let me 
know which fields you are looking for?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the output of `import sysconfig; print sysconfig.get_config_vars()`?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

There is no output for `python -m sysconfig`

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the output of `python -m sysconfig`?

Python 2.7.3 is too old. May be this issue was already fixed in newer versions. 
Can you install 2.7.11?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu

Raghu added the comment:

Serhiy,

root@host:~# python
Python 2.7.3 (default, Apr  3 2016, 22:31:30)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.pack('d', 2.0)
'@\x00\x00\x00\x00\x00\x00\x00'
>>> struct.pack('d', float(2))
'@\x00\x00\x00\x00\x00\x00\x00'
>>>

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the output of `struct.pack('d', 2.0)` and `struct.pack('d', float(2))`?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu

Raghu added the comment:

It's windriver linux. Processor is PPC64-E5500

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread STINNER Victor

STINNER Victor added the comment:

What is your Linux distribution and what is your CPU? (try to read 
/proc/cpuinfo)

You cannot install a C compiler?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu

Raghu added the comment:

my host details:

Linux fpc0 3.10.62-ltsi-WR6.0.0.18_standard #1 SMP PREEMPT Sun Apr 3 23:17:02 
PDT 2016 ppc64 ppc64 ppc64 GNU/Linux

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu

Raghu added the comment:

stinner victor, my host doesn't have a gcc compiler. is there a way you can 
give me the binary?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread STINNER Victor

STINNER Victor added the comment:

>>> print math.sqrt(2.0)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: math domain error

I'm surprised that such basic math function fails.

Can you please try to compile and run attached C program?

$ gcc sqrt.c -o sqrt -lm && ./sqrt
sqrt(2) = 1.41421

--
nosy: +haypo
Added file: http://bugs.python.org/file42459/sqrt.c

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu

Raghu added the comment:

Hi, I apologize. I didn't expect a quick reply.
Here are the outputs you requested.

root@host:~# python
Python 2.7.3 (default, Apr  3 2016, 22:31:30)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> print math.sqrt(2.0)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: math domain error
>>> print math

>>> import struct
>>> struct.pack('>>

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Mark Dickinson

Mark Dickinson added the comment:

The output of `struct.pack('

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

That's odd.

Try:
   import math
   print math.sqrt(2.0)
   print math

Post what you see.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +mark.dickinson, rhettinger, serhiy.storchaka
type: crash -> behavior

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-12 Thread Raghu

New submission from Raghu:

Hi, I am trying to import random on a power pc based machine and I see this 
exception. Could you please help me?

root@host# python
Python 2.7.3 (default, Apr  3 2016, 22:31:30)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/random.py", line 58, in 
NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0)
ValueError: math domain error
>>>

--
components: Library (Lib)
messages: 263292
nosy: ragreddy
priority: normal
severity: normal
status: open
title: Unable to import random with python2.7 on power pc based machine
type: crash
versions: Python 2.7

___
Python tracker 

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