[issue40271] Allow shell like paths in

2020-04-14 Thread Gavin D'souza


Gavin D'souza  added the comment:

@serhiy.storchaka That makes perfect sense. Could we do something to add a 
parameter perhaps, to evaluate literal paths to not bread existing code? 
although this isn't "needed" but it'd be neat to handle this internally

--

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



[issue40271] Allow shell like paths in

2020-04-13 Thread Gavin D'souza


Gavin D'souza  added the comment:

Thank you @xtreak, I'm aware of "os.path.expanduser" and have used it 
extensively; I created this issue if we could do something about handling this 
internally in zipfile too.

--

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



[issue40272] ModuleNotFoundEror thrown by system python while accessing it specifically via venv python

2020-04-13 Thread Gavin D'souza


New submission from Gavin D'souza :

I have a tool that works as a wrapper over a web framework which in turn 
utilizes a virtualenv environment. So every app to be installed for a project 
is installed in it's own env folder. 

Recently, the virtualenv has been breaking throwing 'ModuleNotFoundError's 
however this issue only persists in macOS. The applications installed in each 
project's env are editable installs. The ModuleNotFoundError's are raised by 
the global python install which is all the more confusing as the commands are 
specifically executing using absolute paths in the env python and should be in 
the env site-packages. Even after successful env installs, activating the env 
and simply typing "import frappe" throws a ModuleNotFoundError. 

Reference commands executed by the wrapper program are like
./env/bin/python -m install -q -U -e ./apps/frappe

have also tried absolute paths but faced the same issue. However, this issue 
doesn't persist while using pyenv on macOS. Linux systems work fine too.

--
components: macOS
messages: 366299
nosy: gavin, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: ModuleNotFoundEror thrown by system python while accessing it 
specifically via venv python
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

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



[issue40271] Allow shell like paths in

2020-04-13 Thread Gavin D'souza


New submission from Gavin D'souza :

Related library: zipfile

Since zipfile allows relative dotted paths too, should shell-like paths, 
specifically with ~ (tilde) be allowed too?

This feels like unexpected behaviour and confusing for users as method 
"is_zipfile" returns False in case path doesn't exist as well. So, 
zipfile.is_zipfile("~/incorrect/path/to/zip") as well as 
zipfile.is_zipfile("~/path/to/zip") will return False

--
components: Library (Lib)
messages: 366297
nosy: gavin
priority: normal
severity: normal
status: open
title: Allow shell like paths in
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue36705] Unexpected Behaviour of pprint.pprint

2019-04-23 Thread Gavin D'souza


Gavin D'souza  added the comment:

if pprint is called without parameters, it returns a TypeError

>>> pprint()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: pprint() missing 1 required positional argument: 'object'

it would be beneficial however to return an empty string or a new line 
character instead. An erroneous call would generate an unnecessary run-time 
error in a huge script

--

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



[issue36705] Unexpected Behaviour of pprint.pprint

2019-04-23 Thread Gavin D'souza


New submission from Gavin D'souza :

For a simple string input, pprint would be expected to return an output similar 
to print. However, the functionality differs

### Code:
import time
from pprint import pprint

start = time.time()
time.sleep(0.5)
object_made = time.time()
time.sleep(0.5)
done = time.time()
time.sleep(0.5)
shown = time.time()

pprint(
f"Time to create object: {object_made - start}s\n" +
f"Time to insert 10 rows: {done - object_made}s\n" +
f"Time to retrieve 10 rows: {shown - done}s\n"
)

### Output Received:
('Time to create object: 0.5010814666748047s\n'
 'Time to insert 10 rows: 0.5010972023010254s\n'
 'Time to retrieve 10 rows: 0.501101016998291s\n')

### Expected Output:
Time to create object: 0.5010814666748047s
Time to insert 10 rows: 0.5010972023010254s
Time to retrieve 10 rows: 0.501101016998291s

--
components: Library (Lib)
messages: 340720
nosy: Gavin D'souza, fdrake
priority: normal
severity: normal
status: open
title: Unexpected Behaviour of pprint.pprint
type: behavior
versions: Python 3.7

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