Re: pathlib type error

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 10:55 PM, Georg Grafendorfer
georg.grafendor...@gmail.com wrote:
 I'm using Debian 8 Jessie on an AMD64 machine.
 Getting this error:

 ~$ python3
 Python 3.4.2 (default, Oct  8 2014, 10:45:20)
 [GCC 4.9.1] on linux
 Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'


Unable to reproduce:

rosuav@dewey:~$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
 q
PosixPath('/etc/init.d')
 pathlib.__file__
'/usr/lib/python3.4/pathlib.py'

Is it possible you have another pathlib installed? It's available on
PyPI, maybe you got it with pip - check 'pip freeze|grep pathlib' on
the off-chance. Is your pathlib.__file__ the same as mine?

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


pathlib type error

2015-01-03 Thread Georg Grafendorfer
Hi

I'm using Debian 8 Jessie on an AMD64 machine.
Getting this error:

~$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'



This also happens if I compile python3.4.2 from scratch:

.../data/Python-3.4.2$ ./python
Python 3.4.2 (default, Jan  3 2015, 12:42:09)
[GCC 4.9.1] on linux
Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'



On the same computer, using rescuecd 4.4.1 (Nov 2014) which ships python
3.4.1 it works as expected.

thanks for help, Georg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pathlib type error

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 11:06 PM, Chris Angelico ros...@gmail.com wrote:
 On Sat, Jan 3, 2015 at 10:55 PM, Georg Grafendorfer
 georg.grafendor...@gmail.com wrote:
 I'm using Debian 8 Jessie on an AMD64 machine.
 Getting this error:

 ~$ python3
 Python 3.4.2 (default, Oct  8 2014, 10:45:20)
 [GCC 4.9.1] on linux

 Unable to reproduce:

 rosuav@dewey:~$ python3
 Python 3.4.2 (default, Oct  8 2014, 10:45:20)
 [GCC 4.9.1] on linux

Should have clarified: Dewey is also running Debian Jessie.

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