Comments (4)
This is a very detailed report, and an interesting issue. I will look into it.
from chopsticks.
It looks as though the change in Python 3 is that an unbuffered file object opened with fdopen no longer returns exactly size
bytes - instead it focuses on only doing one system call.
We don't actually need an unbuffered file object in general - when we create 'inpipe' in bubble.py, it is buffered. However, the problem is that if we make the sys.stdin
file object in PYTHON_ARGS
buffered, it could read extra data into its buffers, which is thrown away in bubble.py
once we dup all the file descriptors around and open inpipe.
Here's a slightly odd solution that I think might work - only buffer the exact amount we need:
PYTHON_ARGS = [
'-usS',
'-c',
'import sys, os; _bsz = %d ;' % len(bubble) +
'sys.stdin = os.fdopen(0, \'rb\', _bsz); ' +
'__bubble = sys.stdin.read(_bsz); ' +
'exec(compile(__bubble, \'bubble.py\', \'exec\'))'
]
Could you try this and let me know if it works for you?
from chopsticks.
I'm not very happy with that actually. What we really need to do is keep hold of whatever is in the buffer - either modify or re-use the file object. I guess the simplest thing would be to do the stdin dup()
in PYTHON_ARGS
and don't re-open stdin in bubble.py
.
from chopsticks.
Here's my attempt following your directives. Tested on python2.7 and python3.5
from chopsticks.
Related Issues (20)
- Error importing packages that use pbr HOT 1
- Call logging.basicConfig on tunnel start HOT 1
- EP2017 Sprint details HOT 2
- Failing to instantiate an object causes traceback HOT 1
- Jupyter notebook import doesn't work recursively HOT 1
- Error when dis._unpack_opargs() does not exist
- Issues reported by lgtm.com
- Create a benchmark suite
- Write documentation for passwordless SSH
- Error when trying to print env HOT 2
- Decorated functions can't be called remotely
- Howto create Tunnel with ssh password HOT 5
- ErrorResult does not compare equal
- ImportError from deserialise_func
- Tunnel destructor prevents subsequent stderr interception HOT 1
- Comparison with multiprocessing remote manager
- can not call simple commands HOT 1
- RFC: pencode performance improvements
- Prompt responder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chopsticks.